+ if (!(PicoDrawMask & PDRAW_32X_ON))
+ return;
+
+ dram = (void *)Pico32xMem->dram[Pico32x.vdp_regs[0x0a/2] & P32XV_FS];
+ ps = dram + dram[line];
+
+ if ((Pico32x.vdp_regs[0] & P32XV_Mx) == 2) { // Direct Color Mode
+ int inv = (Pico32x.vdp_regs[0] & P32XV_PRI) ? 0x8000 : 0;
+ unsigned int m1 = 0x001f001f;
+ unsigned int m2 = 0x03e003e0;
+ unsigned int m3 = 0xfc00fc00;
+
+ for (i = 320; i > 0; i--, ps++, pd++, pb++) {
+ unsigned short t = *ps;
+ if (*pb != 0 && !((t ^ inv) & 0x8000))
+ continue;
+
+ *pd = ((t & m1) << 11) | ((t & m2) << 1) | ((t & m3) >> 10);
+ }
+ return;
+ }
+