Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 839 → Rev 840

/kernel/branches/kolibri_pe/const.inc
323,18 → 323,15
BgrDrawMode equ (OS_BASE+0x033BFF4)
BgrDataWidth equ (OS_BASE+0x033BFF8)
BgrDataHeight equ (OS_BASE+0x033BFFC)
WinMapAddress equ (OS_BASE+0x033C000)
display_data equ (OS_BASE+0x033C000) ;1024*1280=0x140000
 
virtual at (OS_BASE+0x047CF80)
;display_data equ (OS_BASE+0x033C000) ;1024*1280=0x140000
 
virtual at (OS_BASE+0x033CF80)
tss TSS
end virtual
 
sys_pgmap equ (OS_BASE+0x047F000)
sys_pgmap equ (OS_BASE+0x033F000)
 
 
new_app_base equ 0;
 
twdw equ 0x3000 ;(CURRENT_TASK-window_data)
 
std_application_base_address equ new_app_base
/kernel/branches/kolibri_pe/core/dll.inc
1040,15 → 1040,16
 
@@:
mov edx, [coff]
movzx ebx, [edx+CFH.nSections]
mov edi, new_app_base
lea eax, [edx+20]
@@:
add [eax+CFS.VirtualAddress], edi ;patch user space offset
add eax, COFF_SECTION_SIZE
dec ebx
jnz @B
 
; movzx ebx, [edx+CFH.nSections]
; xor edi, edi
; lea eax, [edx+20]
;@@:
; add [eax+CFS.VirtualAddress], edi ;patch user space offset
; add eax, COFF_SECTION_SIZE
; dec ebx
; jnz @B
 
add edx, 20
stdcall fix_coff_relocs, [coff], edx, [sym]
 
/kernel/branches/kolibri_pe/core/memory.inc
333,8 → 333,6
@@:
call init_mtrr
 
xchg bx, bx
 
mov eax, [LFBAddress]
or eax, PG_LARGE+PG_UW
mov [sys_pgdir+(LFB_BASE shr 20)], eax
/kernel/branches/kolibri_pe/core/taskman.inc
998,8 → 998,7
rep movsd
 
shr ebx,3
mov eax, new_app_base
mov dword [CURRENT_TASK+ebx+0x10],eax
mov dword [CURRENT_TASK+ebx+0x10], 0
 
.add_command_line:
mov edx,[params]
/kernel/branches/kolibri_pe/data32.inc
191,7 → 191,7
dw 0
db 0
db cpl3
dw G32+D32+(new_app_base shr 16)+0xF;
dw G32+D32+0xF;
 
app_data_l:
dw 0xFFFF
198,7 → 198,7
dw 0
db 0
db drw3
dw G32+D32+(new_app_base shr 16)+0xF;
dw G32+D32+0xF;
 
; ------------- PCI BIOS ------------------
 
349,6 → 349,8
stall_mcs rd 1
current_slot rd 1
 
_display_data rd 1
 
; status
hd1_status rd 1 ; 0 - free : other - pid
application_table_status rd 1 ; 0 - free : other - pid
/kernel/branches/kolibri_pe/gui/window.inc
183,7 → 183,7
inc edi
imul edi, ebx
add edi, eax
add edi, WinMapAddress
add edi, [_display_data]
 
.new_y:
push ecx ; sx
244,7 → 244,7
inc eax
imul eax, ebx
add eax, [esp]
add eax, WinMapAddress
add eax, [_display_data]
mov ebp, eax
 
mov edi, [edi+APPDATA.wnd_shape]
/kernel/branches/kolibri_pe/hid/mousedrv.inc
111,8 → 111,8
mov ecx, [Screen_Max_X]
inc ecx
mul ecx
 
movzx edx, byte [display_data+ebx+eax]
add eax, [_display_data]
movzx edx, byte [ebx+eax]
shl edx, 8
mov esi, [edx+SLOT_BASE+APPDATA.cursor]
 
292,7 → 292,7
inc ecx
imul ecx,ebx
add ecx,eax
add ecx, display_data
add ecx, [_display_data]
mov eax, [CURRENT_TASK]
movzx ebx, byte [ecx]
cmp eax,ebx
/kernel/branches/kolibri_pe/kernel.asm
609,6 → 609,10
add eax, ebx
mov [ipc_ptab], eax
 
stdcall alloc_pages, (1280*1024)/4096
add eax, OS_BASE
mov [_display_data], eax
 
stdcall kernel_alloc, (unpack.LZMA_BASE_SIZE+(unpack.LZMA_LIT_SIZE shl \
(unpack.lc+unpack.lp)))*4
 
1315,8 → 1319,8
jne displnl1
mov ebp,ebx
add ebp,4
mov ebp,[ebp+std_application_base_address]
mov ebx,[ebx+std_application_base_address]
mov ebp,[ebp]
mov ebx,[ebx]
displnl1:
sub esp,64
 
2677,7 → 2681,7
cmp ecx, 1 shl 5
je .os_mem
mov edx, [SLOT_BASE+ecx*8+APPDATA.mem_size]
mov eax, std_application_base_address
xor eax, eax
.os_mem:
stosd
lea eax, [edx-1]
3444,10 → 3448,14
push eax edx
 
mov edx,[Screen_Max_X] ; screen x size
mov ecx, [_display_data]
 
inc edx
imul edx, ebx
mov dl, [eax+edx+display_data] ; lea eax, [...]
 
add edx, ecx
mov dl, [eax+edx] ; lea eax, [...]
 
