*Font functions have been rewritten. Now kernel use bit-compressed fonts.

You must use char.mt and char2.mt from MeOsEmul or MeOsDebug program 
or download them at http://shade.msu.ru/~msu-se/temp/char.7z
*Small fix in memmap.inc for memory manager.

git-svn-id: svn://kolibrios.org@12 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Andrey Halyavin (halyavin) 2005-10-25 11:01:36 +00:00
parent 2a96dafd9f
commit 94f0f6c818
4 changed files with 90 additions and 154 deletions

View File

@ -127,9 +127,9 @@ start_of_code:
mov es,ax mov es,ax
mov ds,ax mov ds,ax
mov ax,0x2000 mov ax,0x3000
mov ss,ax mov ss,ax
mov sp,0xffff mov sp,0xec00
xor ax,ax xor ax,ax
xor bx,bx xor bx,bx
@ -224,9 +224,9 @@ start_of_code:
mov es,ax mov es,ax
mov ds,ax mov ds,ax
mov ax,0x2000 mov ax,0x3000
mov ss,ax mov ss,ax
mov esp,0xffff mov esp,0xec00
xor eax,eax xor eax,eax
xor ebx,ebx xor ebx,ebx

View File

@ -40,59 +40,38 @@ dtext:
align 4 align 4
drawletter: drawletter:
;eax - x
; eax x ;ebx - y
; ebx y ;ecx - color
; ecx color ;edx - ascii code
; edx letter
; esi shl size
; edi force
pushad pushad
call [disable_mouse] call [disable_mouse]
xor eax, eax mov esi,9
xor ebx, ebx ; 0x37000+eax+ebx*8 lea ebp,[0x3F600+8*edx+edx]
inc esi .symloop:
align 4 push esi
chc: mov dl,byte [ebp]
mov esi,8
push eax .pixloop:
push ebx test dl,1
jz .nopix
mov edx,ebx
shl edx,3
add edx,eax
add edx,0x37000+8
mov ecx,[esp+32-12+8]
imul ecx,8*10
add edx,ecx
cmp [edx],byte 'o'
jnz .nopix
mov eax,[esp+4]
mov ebx,[esp+0]
add eax,[esp+32+2*4-4]
add ebx,[esp+32+2*4-16]
mov ecx,[esp+32+2*4-8]
;;;call [disable_mouse]
call [putpixel] call [putpixel]
.nopix: .nopix:
pop ebx shr dl,1
pop eax
inc eax inc eax
cmp eax,5 ; ebp dec esi
jne chc jnz .pixloop
sub eax,8
xor eax, eax
inc ebx inc ebx
cmp ebx,9 ; ebp inc ebp
jne chc pop esi
dec esi
jnz .symloop
popad popad
ret ret
dtext2: dtext2:
; eax x & y ; eax x & y
@ -114,33 +93,17 @@ dtext2:
align 4 align 4
letnew2: letnew2:
push eax
push ecx push ecx
push edx push edx
movzx ebx,ax movzx ebx,ax
shr eax,16 shr eax,16
movzx edx,byte [ecx] movzx edx,byte [ecx]
mov ecx,[esp+3*4+32-16] mov ecx,[esp+2*4+32-16]
call drawletter2 call drawletter2
shl eax,16
add eax,ebx
pop edx pop edx
pop ecx pop ecx
pop eax
push edx
movzx edx,byte [ecx]
imul edx,10*10
add edx,0x30000
cmp [edx+6],byte ' '
jne nocharadd8
add eax,8*65536
jmp charaddok
nocharadd8:
movzx edx,byte [edx+6]
sub edx,47
shl edx,16
add eax,edx
charaddok:
pop edx
inc ecx inc ecx
dec edx dec edx
@ -151,75 +114,47 @@ dtext2:
align 4 align 4
drawletter2: drawletter2:
;eax - x
; eax x ;ebx - y
; ebx y ;ecx - color
; ecx color ;edx - symbol
; edx letter ;edi - force?
; esi shl size ;result - eax=eax+sym_size
; edi force
pushad pushad
call [disable_mouse] call [disable_mouse]
xor eax, eax mov esi,9
xor ebx, ebx ; +eax+ebx*8 lea ebp,[0x3EC00+8*edx+edx]
inc esi push dword -1 ;size
.symloop:
align 4 push esi
chc2: mov dl,byte [ebp]
xor esi,esi
push eax .pixloop:
push ebx test dl,1
jz .nopix
; cmp esi,1 cmp [esp+4],esi
; je noldiv jge .no_inc
; xor edx,edx mov [esp+4],esi
; div esi .no_inc:
; push eax
; xor edx,edx
; mov eax,ebx
; div esi
; mov ebx,eax
; pop eax
; noldiv:
mov edx,ebx
;shl edx,3
imul edx,10
add edx,eax
add edx,0x30000+8+2
mov ecx,[esp+32-12+8]
;shl ecx,6
imul ecx,10*10
add edx,ecx
cmp [edx],byte 'o'
jnz nopix2
mov eax,[esp+4]
mov ebx,[esp+0]
add eax,[esp+32+2*4-4]
add ebx,[esp+32+2*4-16]
mov ecx,[esp+32+2*4-8]
;;;call [disable_mouse]
call [putpixel] call [putpixel]
nopix2: .nopix:
pop ebx shr dl,1
pop eax inc esi
;mov ebp,7
;imul ebp,esi
inc eax inc eax
cmp eax,7 ;ebp cmp esi,8
jnz chc2 jl .pixloop
sub eax,8
xor eax, eax
;mov ebp,9
;imul ebp,esi
inc ebx inc ebx
cmp ebx,9 ; ebp pop esi
jnz chc2 inc ebp
dec esi
jnz .symloop
pop edx
test edx,edx
jge .nospace
mov edx,4
.nospace:
add edx,2
add [esp+32-4],edx
popad popad
ret ret

