Function 4 - added redirect the output to the user area.

git-svn-id: svn://kolibrios.org@2536 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2012-04-01 22:29:11 +00:00
parent 3a63ebbff2
commit 7d5ed0a7fd
4 changed files with 111 additions and 20 deletions

View File

@ -197,16 +197,21 @@
<EFBFBD> à ¬¥âàë: <EFBFBD> à ¬¥âàë:
* eax = 4 - ­®¬¥à ä㭪樨 * eax = 4 - ­®¬¥à ä㭪樨
* ebx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y] * ebx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
* ecx = 0xX0RRGGBB, 」、・ * ecx = 0xXYRRGGBB, £¤¥
* RR, GG, BB § ¤ îâ 梥â ⥪áâ  * RR, GG, BB § ¤ îâ 梥â ⥪áâ 
* X=ABnn (¡¨âë): * X=ABnn (¡¨âë):
* nn § ¤ ¥â ¨á¯®«ì§ã¥¬ë© èà¨äâ: 0=á¨á⥬­ë© ¬®­®è¨à¨­­ë©, * nn § ¤ ¥â ¨á¯®«ì§ã¥¬ë© èà¨äâ: 0=á¨á⥬­ë© ¬®­®è¨à¨­­ë©,
1=á¨á⥬­ë© èà¨äâ ¯¥à¥¬¥­­®© è¨à¨­ë 1=á¨á⥬­ë© èà¨äâ ¯¥à¥¬¥­­®© è¨à¨­ë
* A=0 - ¢ë¢®¤¨âì esi ᨬ¢®«®¢, A=1 - ¢ë¢®¤¨âì ASCIIZ-áâபã * A=0 - ¢ë¢®¤¨âì esi ᨬ¢®«®¢, A=1 - ¢ë¢®¤¨âì ASCIIZ-áâபã
* B=1 - § ªà è¨¢ âì ä®­ 梥⮬ edi * B=1 - § ªà è¨¢ âì ä®­ 梥⮬ edi
* Y=Cnnn (΅¨βλ):
* C=1 ―¥ΰ¥­ ―ΰ Ά¨βμ ΆλΆ®¤ Ά ®΅« αβμ ―®«μ§®Ά β¥«ο, § ¤ ­® Ά edi
* nnn - ­¥ ¨α―®«μ§γ¥βαο Ά β¥<CEB2>γ饬 Ά¨¤¥, ¤®«¦­® ΅λβμ 0 (zero)
* edx = 㪠§ â¥«ì ­  ­ ç «® áâப¨ * edx = 㪠§ â¥«ì ­  ­ ç «® áâப¨
* esi = ¤«ï A=0 ¤«¨­  áâப¨, ¤®«¦­  ¡ëâì ­¥ ¡®«ìè¥ 255; * esi = ¤«ï A=0 ¤«¨­  áâப¨, ¤®«¦­  ¡ëâì ­¥ ¡®«ìè¥ 255;
¤«ï A=1 ¨£­®à¨àã¥âáï ¤«ï A=1 ¨£­®à¨àã¥âáï
* edi = ζΆ¥β ¤«ο § <C2A7>ΰ α<C2A0>¨ δ®­ , ¥α«¨ B=1
* edi = γ<> § β¥«μ ­  ®΅« αβμ ―®«μ§®Ά β¥«ο, ¥α«¨ C=1
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥: ‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï * äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï: ‡ ¬¥ç ­¨ï:
@ -214,7 +219,12 @@
¢â®à®© - ¨§ char2.mt. ¢â®à®© - ¨§ char2.mt.
* Ž¡  èà¨äâ  ¨¬¥îâ ¢ëá®âã 9 ¯¨ªá¥«¥©, è¨à¨­  ¬®­®è¨à¨­­®£® èà¨äâ  * Ž¡  èà¨äâ  ¨¬¥îâ ¢ëá®âã 9 ¯¨ªá¥«¥©, è¨à¨­  ¬®­®è¨à¨­­®£® èà¨äâ 
à ¢­  6 ¯¨ªá¥«¥©. à ¢­  6 ¯¨ªá¥«¥©.
* C=1, £«γ΅¨­  β®η<C2AE>¨ = 32 ΅¨β , ®΅« αβμ ―®«μ§®Ά β¥«ο Άλ£«ο¤¨β β <CEB2>:
dword Xsize
dword Ysize
®αβ β®<CEB2> ®΅« αβ¨ = Xsize * Y size * 4
* <20>¥«μ§ο ®¤­®Άΰ¥¬¥­­® ¨α―®«μ§®Ά βμ B=1 ¨ C=1, ―®α<C2AE>®«μ<C2AB>γ Ά ®΅®¨ε
α«γη οε ¨α―®«μ§®Ά ­ ΰ¥£¨αβΰ edi ¤«ο ΰ §­λε 楫¥©.
====================================================================== ======================================================================
========================= ”ã­ªæ¨ï 5 - ¯ ã§ . ========================= ========================= ”ã­ªæ¨ï 5 - ¯ ã§ . =========================
====================================================================== ======================================================================

