forked from KolibriOS/kolibrios
allocate memory for display_data
git-svn-id: svn://kolibrios.org@840 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0490e63747
commit
3a719cd911
@ -323,17 +323,14 @@ draw_data equ (OS_BASE+0x0338000);
|
||||
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)
|
||||
|
||||
|
||||
new_app_base equ 0;
|
||||
sys_pgmap equ (OS_BASE+0x033F000)
|
||||
|
||||
twdw equ 0x3000 ;(CURRENT_TASK-window_data)
|
||||
|
||||
|
@ -1040,14 +1040,15 @@ proc load_library stdcall, file_name:dword
|
||||
|
||||
@@:
|
||||
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]
|
||||
|
@ -333,8 +333,6 @@ proc init_LFB
|
||||
@@:
|
||||
call init_mtrr
|
||||
|
||||
xchg bx, bx
|
||||
|
||||
mov eax, [LFBAddress]
|
||||
or eax, PG_LARGE+PG_UW
|
||||
mov [sys_pgdir+(LFB_BASE shr 20)], eax
|
||||
|
@ -998,8 +998,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
||||
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]
|
||||
|
@ -191,14 +191,14 @@ app_code_l:
|
||||
dw 0
|
||||
db 0
|
||||
db cpl3
|
||||
dw G32+D32+(new_app_base shr 16)+0xF;
|
||||
dw G32+D32+0xF;
|
||||
|
||||
app_data_l:
|
||||
dw 0xFFFF
|
||||
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 @@ LFBSize rd 1
|
||||
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
|
||||
|
@ -183,7 +183,7 @@ pushad
|
||||
inc edi
|
||||
imul edi, ebx
|
||||
add edi, eax
|
||||
add edi, WinMapAddress
|
||||
add edi, [_display_data]
|
||||
|
||||
.new_y:
|
||||
push ecx ; sx
|
||||
@ -244,7 +244,7 @@ pushad
|
||||
inc eax
|
||||
imul eax, ebx
|
||||
add eax, [esp]
|
||||
add eax, WinMapAddress
|
||||
add eax, [_display_data]
|
||||
mov ebp, eax
|
||||
|
||||
mov edi, [edi+APPDATA.wnd_shape]
|
||||
|
@ -111,8 +111,8 @@ save_draw_mouse:
|
||||
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 @@ __sys_disable_mouse:
|
||||
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
|
||||
|
@ -609,6 +609,10 @@ high_code:
|
||||
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 @@ display_number_force:
|
||||
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 @@ sys_cpuusage:
|
||||
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,9 +3448,13 @@ checkpixel:
|
||||
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]
|
||||
@ -3701,7 +3709,7 @@ calculatebackground: ; background
|
||||
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
|
||||
|
@ -327,7 +327,9 @@ vesa12_drawbackground:
|
||||
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 @@ dbpi24bit12:
|
||||
sub eax,VGABasePtr
|
||||
mov ebx,3
|
||||
div ebx
|
||||
add eax,WinMapAddress
|
||||
add eax, [_display_data]
|
||||
mov ebx,[CURRENT_TASK]
|
||||
cld
|
||||
|
||||
@ -585,7 +587,7 @@ dbpi24bit12:
|
||||
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 @@ vesa12_putimage:
|
||||
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 @@ vesa12_putimage:
|
||||
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]
|
||||
|
||||
|
@ -28,8 +28,6 @@ $Revision$
|
||||
;BytesPerScanLine equ 0xfe08
|
||||
;LFBAddress equ 0xfe80
|
||||
;ScreenBPP equ 0xfbf1
|
||||
;WinMapAddress equ 0x460000
|
||||
|
||||
|
||||
|
||||
;*************************************************
|
||||
@ -200,7 +198,7 @@ vesa20_putimage:
|
||||
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 @@ vesa20_drawbar:
|
||||
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 @@ align 4
|
||||
; 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 @@ align 4
|
||||
; 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 @@ vesa20_drawbackground_tiled:
|
||||
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 @@ dp2:
|
||||
; 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 @@ dp2:
|
||||
; 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 @@ vesa20_drawbackground_stretch:
|
||||
; 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 @@ vesa20_drawbackground_stretch:
|
||||
; 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 @@ sdp3:
|
||||
; 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 @@ sdp3:
|
||||
; 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
|
||||
|
Loading…
Reference in New Issue
Block a user