View File

@ -169,7 +169,7 @@ app_data equ 3+app_data_l-gdts
mov fs,ax mov fs,ax
mov gs,ax mov gs,ax
mov ss,ax mov ss,ax
mov esp,0x30000 ; Set stack mov esp,0x3ec00 ; Set stack
jmp pword os_code:B32 ; jmp to enable 32 bit mode jmp pword os_code:B32 ; jmp to enable 32 bit mode
use32 use32
@ -449,15 +449,15 @@ include 'vmodeld.inc'
mov eax,char mov eax,char
mov esi,12 mov esi,12
xor ebx,ebx xor ebx,ebx
mov ecx,26000 mov ecx,2560;26000
mov edx,0x37000 mov edx,0x3F600;0x37000
call fileread call fileread
mov eax,char2 mov eax,char2
mov esi,12 mov esi,12
xor ebx,ebx xor ebx,ebx
mov ecx,26000 mov ecx,2560;26000
mov edx,0x30000 mov edx,0x3EC00;0x30000
call fileread call fileread
mov esi,boot_fonts mov esi,boot_fonts

View File

@ -127,9 +127,9 @@
; FFFF byte do not change task for 1/100 sec. ; FFFF byte do not change task for 1/100 sec.
; ;
; 10000 -> 1FFFF 32 bit os ; 10000 -> 1FFFF 32 bit os
; 20000 -> 2FFFF 32 bit stack ; 20000 -> 3EBFF 32 bit stack
; 30000 -> 36FFF basic text font II ; 3EC00 -> 3F5FF basic text font II
; 37000 -> 3BFFF basic text font I ; 3F600 -> 3FFFF basic text font I
; 40000 -> 4FFFF data of retrieved disks and partitions (Mario79) ; 40000 -> 4FFFF data of retrieved disks and partitions (Mario79)
; 50000 -> 5FFFF free ; 50000 -> 5FFFF free
; 60000 -> 7FFFF paging tables ; 60000 -> 7FFFF paging tables
@ -152,6 +152,7 @@
; ;
; B0 dword int40 handler in use ; 0 if not in use ; B0 dword int40 handler in use ; 0 if not in use
; B4 byte keyboard mode: 0 = keymap, 1 = scancodes ; B4 byte keyboard mode: 0 = keymap, 1 = scancodes
; B8 dword physical address of directory table
; ;
; 90000 -> 9FFFF tmp ; 90000 -> 9FFFF tmp
; A0000 -> AFFFF screen access area ; A0000 -> AFFFF screen access area