- Timestamp:
- Feb 3, 2000, 7:59:36 PM (26 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r2602 r2614 1 /* $Id: blit.cpp,v 1. 3 2000-02-03 10:23:24 dengertExp $ */1 /* $Id: blit.cpp,v 1.4 2000-02-03 18:59:04 sandervl Exp $ */ 2 2 3 3 /* … … 14 14 #include <stdarg.h> 15 15 #include <string.h> 16 #include <cpuhlp.h> 16 17 #include "misc.h" 17 18 #include "dibsect.h" 19 #include "rgbcvt.h" 18 20 19 21 static ULONG QueryPaletteSize(BITMAPINFOHEADER *pBHdr); … … 86 88 INT result, imgsize, palsize, height, width; 87 89 char *ptr; 88 ULONG compression = 0 ;90 ULONG compression = 0, iHeight; 89 91 WORD *newbits = 0; 90 92 … … 135 137 ((BITMAPINFO *)info)->bmiHeader.biCompression = 0; 136 138 compression = BI_BITFIELDS; 137 if(*(bitfields+1) == 0x3E0) {//RGB 555? 138 extern void _Optlink RGB555to565 (WORD *dest, WORD *src, ULONG num); 139 139 if(*(bitfields+1) == 0x3E0) 140 {//RGB 555? 140 141 newbits = (WORD *)malloc(imgsize); 141 RGB555to565 (newbits, (WORD *)bits, imgsize/sizeof(WORD)); 142 if(CPUFeatures & CPUID_MMX) { 143 RGB555to565MMX(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 144 } 145 else RGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 142 146 bits = newbits; 143 147 } 144 148 } 145 149 146 if(info->bmiHeader.biHeight < 0) 150 iHeight = info->bmiHeader.biHeight; 151 if(info->bmiHeader.biHeight < 0) { 147 152 ((BITMAPINFO *)info)->bmiHeader.biHeight = -info->bmiHeader.biHeight; 148 153 } 149 154 result = O32_SetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (PBITMAPINFO)info, coloruse); 150 155 //SvL: Wrong Open32 return value … … 159 164 if(newbits) free(newbits); 160 165 } 166 ((BITMAPINFO *)info)->bmiHeader.biHeight = iHeight; 161 167 return result; 162 168 -
trunk/src/gdi32/makefile
r2603 r2614 1 # $Id: makefile,v 1.1 7 2000-02-03 10:24:00 dengertExp $1 # $Id: makefile,v 1.18 2000-02-03 18:59:36 sandervl Exp $ 2 2 3 3 # … … 64 64 65 65 dibitmap.obj: dibitmap.cpp dibsect.h $(PDWIN32_INCLUDE)\misc.h 66 blit.obj: blit.cpp dibsect.h $(PDWIN32_INCLUDE)\misc.h 66 blit.obj: blit.cpp dibsect.h $(PDWIN32_INCLUDE)\misc.h rgbcvt.h 67 67 68 68 font.obj: font.cpp \ -
trunk/src/gdi32/rgbcvt.asm
r2612 r2614 1 ; $Id: rgbcvt.asm,v 1. 2 2000-02-03 18:06:36 achimhaExp $1 ; $Id: rgbcvt.asm,v 1.3 2000-02-03 18:59:04 sandervl Exp $ 2 2 ; Copyright 2000 Daniela Engert (dani@ngrt.de) 3 3 4 .386p 4 .586p 5 .MMX 5 6 .MODEL FLAT 7 8 .DATA 9 10 align 4 11 and1mask dd 001F001Fh 12 dd 001F001Fh 13 and2mask dd 0FFC0FFC0h 14 dd 0FFC0FFC0h 15 6 16 .CODE 7 17 … … 12 22 RGB555to565 PROC NEAR 13 23 14 PUSH ESI15 PUSH EDI16 CLD24 push esi 25 push edi 26 cld 17 27 18 MOV EDI, EAX; _Optlink arg1 = EAX19 MOV ESI, EDX; _Optlink arg2 = EDX20 SHR ECX, 1 ; _Optlink arg3 = ECX21 PUSHF28 mov edi, eax ; _Optlink arg1 = EAX 29 mov esi, edx ; _Optlink arg2 = EDX 30 shr ecx, 1 ; _Optlink arg3 = ECX 31 pushf 22 32 cvt: 23 LODSD 24 MOV EDX, EAX 25 AND EDX, 001F001Fh 26 SHL EAX, 1 27 AND EAX, 0FFC0FFC0h 28 OR EAX, EDX 29 STOSD 30 LOOP cvt 33 mov eax, [esi] 34 mov edx, eax 31 35 32 POPF33 JNC SHORT done36 add esi, 4 37 shl eax, 1 34 38 35 LODSW 36 MOV DX, AX 37 AND DX, 001Fh 38 SHL AX, 1 39 AND AX, 0FFC0h 40 OR AX, DX 41 STOSW 39 and edx, 001F001Fh 40 and eax, 0FFC0FFC0h 41 42 add edi, 4 43 or eax, edx 44 45 mov [edi-4], eax 46 loop cvt 47 48 popf 49 jnc SHORT done 50 51 mov ax, [esi] 52 mov dx, ax 53 and dx, 001Fh 54 shl ax, 1 55 and ax, 0FFC0h 56 or ax, dx 57 mov [edi], ax 42 58 43 59 done: 44 POP EDI45 POP ESI46 RET60 pop edi 61 pop esi 62 ret 47 63 48 ENDP 64 RGB555to565 ENDP 65 66 ; void _Optlink RGB555to565MMX(WORD *dest, WORD *src, ULONG num); 67 68 PUBLIC RGB555to565MMX 69 70 RGB555to565MMX PROC NEAR 71 push esi 72 push edi 73 cld 74 75 cmp ecx, 0 76 jz done 77 78 push ecx 79 80 mov edi, eax ; _Optlink arg1 = EAX 81 mov esi, edx ; _Optlink arg2 = EDX 82 shr ecx, 3 ; _Optlink arg3 = ECX 83 jz lastpixels 84 85 sub esp, 108 86 fsaved dword ptr [esp] 87 88 movq mm2, qword ptr and1mask ; 0001F001F001F001Fh 89 movq mm3, qword ptr and2mask ; FFC0FFC00FFC0FFC0h 90 91 cvt: 92 movq mm0, qword ptr [esi] 93 add edi, 16 94 95 movq mm4, qword ptr [esi+8] 96 movq mm1, mm0 97 98 movq mm5, mm4 99 psllq mm0, 1 100 101 psllq mm4, 1 102 pand mm1, mm2 103 104 pand mm0, mm3 105 pand mm5, mm2 106 107 pand mm4, mm3 108 por mm0, mm1 109 110 por mm4, mm5 111 add esi, 16 112 113 movq qword ptr [edi-16], mm0 114 dec ecx 115 116 movq qword ptr [edi-8], mm4 117 jnz cvt 118 119 nop 120 nop 121 122 frstord dword ptr [esp] 123 add esp, 108 124 125 lastpixels: 126 pop ecx 127 and ecx, 3 128 jz short done 129 130 cvt2loop: 131 mov ax, [esi] 132 mov dx, ax 133 134 add esi, 2 135 and dx, 001Fh 136 137 shl ax, 1 138 add edi, 2 139 140 and ax, 0FFC0h 141 or ax, dx 142 143 mov [edi-2], ax 144 loop cvt2loop 145 146 done: 147 pop edi 148 pop esi 149 ret 150 151 RGB555to565MMX ENDP 49 152 50 153 END
Note:
See TracChangeset
for help on using the changeset viewer.