Subversion Repositories pentevo

Rev

Rev 796 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. #include "std.h"
  2.  
  3. // SAM style video drive (only 8 bit, double-size screen)
  4.  
  5.  
  6. #ifdef MOD_VID_VD
  7.  
  8. void rend_vd8dbl(unsigned char *dst, unsigned pitch)
  9. {
  10.    unsigned char *dst2 = dst + (temp.ox-512)*temp.obpp/16;
  11.    dst2 += (temp.scy-192)/2*(pitch*2);
  12.  
  13.    if (conf.fast_sl) {
  14.  
  15.       pitch *= 2;
  16.       rend_frame_8d1(dst, pitch);
  17.       dst = dst2;
  18.       for (unsigned y = 0; y < 192; y++) {
  19.          unsigned char *src = (unsigned char*)vdmem + t.scrtab[y];
  20.          for (unsigned x = 0; x < 32; x++) {
  21.             __m64 d =          t.vdtab[0][0][src[0x2000*0+x]];
  22.             d = _mm_add_pi8(d, t.vdtab[0][1][src[0x2000*1+x]]);
  23.             d = _mm_add_pi8(d, t.vdtab[0][2][src[0x2000*2+x]]);
  24.             d = _mm_add_pi8(d, t.vdtab[0][3][src[0x2000*3+x]]);
  25.  
  26.             *(__m64*)(dst+x*16+0) = _mm_unpacklo_pi8(d,d);
  27.             *(__m64*)(dst+x*16+8) = _mm_unpackhi_pi8(d,d);
  28.          }
  29.          dst += pitch;
  30.       }
  31.  
  32.    } else {
  33.  
  34.       rend_frame_8d(dst, pitch);
  35.       dst = dst2;
  36.       for (unsigned y = 0; y < 192; y++) {
  37.          unsigned char *src = (unsigned char*)vdmem + t.scrtab[y];
  38.          for (unsigned pass = 0; pass < 2; pass++) {
  39.             for (unsigned x = 0; x < 32; x++) {
  40.                __m64 d =          t.vdtab[pass][0][src[0x2000*0+x]];
  41.                d = _mm_add_pi8(d, t.vdtab[pass][1][src[0x2000*1+x]]);
  42.                d = _mm_add_pi8(d, t.vdtab[pass][2][src[0x2000*2+x]]);
  43.                d = _mm_add_pi8(d, t.vdtab[pass][3][src[0x2000*3+x]]);
  44.  
  45.                *(__m64*)(dst+x*16+0) = _mm_unpacklo_pi8(d,d);
  46.                *(__m64*)(dst+x*16+8) = _mm_unpackhi_pi8(d,d);
  47.             }
  48.             dst += pitch;
  49.          }
  50.       }
  51.    }
  52.    _mm_empty();
  53. }
  54.  
  55. #endif
  56.