trunk/src/mame/video/powervr2.c
| r23711 | r23712 | |
| 96 | 96 | #define DEBUG_PALRAM (1) |
| 97 | 97 | #define DEBUG_PVRCTRL (0) |
| 98 | 98 | |
| 99 | | // Perform a standard bilinear filter across four pixels |
| 100 | 99 | inline INT32 powervr2_device::clamp(INT32 in, INT32 min, INT32 max) |
| 101 | 100 | { |
| 102 | 101 | if(in < min) return min; |
| r23711 | r23712 | |
| 104 | 103 | return in; |
| 105 | 104 | } |
| 106 | 105 | |
| 106 | // Perform a standard bilinear filter across four pixels |
| 107 | 107 | inline UINT32 powervr2_device::bilinear_filter(UINT32 c0, UINT32 c1, UINT32 c2, UINT32 c3, float u, float v) |
| 108 | 108 | { |
| 109 | 109 | UINT32 ui = (u * 256.0); |
| r23711 | r23712 | |
| 130 | 130 | { |
| 131 | 131 | UINT32 cr = |
| 132 | 132 | (((c1 & 0x000000ff)*(c2 & 0x000000ff) & 0x0000ff00) >> 8) | |
| 133 | | (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0x00ff0000) >> 8); |
| 133 | (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0xff000000) >> 16); |
| 134 | 134 | c1 >>= 16; |
| 135 | 135 | c2 >>= 16; |
| 136 | 136 | cr |= |
| 137 | 137 | (((c1 & 0x000000ff)*(c2 & 0x000000ff) & 0x0000ff00) << 8) | |
| 138 | | (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0x00ff0000) << 8); |
| 138 | (((c1 & 0x0000ff00)*(c2 & 0x0000ff00) & 0xff000000)); |
| 139 | 139 | return cr; |
| 140 | 140 | } |
| 141 | 141 | |
| r23711 | r23712 | |
| 144 | 144 | { |
| 145 | 145 | UINT32 cr = |
| 146 | 146 | (((c1 & 0x000000ff)*(0x00100-(c2 & 0x000000ff)) & 0x0000ff00) >> 8) | |
| 147 | | (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0x00ff0000) >> 8); |
| 147 | (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0xff000000) >> 16); |
| 148 | 148 | c1 >>= 16; |
| 149 | 149 | c2 >>= 16; |
| 150 | 150 | cr |= |
| 151 | 151 | (((c1 & 0x000000ff)*(0x00100-(c2 & 0x000000ff)) & 0x0000ff00) << 8) | |
| 152 | | (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0x00ff0000) << 8); |
| 152 | (((c1 & 0x0000ff00)*(0x10000-(c2 & 0x0000ff00)) & 0xff000000)); |
| 153 | 153 | return cr; |
| 154 | 154 | } |
| 155 | 155 | |