xor ecx, ecx
mov eax, [CURRENT_TASK]
cmp al, dl
3701,7 → 3709,7
cld
rep stosd
 
mov edi,display_data ; set os to use all pixels
mov edi, [_display_data] ; set os to use all pixels
mov eax,0x01010101
mov ecx,1280*1024 / 4
rep stosd
/kernel/branches/kolibri_pe/video/vesa12.inc
327,7 → 327,9
mov eax,[Screen_Max_X]
add eax,1
mul ebx
cmp [eax+esi+WinMapAddress],byte 1
mov ebx, [_display_data]
add ebx, esi
cmp [eax+ebx],byte 1
jnz v12nbgp
mov eax,[BytesPerScanLine]
mov ebx,edi
494,7 → 496,7
sub eax,VGABasePtr
mov ebx,3
div ebx
add eax,WinMapAddress
add eax, [_display_data]
mov ebx,[CURRENT_TASK]
cld
 
585,7 → 587,7
mov eax,edi
sub eax,VGABasePtr
shr eax,2
add eax,WinMapAddress
add eax, [_display_data]
mov ebx,[CURRENT_TASK]
cld
 
830,7 → 832,7
sub edx,VGABasePtr
mov ebx,3
div ebx
add edx,WinMapAddress
add edx,[_display_data]
mov ebx,[CURRENT_TASK]
mov bh,[esp+4*3]
 
899,7 → 901,7
mov edx,edi
sub edx,VGABasePtr
shr edx,2
add edx,WinMapAddress
add edx, [_display_data]
mov ebx,[CURRENT_TASK]
mov bh,[esp+4*3]
 
/kernel/branches/kolibri_pe/video/vesa20.inc
28,10 → 28,8
;BytesPerScanLine equ 0xfe08
;LFBAddress equ 0xfe80
;ScreenBPP equ 0xfbf1
;WinMapAddress equ 0x460000
 
 
 
;*************************************************
; getpixel
;
200,7 → 198,7
imul eax, [Screen_Max_X]
add eax, [putimg.abs_cy]
add eax, [putimg.abs_cx]
add eax, WinMapAddress
add eax, [_display_data]
xchg eax, ebp
; get process number
mov ebx, [CURRENT_TASK]
629,7 → 627,7
imul eax, [Screen_Max_X]
add eax, [drbar.abs_cy]
add eax, [drbar.abs_cx]
add eax, WinMapAddress
add eax, [_display_data]
xchg eax, ebp
; get process number
mov ebx, [CURRENT_TASK]
728,7 → 726,7
; mov eax,ebp
; mov ebx,[Screen_Max_X] ; Screen_X_size
; inc ebx ; +1
; sub eax,WinMapAddress ; -AddrBuffer
; sub eax,display_data ; -AddrBuffer
; div ebx ;
; mov ebx,eax ; ebx:=Y
; mov eax,edx ; eax:=X
754,7 → 752,7
; xor edx,edx
; mov ebx,[Screen_Max_X]
; inc ebx
; sub eax,WinMapAddress
; sub eax,display_data
; div ebx
; mov ebx,eax
; mov eax,edx
778,7 → 776,7
mov ebx, [draw_data+32+RECT.top] ; y start
dp2:
mov ebp, [draw_data+32+RECT.left] ; x start
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; 1) Calculate pointers in display_data (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi]
mov eax, [BytesPerScanLine]
mul ebx
794,7 → 792,10
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
call calculate_edi
xchg edi, ebp
; Now eax=x, ebx=y, edi->output, ebp=offset in WinMapAddress
 
add ebp, [_display_data]
 
; Now eax=x, ebx=y, edi->output, ebp=offset in display_data
; 2) Calculate offset in background memory block
push eax
xor edx, edx
820,9 → 821,9
; ecx = deltax - number of pixels left in current tile block
; edx = 1
; esi -> bgr memory, edi -> output
; ebp = offset in WinMapAddress
; ebp = offset in display_data
dp3:
cmp [ebp+WinMapAddress], dl
cmp [ebp], dl
jnz nbgp
movsb
movsb
885,7 → 886,7
; External loop for all y from start to end
mov ebx, [draw_data+32+RECT.top] ; y start
mov ebp, [draw_data+32+RECT.left] ; x start
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; 1) Calculate pointers in display_data (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi]
mov eax, [BytesPerScanLine]
mul ebx
901,7 → 902,7
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
call calculate_edi
xchg edi, ebp
; Now eax=x, ebx=y, edi->output, ebp=offset in WinMapAddress
; Now eax=x, ebx=y, edi->output, ebp=offset in display_data
push ebx
push eax
; 2) Calculate offset in background memory block
955,7 → 956,7
; 4) Loop through redraw rectangle and copy background data
; Registers meaning:
; esi = offset in current line, edi -> output
; ebp = offset in WinMapAddress
; ebp = offset in display_data
; dword [esp] = offset in bgr data
; qword [esp+4] = x * 2^32 * (BgrDataWidth-1) / (ScreenWidth-1)
; qword [esp+12] = y * 2^32 * (BgrDataHeight-1) / (ScreenHeight-1)
965,7 → 966,8
; qword [esp+28] = 2^32*(BgrDataHeight-1)/(ScreenHeight-1)
; qword [esp+36] = 2^32*(BgrDataWidth-1)/(ScreenWidth-1)
sdp3a:
cmp [ebp+WinMapAddress], byte 1
mov eax, [_display_data]
cmp [ebp+eax], byte 1
jnz snbgp
mov eax, [bgr_cur_line+esi]
test ecx, ecx