View File

@ -194,16 +194,22 @@ Remarks:
Parameters: Parameters:
* eax = 4 - function number * eax = 4 - function number
* ebx = [coordinate on axis x]*65536 + [coordinate on axis y] * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
* ecx = 0xX0RRGGBB, where * ecx = 0xXYRRGGBB, where
* RR, GG, BB specify text color * RR, GG, BB specify text color
* X=ABnn (bits): * X=ABnn (bits):
* nn specifies the used font: 0=system monospaced, * nn specifies the used font: 0=system monospaced,
1=system font of variable width 1=system font of variable width
* A=0 - output esi characters, A=1 - output ASCIIZ-string * A=0 - output esi characters, A=1 - output ASCIIZ-string
* B=1 - fill background with the color edi * B=1 - fill background with the color edi
* Y = Cnnn
* C=1 redirect the output to the user area, specified in edi
* nnn - not used in the current, must be 0 (zero)
* edx = pointer to the beginning of the string * edx = pointer to the beginning of the string
* esi = for A=0 length of the string, must not exceed 255; * esi = for A=0 length of the string, must not exceed 255;
for A=1 is ignored for A=1 is ignored
* edi = color to fill background, if B=1
* edi = pointer to user area, for redirect, if C=1
Returned value: Returned value:
* function does not return value * function does not return value
Remarks: Remarks:
@ -211,6 +217,12 @@ Remarks:
second - from char2.mt. second - from char2.mt.
* Both fonts have height 9 pixels, width of the monospaced font * Both fonts have height 9 pixels, width of the monospaced font
is equal to 6 pixels. is equal to 6 pixels.
* C=1, pixel depth = 32 bits, user area is as follows:
dword Xsize
dword Ysize
rest of the area = Xsize * Y size * 4
* You can not use B = 1 and C = 1, at the same time. Since in both
cases, the register edi is used for different purposes.
====================================================================== ======================================================================
========================= Function 5 - delay. ======================== ========================= Function 5 - delay. ========================

View File

