/kernel/trunk/gui/font.inc |
---|
36,9 → 36,6 |
mov ebp, [_display.width] |
xor edi, edi |
jmp @f |
.ret: |
add esp, 28 |
ret |
.redirect: |
mov ebp, [edi] |
add edi, 8 |
95,7 → 92,6 |
bt ebx, 28 |
jc .drawUTF8 |
; Stack map: |
; char counter +0 |
fontMultiplier = 4 |
widthX = 8 |
105,7 → 101,7 |
; background +24 |
deltaToScreen = 28 |
; temp buffer height +32 |
; temp buffer pointer +36 |
; temp buffer +36 |
.drawUTF16: |
dec dword [esp] |
131,7 → 127,6 |
add edi, esi |
pop esi |
jmp .drawUTF16 |
.drawUTF8: |
dec dword [esp] |
js .done |
171,7 → 166,6 |
add edi, esi |
pop esi |
jmp .drawUTF8 |
.draw866: |
dec dword [esp] |
js .done |
190,7 → 184,6 |
add edi, esi |
pop esi |
jmp .draw866 |
.done: |
mov ecx, edi |
pop eax eax eax esi edx ebx ebp ebp ebp |
199,7 → 192,7 |
jnz @f |
pop eax |
ret |
@@: ; redraw from buffer to screen |
@@: |
push eax |
sub ecx, edi |
shr ecx, 2 |
231,8 → 224,10 |
add esp, 12 |
call kernel_free |
ret |
.ret: |
add esp, 28 |
ret |
; scaling/smoothing algorithm |
drawChar: |
mov dl, [ebx] |
.raw: |
249,7 → 244,7 |
inc esi |
cmp [fontSmoothing], 0 |
jz .nextPixel |
.checkLeftSubP: ; subpixel smoothing |
.checkLeftSubP: |
bsf eax, edx |
dec eax |
js .checkRightSubP |
298,42 → 293,21 |
call syscall_getpixel |
popa |
@@: |
push ebx edx |
mov ebx, ebp |
xor ecx, ecx |
mov cl, bl |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, al |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov al, dl |
xor ecx, ecx |
mov cl, ah |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, bh |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov ah, dl |
rol eax, 16 |
rol ebx, 16 |
xor ecx, ecx |
mov cl, al |
mov edx, ecx |
shl ecx, 3 |
sub ecx, edx |
mov dl, bl |
add ecx, edx |
shr ecx, 3 |
mov al, cl |
rol eax, 16 |
mov ecx, eax |
mov eax, ebp |
shr al, 1 |
shr cl, 1 |
add al, cl |
shr ah, 2 |
shr ch, 2 |
add ah, ch |
add ah, ch |
add ah, ch |
ror eax, 8 |
ror ecx, 8 |
mov ah, ch |
rol eax, 8 |
mov [edi-4], eax |
pop edx ebx |
.checkRightSubP: |
bsf eax, edx |
inc eax |
379,45 → 353,23 |
call syscall_getpixel |
popa |
@@: |
push ebx edx |
mov ebx, ebp |
xor ecx, ecx |
mov cl, al |
mov edx, ecx |
shl ecx, 3 |
sub ecx, edx |
mov dl, bl |
add ecx, edx |
shr ecx, 3 |
mov ecx, eax |
mov eax, ebp |
shr ah, 2 |
shr ch, 2 |
add ah, ch |
add ah, ch |
add ah, ch |
mov al, cl |
xor ecx, ecx |
mov cl, ah |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, bh |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov ah, dl |
rol ebx, 16 |
rol eax, 16 |
xor ecx, ecx |
mov cl, bl |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, al |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov al, dl |
rol eax, 16 |
ror eax, 8 |
ror ecx, 8 |
shr ah, 1 |
shr ch, 1 |
add ah, ch |
rol eax, 8 |
mov [edi+4], eax |
pop edx ebx |
jmp .nextPixel |
.square: ; scaling |
.square: |
mov eax, esi |
@@: |
mov [edi+eax*4], ebp |
453,7 → 405,6 |
bt [ebx-2], eax |
jc .downRightLow |
jmp .downRightHigh |
@@: |
bt [ebx-1], eax |
jc .checkLeftUp |
486,7 → 437,6 |
inc esi |
mov edi, [esp] |
jmp .checkLeftUp |
.downRightHigh: |
imul ecx, esi |
shl ecx, 2 |
537,7 → 487,6 |
bt [ebx+2], eax |
jc .upRightLow |
jmp .upRightHigh |
@@: |
bt [ebx+1], eax |
jc .checkRight |
566,7 → 515,6 |
jns .drawUpRight |
mov edi, [esp] |
jmp .checkRight |
.upRightHigh: |
imul ecx, esi |
shl ecx, 2 |
615,7 → 563,6 |
bt [ebx-2], eax |
jc .downLeftLow |
jmp .downLeftHigh |
@@: |
bt [ebx-1], eax |
jc .checkRightUp |
645,7 → 592,6 |
inc esi |
mov edi, [esp] |
jmp .checkRightUp |
.downLeftHigh: |
imul ecx, esi |
shl ecx, 2 |
693,7 → 639,6 |
bt [ebx+2], eax |
jc .upLeftLow |
jmp .upLeftHigh |
@@: |
bt [ebx+1], eax |
jc .nextPixel |
718,7 → 663,6 |
dec ecx |
jns .drawUpLeft |
jmp .nextPixel |
.upLeftHigh: |
imul ecx, esi |
shl ecx, 2 |
746,7 → 690,6 |
btr edx, eax |
pop edi |
jmp .raw |
.nextRaw: |
inc ebx |
mov eax, [esp+16+widthX] |