2010-10-01 11:21:55 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2015-06-01 21:18:07 +02:00
|
|
|
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
|
2010-10-01 11:21:55 +02:00
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
2012-03-09 09:20:02 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2010-10-01 11:21:55 +02:00
|
|
|
align 4
|
|
|
|
dtext_asciiz_esi: ; for skins title out
|
2012-03-08 09:33:38 +01:00
|
|
|
push eax
|
|
|
|
xor eax, eax
|
|
|
|
inc eax
|
|
|
|
jmp dtext.1
|
2012-03-09 09:20:02 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2010-10-01 11:21:55 +02:00
|
|
|
align 4
|
2012-10-12 20:24:48 +02:00
|
|
|
dtext:
|
|
|
|
; ebx x & y
|
|
|
|
; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
|
|
|
|
; X = ABnnb:
|
|
|
|
; nn = font
|
|
|
|
; A = 0 <=> output esi characters; otherwise output ASCIIZ string
|
|
|
|
; B = 1 <=> fill background with color eax
|
|
|
|
; edx start of text
|
|
|
|
; edi 1 force or user area for redirect
|
2012-03-08 09:33:38 +01:00
|
|
|
push eax
|
2010-10-01 11:21:55 +02:00
|
|
|
xor eax, eax
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.1:
|
|
|
|
pushad
|
|
|
|
movsx eax, bx ; eax=y
|
|
|
|
sar ebx, 16 ; ebx=x
|
|
|
|
xchg eax, ebx ; eax=x, ebx=y
|
|
|
|
cmp esi, 255
|
|
|
|
jb .loop
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
mov esi, 255
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.loop:
|
|
|
|
test ecx, ecx
|
|
|
|
js .test_asciiz
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
dec esi
|
|
|
|
js .end
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
jmp @f
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.test_asciiz:
|
|
|
|
cmp byte [edx], 0
|
|
|
|
jz .end
|
2012-03-09 09:20:02 +01:00
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
cmp byte [esp+28], 1
|
|
|
|
jne @f
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
dec esi
|
2012-03-08 09:33:38 +01:00
|
|
|
js .end
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
@@:
|
|
|
|
inc edx
|
|
|
|
pushad
|
|
|
|
movzx edx, byte [edx-1]
|
|
|
|
test ecx, 0x10000000
|
|
|
|
jnz .font2
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
mov esi, 9
|
|
|
|
lea ebp, [FONT_I+8*edx+edx]
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.symloop1:
|
|
|
|
mov dl, byte [ebp]
|
|
|
|
or dl, 1 shl 6
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.pixloop1:
|
|
|
|
shr dl, 1
|
|
|
|
jz .pixloop1end
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
jnc .nopix
|
2012-10-12 20:24:48 +02:00
|
|
|
|
|
|
|
test ecx, 0x08000000 ; redirect the output to the user area
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
call draw_text_to_user_area
|
|
|
|
jmp .pixloop1cont
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-03-08 09:33:38 +01:00
|
|
|
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
2012-03-15 13:41:29 +01:00
|
|
|
; call [putpixel]
|
|
|
|
call __sys_putpixel
|
2010-10-01 11:21:55 +02:00
|
|
|
jmp .pixloop1cont
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.nopix:
|
|
|
|
test ecx, 0x40000000
|
|
|
|
jz .pixloop1cont
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
push ecx
|
|
|
|
mov ecx, [esp+4+20h+20h]
|
2012-10-12 20:24:48 +02:00
|
|
|
|
|
|
|
test ecx, 0x08000000 ; redirect the output to the user area
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
call draw_text_to_user_area
|
|
|
|
pop ecx
|
|
|
|
jmp .pixloop1cont
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-03-08 09:33:38 +01:00
|
|
|
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
2012-03-15 13:41:29 +01:00
|
|
|
; call [putpixel]
|
|
|
|
call __sys_putpixel
|
2010-10-01 11:21:55 +02:00
|
|
|
pop ecx
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.pixloop1cont:
|
|
|
|
inc eax
|
|
|
|
jmp .pixloop1
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.pixloop1end:
|
|
|
|
sub eax, 6
|
|
|
|
inc ebx
|
|
|
|
inc ebp
|
|
|
|
dec esi
|
|
|
|
jnz .symloop1
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
popad
|
|
|
|
add eax, 6
|
|
|
|
jmp .loop
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.font2:
|
|
|
|
add edx, edx
|
|
|
|
lea ebp, [FONT_II+4*edx+edx+1]
|
|
|
|
push 9
|
|
|
|
movzx esi, byte [ebp-1]
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.symloop2:
|
|
|
|
mov dl, byte [ebp]
|
|
|
|
push esi
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.pixloop2:
|
|
|
|
shr dl, 1
|
|
|
|
jnc .nopix2
|
2012-10-12 20:24:48 +02:00
|
|
|
|
|
|
|
test ecx, 0x08000000 ; redirect the output to the user area
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
call draw_text_to_user_area
|
|
|
|
jmp .pixloop2cont
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-03-08 09:33:38 +01:00
|
|
|
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
2012-03-15 13:41:29 +01:00
|
|
|
; call [putpixel]
|
|
|
|
call __sys_putpixel
|
2010-10-01 11:21:55 +02:00
|
|
|
jmp .pixloop2cont
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.nopix2:
|
|
|
|
test ecx, 0x40000000
|
|
|
|
jz .pixloop2cont
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
push ecx
|
|
|
|
mov ecx, [esp+12+20h+20h]
|
2012-10-12 20:24:48 +02:00
|
|
|
|
|
|
|
test ecx, 0x08000000 ; redirect the output to the user area
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
call draw_text_to_user_area
|
|
|
|
pop ecx
|
|
|
|
jmp .pixloop2cont
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-03-08 09:33:38 +01:00
|
|
|
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
|
2012-03-15 13:41:29 +01:00
|
|
|
; call [putpixel]
|
|
|
|
call __sys_putpixel
|
2010-10-01 11:21:55 +02:00
|
|
|
pop ecx
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.pixloop2cont:
|
|
|
|
inc eax
|
|
|
|
dec esi
|
|
|
|
jnz .pixloop2
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
pop esi
|
|
|
|
sub eax, esi
|
|
|
|
inc ebx
|
|
|
|
inc ebp
|
|
|
|
dec dword [esp]
|
|
|
|
jnz .symloop2
|
2012-10-12 20:24:48 +02:00
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
pop eax
|
|
|
|
add dword [esp+28], esi
|
|
|
|
popad
|
|
|
|
jmp .loop
|
2012-03-09 09:20:02 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2010-10-01 11:21:55 +02:00
|
|
|
.end:
|
|
|
|
popad
|
2012-03-09 09:20:02 +01:00
|
|
|
pop eax
|
2010-10-01 11:21:55 +02:00
|
|
|
ret
|
2012-03-09 09:20:02 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2012-10-12 20:24:48 +02:00
|
|
|
; 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
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
FONT_I:
|
2013-05-11 14:38:27 +02:00
|
|
|
if lang eq sp
|
|
|
|
file 'char_sp.mt'
|
2013-11-21 03:42:12 +01:00
|
|
|
else if lang eq et
|
|
|
|
file 'char_et.mt'
|
2013-05-11 14:38:27 +02:00
|
|
|
else
|
2012-10-12 20:24:48 +02:00
|
|
|
file 'char.mt'
|
2013-05-11 14:38:27 +02:00
|
|
|
end if
|
2012-10-12 20:24:48 +02:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
FONT_II:
|
2013-05-11 14:38:27 +02:00
|
|
|
if lang eq sp
|
|
|
|
file 'char2_sp.mt'
|
2013-11-21 03:42:12 +01:00
|
|
|
else if lang eq et
|
|
|
|
file 'char2_et.mt'
|
2013-05-11 14:38:27 +02:00
|
|
|
else
|
2012-10-12 20:24:48 +02:00
|
|
|
file 'char2.mt'
|
2013-05-11 14:38:27 +02:00
|
|
|
end if
|
|
|
|
;------------------------------------------------------------------------------
|