forked from KolibriOS/kolibrios
sysfunction 65 can now output 1bpp and 4bpp images
git-svn-id: svn://kolibrios.org@911 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -4209,6 +4209,30 @@ sys_putimage_palette:
|
||||
add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.left]
|
||||
rol edx, 16
|
||||
.forced:
|
||||
cmp esi, 1
|
||||
jnz @f
|
||||
push edi
|
||||
mov eax, [edi+4]
|
||||
sub eax, [edi]
|
||||
push eax
|
||||
push dword [edi]
|
||||
push 0ffffff80h
|
||||
mov edi, esp
|
||||
call put_mono_image
|
||||
add esp, 12
|
||||
pop edi
|
||||
ret
|
||||
@@:
|
||||
cmp esi, 4
|
||||
jnz @f
|
||||
push edi
|
||||
push 0ffffff80h
|
||||
mov edi, esp
|
||||
call put_4bit_image
|
||||
pop eax
|
||||
pop edi
|
||||
ret
|
||||
@@:
|
||||
push ebp esi ebp
|
||||
cmp esi, 8
|
||||
jnz @f
|
||||
@@ -4243,15 +4267,28 @@ sys_putimage_palette:
|
||||
pop ebp esi ebp
|
||||
ret
|
||||
|
||||
put_mono_image:
|
||||
push ebp esi ebp
|
||||
mov ebp, putimage_get1bpp
|
||||
mov esi, putimage_init1bpp
|
||||
jmp sys_putimage_bpp
|
||||
put_4bit_image:
|
||||
push ebp esi ebp
|
||||
mov ebp, putimage_get4bpp
|
||||
mov esi, putimage_init4bpp
|
||||
jmp sys_putimage_bpp
|
||||
|
||||
putimage_init24bpp:
|
||||
lea eax, [eax*3]
|
||||
putimage_init8bpp:
|
||||
ret
|
||||
|
||||
align 16
|
||||
putimage_get24bpp:
|
||||
mov eax, [esi]
|
||||
add esi, 3
|
||||
ret 4
|
||||
align 16
|
||||
putimage_get8bpp:
|
||||
movzx eax, byte [esi]
|
||||
push edx
|
||||
@@ -4261,16 +4298,78 @@ putimage_get8bpp:
|
||||
inc esi
|
||||
ret 4
|
||||
|
||||
putimage_init1bpp:
|
||||
add eax, ecx
|
||||
push ecx
|
||||
add eax, 7
|
||||
add ecx, 7
|
||||
shr eax, 3
|
||||
shr ecx, 3
|
||||
sub eax, ecx
|
||||
pop ecx
|
||||
ret
|
||||
align 16
|
||||
putimage_get1bpp:
|
||||
push edx
|
||||
mov edx, [esp+8]
|
||||
mov al, [edx]
|
||||
adc al, al
|
||||
jnz @f
|
||||
lodsb
|
||||
adc al, al
|
||||
@@:
|
||||
mov [edx], al
|
||||
sbb eax, eax
|
||||
and eax, [edx+8]
|
||||
add eax, [edx+4]
|
||||
pop edx
|
||||
ret 4
|
||||
|
||||
putimage_init4bpp:
|
||||
add eax, ecx
|
||||
push ecx
|
||||
add ecx, 1
|
||||
add eax, 1
|
||||
shr ecx, 1
|
||||
shr eax, 1
|
||||
sub eax, ecx
|
||||
pop ecx
|
||||
ret
|
||||
align 16
|
||||
putimage_get4bpp:
|
||||
push edx
|
||||
mov edx, [esp+8]
|
||||
add byte [edx], 80h
|
||||
jc @f
|
||||
movzx eax, byte [edx+1]
|
||||
mov edx, [edx+4]
|
||||
and eax, 0x0F
|
||||
mov eax, [edx+eax*4]
|
||||
pop edx
|
||||
ret 4
|
||||
@@:
|
||||
movzx eax, byte [esi]
|
||||
add esi, 1
|
||||
mov [edx+1], al
|
||||
shr eax, 4
|
||||
mov edx, [edx+4]
|
||||
mov eax, [edx+eax*4]
|
||||
pop edx
|
||||
ret 4
|
||||
|
||||
putimage_init32bpp:
|
||||
shl eax, 2
|
||||
ret
|
||||
align 16
|
||||
putimage_get32bpp:
|
||||
lodsd
|
||||
ret 4
|
||||
|
||||
putimage_init15bpp:
|
||||
putimage_init16bpp:
|
||||
add eax, eax
|
||||
ret
|
||||
align 16
|
||||
putimage_get15bpp:
|
||||
; 0RRRRRGGGGGBBBBB -> 00000000RRRRR000GGGGG000BBBBB000
|
||||
push ecx edx
|
||||
@@ -4289,9 +4388,7 @@ putimage_get15bpp:
|
||||
pop edx ecx
|
||||
ret 4
|
||||
|
||||
putimage_init16bpp:
|
||||
add eax, eax
|
||||
ret
|
||||
align 16
|
||||
putimage_get16bpp:
|
||||
; RRRRRGGGGGGBBBBB -> 00000000RRRRR000GGGGGG00BBBBB000
|
||||
push ecx edx
|
||||
|
Reference in New Issue
Block a user