sysfunction 4: string length tracking

git-svn-id: svn://kolibrios.org@6899 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2017-05-17 08:01:34 +00:00
parent 712eb4cd4b
commit 545bc303eb

View File

@ -35,9 +35,11 @@ dtext:
mov ebp, [_display.width] mov ebp, [_display.width]
xor edi, edi xor edi, edi
jmp @f jmp @f
.ret: .ret:
add esp, 28 add esp, 28
ret ret
.redirect: .redirect:
mov ebp, [edi] mov ebp, [edi]
add edi, 8 add edi, 8
@ -88,12 +90,31 @@ dtext:
and eax, 0xFFFFFF and eax, 0xFFFFFF
.bufferReady: .bufferReady:
mov ebp, eax mov ebp, eax
mov eax, [esp+8]
shr eax, 2
sub eax, [esp+16]
shr eax, 3
xor edx, edx
div dword[esp+4]
mov ecx, [esp]
cmp eax, ecx
jnc @f
mov [esp], eax
@@:
xor edx, edx xor edx, edx
bt ebx, 29 bt ebx, 29
jc @f jc @f
bt ebx, 28 bt ebx, 28
jc .draw866toUni jc .draw866toUni
lea eax, [eax*4+eax]
shr eax, 2
inc eax
mov [esp], ecx
cmp eax, ecx
jnc .draw866
mov [esp], eax
jmp .draw866 jmp .draw866
@@: @@:
bt ebx, 28 bt ebx, 28
jc .drawUTF8 jc .drawUTF8
@ -207,7 +228,8 @@ deltaToScreen = 28
jnz @f jnz @f
pop eax pop eax
ret ret
@@: ; redraw from buffer to screen
@@: ; redraw from buffer to screen
push eax push eax
sub ecx, edi sub ecx, edi
shr ecx, 2 shr ecx, 2
@ -228,6 +250,7 @@ deltaToScreen = 28
xchg esi, edi xchg esi, edi
pop ecx pop ecx
jmp .drawPicture jmp .drawPicture
@@: @@:
pop edi pop edi
mov ecx, [esp] mov ecx, [esp]
@ -317,6 +340,7 @@ drawChar:
jnz .subpixelLeft jnz .subpixelLeft
call antiAliasing call antiAliasing
jmp @f jmp @f
.subpixelLeft: .subpixelLeft:
mov cl, bl mov cl, bl
lea edx, [ecx*8+ecx] lea edx, [ecx*8+ecx]
@ -404,6 +428,7 @@ drawChar:
jnz .subpixelRight jnz .subpixelRight
call antiAliasing call antiAliasing
jmp @f jmp @f
.subpixelRight: .subpixelRight:
mov cl, al mov cl, al
mov edx, ecx mov edx, ecx