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:
parent
4589f3ae78
commit
01bb499fab
@ -3402,8 +3402,8 @@ IPC
|
||||
* ebx = 㪠§ â¥«ì ¨§®¡à ¦¥¨¥
|
||||
* ecx = [à §¬¥à ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ y]
|
||||
* edx = [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||||
* esi = ç¨á«® ¡¨â ¯¨ªá¥«ì, ¤®«¦® ¡ëâì 8, 15, 16, 24 ¨«¨ 32
|
||||
* edi = 㪠§ â¥«ì ¯ «¨âàã (256 梥⮢ 0x00RRGGBB);
|
||||
* esi = ç¨á«® ¡¨â ¯¨ªá¥«ì, ¤®«¦® ¡ëâì 1, 4, 8, 15, 16, 24 ¨«¨ 32
|
||||
* edi = 㪠§ â¥«ì ¯ «¨âàã (2 ¢ á⥯¥¨ esi 梥⮢ 0x00RRGGBB);
|
||||
¨£®à¨àã¥âáï ¯à¨ esi > 8
|
||||
* ebp = ᬥ饨¥ ¤ ëå ª ¦¤®© á«¥¤ãî饩 áâப¨ ¨§®¡à ¦¥¨ï
|
||||
®â®á¨â¥«ì® ¯à¥¤ë¤ã饩
|
||||
@ -3413,6 +3413,14 @@ IPC
|
||||
* Š®®à¤¨ âë ¨§®¡à ¦¥¨ï - íâ® ª®®à¤¨ âë ¢¥à奣® «¥¢®£® 㣫
|
||||
¨§®¡à ¦¥¨ï ®â®á¨â¥«ì® ®ª .
|
||||
* <20> §¬¥à ¨§®¡à ¦¥¨ï ¢ ¡ ©â å ¥áâì xsize*ysize.
|
||||
* ”®à¬ â ¨§®¡à ¦¥¨ï á 1 ¡¨â®¬ ¯¨ªá¥«ì: ª ¦¤ë© ¡ ©â ¨§®¡à ¦¥¨ï,
|
||||
§ ¨áª«î票¥¬, ¡ëâì ¬®¦¥â, ¯®á«¥¤¨å ¡ ©â®¢ áâப, ᮤ¥à¦¨â
|
||||
¨ä®à¬ æ¨î ® 梥⥠8 ¯¨ªá¥«¥©, áâ à訩 ¡¨â ᮮ⢥âáâ¢ã¥â ¯¥à¢®¬ã
|
||||
¯¨ªá¥«î.
|
||||
* ”®à¬ â ¨§®¡à ¦¥¨ï á 4 ¡¨â ¬¨ ¯¨ªá¥«ì: ª ¦¤ë© ¡ ©â ¨§®¡à ¦¥¨ï,
|
||||
§ ¨áª«î票¥¬ ¯®á«¥¤¨å ¡ ©â®¢ áâப (¥á«¨ è¨à¨ ¨§®¡à ¦¥¨ï
|
||||
¥çñâ ), ᮤ¥à¦¨â ¨ä®à¬ æ¨î ® 梥⥠2 ¯¨ªá¥«¥©, áâ àè ï â¥âà ¤
|
||||
ᮮ⢥âáâ¢ã¥â ¯¥à¢®¬ã ¯¨ªá¥«î.
|
||||
* ”®à¬ â ¨§®¡à ¦¥¨ï á 8 ¡¨â ¬¨ ¯¨ªá¥«ì: ª ¦¤ë© ¡ ©â ¨§®¡à ¦¥¨ï
|
||||
à áᬠâਢ ¥âáï ª ª ¨¤¥ªá ¢ ¯ «¨âà¥.
|
||||
* …᫨ ¨§®¡à ¦¥¨¥ ¨á¯®«ì§ã¥â ¥ ¢á¥ 256 梥⮢, ¬¥ìè¥,
|
||||
|
@ -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
|
||||
|
@ -878,6 +878,14 @@ vesa12_putimage:
|
||||
|
||||
add edi,[BytesPerScanLine]
|
||||
add esi,[esp+32]
|
||||
cmp ebp,putimage_get1bpp
|
||||
jz .correct
|
||||
cmp ebp,putimage_get4bpp
|
||||
jnz @f
|
||||
.correct:
|
||||
mov eax,[esp+20]
|
||||
mov byte[eax],80h
|
||||
@@:
|
||||
dec ebx
|
||||
jnz newpi12
|
||||
|
||||
@ -943,6 +951,14 @@ vesa12_putimage:
|
||||
pop edi
|
||||
|
||||
add edi,[BytesPerScanLine]
|
||||
cmp ebp,putimage_get1bpp
|
||||
jz .correct
|
||||
cmp ebp,putimage_get4bpp
|
||||
jnz @f
|
||||
.correct:
|
||||
mov eax,[esp+20]
|
||||
mov byte[eax],80h
|
||||
@@:
|
||||
dec ebx
|
||||
jnz newpi3212
|
||||
|
||||
|
@ -165,7 +165,8 @@ vesa20_putimage:
|
||||
mov [putimg.real_sy], ebx
|
||||
; line increment
|
||||
mov eax, [putimg.image_sx]
|
||||
sub eax, [putimg.real_sx]
|
||||
mov ecx, [putimg.real_sx]
|
||||
sub eax, ecx
|
||||
;; imul eax, [putimg.source_bpp]
|
||||
; lea eax, [eax + eax * 2]
|
||||
call esi
|
||||
@ -178,7 +179,6 @@ vesa20_putimage:
|
||||
mov [putimg.winmap_newline], eax
|
||||
; screen new line increment
|
||||
mov eax, [BytesPerScanLine]
|
||||
mov ecx, [putimg.real_sx]
|
||||
movzx ebx, byte [ScreenBPP]
|
||||
shr ebx, 3
|
||||
imul ecx, ebx
|
||||
@ -234,6 +234,14 @@ align 4
|
||||
add edx, [putimg.screen_newline] ;[BytesPerScanLine]
|
||||
add ebp, [putimg.winmap_newline] ;[Screen_Max_X]
|
||||
; inc ebp
|
||||
cmp [putimg.ebp], putimage_get1bpp
|
||||
jz .correct
|
||||
cmp [putimg.ebp], putimage_get4bpp
|
||||
jnz @f
|
||||
.correct:
|
||||
mov eax, [putimg.edi]
|
||||
mov byte [eax], 80h
|
||||
@@:
|
||||
dec edi
|
||||
jnz .new_line
|
||||
.finish:
|
||||
@ -267,6 +275,14 @@ align 4
|
||||
add edx, [putimg.screen_newline] ;[BytesPerScanLine]
|
||||
add ebp, [putimg.winmap_newline] ;[Screen_Max_X]
|
||||
; inc ebp
|
||||
cmp [putimg.ebp], putimage_get1bpp
|
||||
jz .correct
|
||||
cmp [putimg.ebp], putimage_get4bpp
|
||||
jnz @f
|
||||
.correct:
|
||||
mov eax, [putimg.edi]
|
||||
mov byte [eax], 80h
|
||||
@@:
|
||||
dec edi
|
||||
jnz .new_line
|
||||
.finish:
|
||||
|
Loading…
Reference in New Issue
Block a user