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