Changeset 8825 for trunk/src


Ignore:
Timestamp:
Jul 2, 2002, 12:38:41 PM (23 years ago)
Author:
sandervl
Message:

removed RGB555 conversion functions

Location:
trunk/src/ddraw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ddraw/asmutil.asm

    r8819 r8825  
    1 ; $Id: asmutil.asm,v 1.10 2002-07-01 19:16:20 sandervl Exp $
     1; $Id: asmutil.asm,v 1.11 2002-07-02 10:38:40 sandervl Exp $
    22
    33;
     
    3131  CONST32  SEGMENT
    3232  CONST32  ENDS
    33 
    34 DATA32 SEGMENT
    35 
    36         align   4
    37   and1mask dd   0001F001Fh
    38            dd   0001F001Fh
    39   and2mask dd   0FFC0FFC0h
    40            dd   0FFC0FFC0h
    41   and2mask565 dd 0FFE07FE0h
    42               dd 07FE07FE0h
    43 
    44 DATA32  ENDS
    4533
    4634CODE32  SEGMENT
     
    21092097_MemFlip   ENDP
    21102098
    2111 ; void _Optlink DDrawRGB555to565 (WORD *dest, WORD *src, ULONG num);
    2112 
    2113         PUBLIC DDrawRGB555to565
    2114 
    2115 DDrawRGB555to565 PROC NEAR
    2116 
    2117         push    esi
    2118         push    edi
    2119         cld
    2120 
    2121         mov     edi, eax                ; _Optlink arg1 = EAX
    2122         mov     esi, edx                ; _Optlink arg2 = EDX
    2123         shr     ecx, 1                  ; _Optlink arg3 = ECX
    2124         pushf
    2125 cvt:
    2126         mov     eax, [esi]
    2127         mov     edx, eax
    2128 
    2129         add     esi, 4
    2130         shl     eax, 1
    2131 
    2132         and     edx, 0001F001Fh
    2133         and     eax, 0FFC0FFC0h
    2134 
    2135         add     edi, 4
    2136         or      eax, edx
    2137 
    2138         mov     [edi-4], eax
    2139         loop    cvt
    2140 
    2141         popf
    2142         jnc     SHORT done
    2143 
    2144         mov     ax, [esi]
    2145         mov     dx, ax
    2146         and     dx, 0001Fh
    2147         shl     ax, 1
    2148         and     ax, 0FFC0h
    2149         or      ax, dx
    2150         mov     [edi], ax
    2151 
    2152 done:
    2153         pop     edi
    2154         pop     esi
    2155         ret
    2156 
    2157 DDrawRGB555to565 ENDP
    2158 
    2159         PUBLIC DDrawRGB565to555
    2160 
    2161 DDrawRGB565to555 PROC NEAR
    2162 
    2163         push    esi
    2164         push    edi
    2165         cld
    2166 
    2167         cmp     ecx, 0
    2168         jz      done
    2169 
    2170         mov     edi, eax                ; _Optlink arg1 = EAX
    2171         mov     esi, edx                ; _Optlink arg2 = EDX
    2172         shr     ecx, 1                  ; _Optlink arg3 = ECX
    2173         pushf
    2174 cvt:
    2175         mov     eax, [esi]
    2176         mov     edx, eax
    2177 
    2178         add     esi, 4
    2179         shr     eax, 1
    2180 
    2181         and     edx, 0001F001Fh
    2182         and     eax, 0FFE07FE0h
    2183 
    2184         add     edi, 4
    2185         or      eax, edx
    2186 
    2187         mov     [edi-4], eax
    2188         loop    cvt
    2189 
    2190         popf
    2191         jnc     SHORT done
    2192 
    2193         mov     ax, [esi]
    2194         mov     dx, ax
    2195         and     dx, 0001Fh
    2196         shr     ax, 1
    2197         and     ax, 0FFE0h
    2198         or      ax, dx
    2199         mov     [edi], ax
    2200 
    2201 done:
    2202         pop     edi
    2203         pop     esi
    2204         ret
    2205 
    2206 DDrawRGB565to555 ENDP
    2207 
    2208 ; void _Optlink DDrawRGB555to565MMX(WORD *dest, WORD *src, ULONG num);
    2209 
    2210         PUBLIC DDrawRGB555to565MMX
    2211 
    2212 DDrawRGB555to565MMX PROC NEAR
    2213         push    esi
    2214         push    edi
    2215         cld
    2216 
    2217         cmp     ecx, 0
    2218         jz      done
    2219 
    2220         push    ecx
    2221        
    2222         mov     edi, eax                ; _Optlink arg1 = EAX
    2223         mov     esi, edx                ; _Optlink arg2 = EDX
    2224         shr     ecx, 3                  ; _Optlink arg3 = ECX
    2225         jz      lastpixels
    2226 
    2227         sub     esp, 108
    2228         fsaved  dword ptr [esp]
    2229 
    2230         movq    mm2, qword ptr and1mask         ;  0001F001F001F001Fh
    2231         movq    mm3, qword ptr and2mask         ;  FFC0FFC00FFC0FFC0h
    2232 
    2233 cvt:
    2234         movq    mm0, qword ptr [esi]
    2235         add     edi, 16
    2236 
    2237         movq    mm4, qword ptr [esi+8]
    2238         movq    mm1, mm0
    2239 
    2240         movq    mm5, mm4
    2241         psllq   mm0, 1
    2242 
    2243         psllq   mm4, 1
    2244         pand    mm1, mm2
    2245 
    2246         pand    mm0, mm3
    2247         pand    mm5, mm2
    2248 
    2249         pand    mm4, mm3
    2250         por     mm0, mm1
    2251 
    2252         por     mm4, mm5
    2253         add     esi, 16
    2254 
    2255         movq    qword ptr [edi-16], mm0
    2256         dec     ecx
    2257 
    2258         movq    qword ptr [edi-8], mm4
    2259         jnz     cvt
    2260 
    2261         nop
    2262         nop
    2263 
    2264         frstord dword ptr [esp]
    2265         add     esp, 108
    2266 
    2267 lastpixels:
    2268         pop     ecx
    2269         and     ecx, 3
    2270         jz      short done
    2271 
    2272 cvt2loop:
    2273         mov     ax, [esi]
    2274         mov     dx, ax
    2275 
    2276         add     esi, 2
    2277         and     dx, 001Fh
    2278 
    2279         shl     ax, 1
    2280         add     edi, 2
    2281 
    2282         and     ax, 0FFC0h
    2283         or      ax, dx
    2284 
    2285         mov     [edi-2], ax
    2286         loop    cvt2loop
    2287 
    2288 done:
    2289         pop     edi
    2290         pop     esi
    2291         ret
    2292 
    2293 DDrawRGB555to565MMX ENDP
    2294 
    2295 
    2296 ; void _Optlink DDrawRGB565to555MMX(WORD *dest, WORD *src, ULONG num);
    2297 
    2298         PUBLIC DDrawRGB565to555MMX
    2299 
    2300 DDrawRGB565to555MMX PROC NEAR
    2301         push    esi
    2302         push    edi
    2303         cld
    2304 
    2305         cmp     ecx, 0
    2306         jz      done
    2307 
    2308         push    ecx
    2309        
    2310         mov     edi, eax                ; _Optlink arg1 = EAX
    2311         mov     esi, edx                ; _Optlink arg2 = EDX
    2312         shr     ecx, 3                  ; _Optlink arg3 = ECX
    2313         jz      lastpixels
    2314 
    2315         sub     esp, 108
    2316         fsaved  dword ptr [esp]
    2317 
    2318         movq    mm2, qword ptr and1mask                 ;  0001F001F001F001Fh
    2319         movq    mm3, qword ptr and2mask565              ;  FFE07FE007FE07FE0h
    2320 
    2321 cvt:
    2322         movq    mm0, qword ptr [esi]
    2323         add     edi, 16
    2324 
    2325         movq    mm4, qword ptr [esi+8]
    2326         movq    mm1, mm0
    2327 
    2328         movq    mm5, mm4
    2329         psrlq   mm0, 1
    2330 
    2331         psrlq   mm4, 1
    2332         pand    mm1, mm2
    2333 
    2334         pand    mm0, mm3
    2335         pand    mm5, mm2
    2336 
    2337         pand    mm4, mm3
    2338         por     mm0, mm1
    2339 
    2340         por     mm4, mm5
    2341         add     esi, 16
    2342 
    2343         movq    qword ptr [edi-16], mm0
    2344         dec     ecx
    2345 
    2346         movq    qword ptr [edi-8], mm4
    2347         jnz     cvt
    2348 
    2349         nop
    2350         nop
    2351 
    2352         frstord dword ptr [esp]
    2353         add     esp, 108
    2354 
    2355 lastpixels:
    2356         pop     ecx
    2357         and     ecx, 3
    2358         jz      short done
    2359 
    2360 cvt2loop:
    2361         mov     ax, [esi]
    2362         mov     dx, ax
    2363 
    2364         add     esi, 2
    2365         and     dx, 001Fh
    2366 
    2367         shr     ax, 1
    2368         add     edi, 2
    2369 
    2370         and     ax, 0FFE0h
    2371         or      ax, dx
    2372 
    2373         mov     [edi-2], ax
    2374         loop    cvt2loop
    2375 
    2376 done:
    2377         pop     edi
    2378         pop     esi
    2379         ret
    2380 
    2381 DDrawRGB565to555MMX ENDP
    2382 
    23832099CODE32          ENDS
    23842100
  • trunk/src/ddraw/asmutil.h

    r8818 r8825  
    1 /* $Id: asmutil.h,v 1.7 2002-07-01 19:15:26 sandervl Exp $ */
     1/* $Id: asmutil.h,v 1.8 2002-07-02 10:38:41 sandervl Exp $ */
    22
    33/*
     
    2828extern int __cdecl CPUHasMMX();
    2929
    30 void _Optlink DDrawRGB555to565(char *dest, char *src, ULONG num);
    31 void _Optlink DDrawRGB555to565MMX(char *dest, char *src, ULONG num);
    32 
    33 void _Optlink DDrawRGB565to555(char *dest, char *src, ULONG num);
    34 void _Optlink DDrawRGB565to555MMX(char *dest, char *src, ULONG num);
    35 
    3630#ifdef __cplusplus
    3731}
Note: See TracChangeset for help on using the changeset viewer.