@ -16,7 +16,7 @@ dtext_asciiz_esi: ; for skins title out
jmp dtext.1 jmp dtext.1
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) dtext:
; ebx x & y ; ebx x & y
; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) ; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
; X = ABnnb: ; X = ABnnb:
@ -24,7 +24,7 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
; A = 0 <=> output esi characters; otherwise output ASCIIZ string ; A = 0 <=> output esi characters; otherwise output ASCIIZ string
; B = 1 <=> fill background with color eax ; B = 1 <=> fill background with color eax
; edx start of text ; edx start of text
; edi 1 force ; edi 1 force or user area for redirect
push eax push eax
xor eax, eax xor eax, eax
;-------------------------------------- ;--------------------------------------
@ -36,14 +36,17 @@ align 4
xchg eax, ebx ; eax=x, ebx=y xchg eax, ebx ; eax=x, ebx=y
cmp esi, 255 cmp esi, 255
jb .loop jb .loop
mov esi, 255 mov esi, 255
;-------------------------------------- ;--------------------------------------
align 4 align 4
.loop: .loop:
test ecx, ecx test ecx, ecx
js .test_asciiz js .test_asciiz
dec esi dec esi
js .end js .end
jmp @f jmp @f
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -53,6 +56,7 @@ align 4
cmp byte [esp+28], 1 cmp byte [esp+28], 1
jne @f jne @f
dec esi dec esi
js .end js .end
;-------------------------------------- ;--------------------------------------
@ -63,6 +67,7 @@ align 4
movzx edx, byte [edx-1] movzx edx, byte [edx-1]
test ecx, 0x10000000 test ecx, 0x10000000
jnz .font2 jnz .font2
mov esi, 9 mov esi, 9
lea ebp, [FONT_I+8*edx+edx] lea ebp, [FONT_I+8*edx+edx]
;-------------------------------------- ;--------------------------------------
@ -75,7 +80,17 @@ align 4
.pixloop1: .pixloop1:
shr dl, 1 shr dl, 1
jz .pixloop1end jz .pixloop1end
jnc .nopix jnc .nopix
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
jmp .pixloop1cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel] ; call [putpixel]
call __sys_putpixel call __sys_putpixel
@ -85,8 +100,19 @@ align 4
.nopix: .nopix:
test ecx, 0x40000000 test ecx, 0x40000000
jz .pixloop1cont jz .pixloop1cont
push ecx push ecx
mov ecx, [esp+4+20h+20h] mov ecx, [esp+4+20h+20h]
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
pop ecx
jmp .pixloop1cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel] ; call [putpixel]
call __sys_putpixel call __sys_putpixel
@ -104,6 +130,7 @@ align 4
inc ebp inc ebp
dec esi dec esi
jnz .symloop1 jnz .symloop1
popad popad
add eax, 6 add eax, 6
jmp .loop jmp .loop
@ -124,6 +151,15 @@ align 4
.pixloop2: .pixloop2:
shr dl, 1 shr dl, 1
jnc .nopix2 jnc .nopix2
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
jmp .pixloop2cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel] ; call [putpixel]
call __sys_putpixel call __sys_putpixel
@ -133,8 +169,19 @@ align 4
.nopix2: .nopix2:
test ecx, 0x40000000 test ecx, 0x40000000
jz .pixloop2cont jz .pixloop2cont
push ecx push ecx
mov ecx, [esp+12+20h+20h] mov ecx, [esp+12+20h+20h]
test ecx, 0x08000000 ; redirect the output to the user area
jz @f
call draw_text_to_user_area
pop ecx
jmp .pixloop2cont
;--------------------------------------
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel] ; call [putpixel]
call __sys_putpixel call __sys_putpixel
@ -145,12 +192,14 @@ align 4
inc eax inc eax
dec esi dec esi
jnz .pixloop2 jnz .pixloop2
pop esi pop esi
sub eax, esi sub eax, esi
inc ebx inc ebx
inc ebp inc ebp
dec dword [esp] dec dword [esp]
jnz .symloop2 jnz .symloop2
pop eax pop eax
add dword [esp+28], esi add dword [esp+28], esi
popad popad
@ -162,3 +211,21 @@ align 4
pop eax pop eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; eax = x coordinate
; ebx = y coordinate
; ecx = ?? RR GG BB
; edi = user area
align 4
draw_text_to_user_area:
pushad
imul ebx, [edi+0]
add eax, ebx
shl eax, 2
add eax, edi
add eax, 8
and ecx, 0xffffff
or ecx, 0xff000000 ; not transparent
mov [eax], ecx ; store pixel
popad
ret
;------------------------------------------------------------------------------

View File

@ -4661,6 +4661,8 @@ syscall_writetext: ; WriteText
pop esi pop esi
add ebx, ebp add ebx, ebp
mov eax, edi mov eax, edi
test ecx, 0x08000000 ; redirect the output to the user area
jnz dtext
xor edi, edi xor edi, edi
jmp dtext jmp dtext