Previous 199869 Revisions Next

r23712 Friday 14th June, 2013 at 17:10:10 UTC by O. Galibert
powervr2: Fix blc/blic [O. Galibert]
[src/mame/video]powervr2.c

trunk/src/mame/video/powervr2.c
r23711r23712
9696#define DEBUG_PALRAM (1)
9797#define DEBUG_PVRCTRL   (0)
9898
99// Perform a standard bilinear filter across four pixels
10099inline INT32 powervr2_device::clamp(INT32 in, INT32 min, INT32 max)
101100{
102101   if(in < min) return min;
r23711r23712
104103   return in;
105104}
106105
106// Perform a standard bilinear filter across four pixels
107107inline UINT32 powervr2_device::bilinear_filter(UINT32 c0, UINT32 c1, UINT32 c2, UINT32 c3, float u, float v)
108108{
109109   UINT32 ui = (u * 256.0);
r23711r23712
130130{
131131   UINT32 cr =
132132      (((c1 & 0x000000ff)*(c2 & 0x000000ff) & 0x0000ff00) >> 8)  |
133      (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0x00ff0000) >> 8);
133      (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0xff000000) >> 16);
134134   c1 >>= 16;
135135   c2 >>= 16;
136136   cr |=
137137      (((c1 & 0x000000ff)*(c2 & 0x000000ff) & 0x0000ff00) << 8)  |
138      (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0x00ff0000) << 8);
138      (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0xff000000));
139139   return cr;
140140}
141141
r23711r23712
144144{
145145   UINT32 cr =
146146      (((c1 & 0x000000ff)*(0x00100-(c2 & 0x000000ff)) & 0x0000ff00) >> 8)  |
147      (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0x00ff0000) >> 8);
147      (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0xff000000) >> 16);
148148   c1 >>= 16;
149149   c2 >>= 16;
150150   cr |=
151151      (((c1 & 0x000000ff)*(0x00100-(c2 & 0x000000ff)) & 0x0000ff00) << 8)  |
152      (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0x00ff0000) << 8);
152      (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0xff000000));
153153   return cr;
154154}
155155

Previous 199869 Revisions Next


© 1997-2024 The MAME Team