134,6 → 134,7 |
public _rd_root |
public _rd_root_end |
|
public _current_task |
public _current_slot |
public _current_thread |
public _k_reenter |
196,7 → 197,12 |
public LFBAddress |
public LFBSize |
|
public _screen_width |
public _screen_height |
|
public _vesa20_drawbar |
|
|
extrn __edata |
|
extrn __os_stack |
294,12 → 300,12 |
align 4 |
init_apm: |
; init selectors |
mov ebx, [BOOT_VAR +0x9040] ; offset of APM entry point |
movzx eax, word [BOOT_VAR+0x9050] ; real-mode segment base address of |
mov ebx, [OS_BASE +0x9040] ; offset of APM entry point |
movzx eax, word [OS_BASE+0x9050] ; real-mode segment base address of |
; protected-mode 32-bit code segment |
movzx ecx, word [BOOT_VAR+0x9052] ; real-mode segment base address of |
movzx ecx, word [OS_BASE+0x9052] ; real-mode segment base address of |
; protected-mode 16-bit code segment |
movzx edx, word [BOOT_VAR+0x9054] ; real-mode segment base address of |
movzx edx, word [OS_BASE+0x9054] ; real-mode segment base address of |
; protected-mode 16-bit data segment |
|
shl eax, 4 |
320,7 → 326,7 |
mov dword[apm_entry], ebx |
mov word [apm_entry + 4], apm_code_32 - _gdts |
|
mov eax, [BOOT_VAR + 0x9044] ; version & flags |
mov eax, [OS_BASE + 0x9044] ; version & flags |
mov [apm_vf], eax |
ret |
|
332,23 → 338,25 |
call init_apm |
|
; SAVE REAL MODE VARIABLES |
mov ax, [BOOT_VAR + 0x9031] |
mov ax, [OS_BASE + 0x9031] |
mov [IDEContrRegsBaseAddr], ax |
|
mov al, [BOOT_VAR+0x901F] ; DMA access |
mov al, [OS_BASE+0x901F] ; DMA access |
mov [allow_dma_access], al |
|
movzx eax, byte [BOOT_VAR+0x9000] ; bpp |
movzx eax, byte [OS_BASE+0x9000] ; bpp |
mov [ScreenBPP], eax |
|
movzx eax,word [BOOT_VAR+0x900A] ; X max |
movzx eax,word [OS_BASE+0x900A] ; X max |
movzx ebx,word [OS_BASE+0x900C] ; Y max |
mov [_screen_width], eax |
mov [_screen_height], ebx |
dec eax |
dec ebx |
mov [Screen_Max_X],eax |
mov [screen_workarea.right],eax |
movzx eax,word [BOOT_VAR+0x900C] ; Y max |
dec eax |
mov [Screen_Max_Y],eax |
mov [screen_workarea.bottom],eax |
mov [Screen_Max_Y],ebx |
mov [screen_workarea.bottom],ebx |
mov [BytesPerScanLine], 640*4 |
cmp [scr_mode], 0x13 ; 320x200 |
je @f |
355,10 → 363,10 |
cmp [scr_mode], 0x12 ; VGA 640x480 |
je @f |
|
movzx eax, word [BOOT_VAR+0x9001] ; for other modes |
movzx eax, word [OS_BASE+0x9001] ; for other modes |
mov [BytesPerScanLine], eax |
@@: |
mov esi, BOOT_VAR+0x9080 |
mov esi, OS_BASE+0x9080 |
movzx ecx, byte [esi-1] |
mov [NumBiosDisks], ecx |
mov edi, BiosDisksData |
366,7 → 374,7 |
|
; GRAPHICS ADDRESSES |
|
mov byte [BOOT_VAR+0x901e],0x0 |
mov byte [OS_BASE+0x901e],0x0 |
|
cmp [scr_mode], 0100000000000000b |
jge setvesa20 |
987,10 → 995,10 |
mov [BTN_COUNT], 0 ; button buffer |
|
push eax |
mov ax,[BOOT_VAR+0x900c] |
mov ax,[OS_BASE+0x900c] |
shr ax,1 |
shl eax,16 |
mov ax,[BOOT_VAR+0x900A] |
mov ax,[OS_BASE+0x900A] |
shr ax,1 |
mov dword [MOUSE_X], eax |
pop eax |
1446,10 → 1454,6 |
ret |
no_set_pci_access: |
|
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
include 'vmodeint.inc' |
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
sys_setup_err: |
mov [esp+36],dword -1 |
ret |
1799,7 → 1803,7 |
jl exit_for_anyone |
cmp ecx,4 |
jg exit_for_anyone |
mov [BOOT_VAR+0x9030],cl |
mov [OS_BASE+0x9030],cl |
|
mov eax,[TASK_COUNT] |
mov [sys_shutdown], eax |
2317,7 → 2321,7 |
jnz nogb1 |
mov eax,[BgrDataWidth] |
shl eax,16 |
mov ax,[BgrDataHeight] |
mov ax, word [BgrDataHeight] |
mov [esp+36],eax |
ret |
|
2630,17 → 2634,16 |
jnz srl1 |
|
mov edx, [TASK_BASE] ; return whole screen draw area for this app |
add edx, draw_data - CURRENT_TASK |
mov [edx + RECT.left], 0 |
mov [edx + RECT.top], 0 |
sub edx, CURRENT_TASK |
mov [edx +draw_data + RECT.left], 0 |
mov [edx +draw_data+ RECT.top], 0 |
mov eax, [Screen_Max_X] |
mov [edx + RECT.right], eax |
mov [edx +draw_data+ RECT.right], eax |
mov eax, [Screen_Max_Y] |
mov [edx + RECT.bottom], eax |
mov [edx +draw_data+ RECT.bottom], eax |
|
mov edi, [TASK_BASE] |
or [edi - twdw + WDATA.fl_wdrawn], 1 ; no new position & buttons from app |
call sys_window_mouse |
ret |
|
srl1: |
2672,7 → 2675,6 |
call [disable_mouse] |
call sys_set_window |
call [disable_mouse] |
call sys_window_mouse |
dec [mouse_pause] |
call [draw_pointer] |
ret |
2910,10 → 2912,6 |
test [edi+WDATA.fl_wdrawn],1 |
jnz newd |
|
mov eax,[timer_ticks] ;[0xfdf0] |
add eax,100 |
mov [new_window_starting],eax |
|
movsx eax,bx |
mov [edi+WDATA.box.width],eax |
movsx eax,cx |
3100,9 → 3098,6 |
xor esi,esi |
call redrawscreen |
|
mov [dont_draw_mouse], 0 ; mouse pointer |
mov [mouse_background], 0 ; no mouse under |
|
call [draw_pointer] |
|
mov [window_move_pr],0 |
3434,7 → 3429,7 |
jz newdw8 |
test al,al |
jz .az |
lea eax,[edi+draw_data-window_data] |
lea eax,[edi+draw_data+(0x100000000-OS_BASE)] |
mov ebx,[dlx] |
cmp ebx,[eax+RECT.left] |
jae @f |
3459,7 → 3454,7 |
.az: |
|
mov eax,edi |
add eax,draw_data-window_data |
add eax, draw_data+(0x100000000-OS_BASE) |
|
mov ebx,[dlx] ; set limits |
mov [eax + RECT.left], ebx |
3470,7 → 3465,7 |
mov ebx,[dlye] |
mov [eax + RECT.bottom], ebx |
|
sub eax,draw_data-window_data |
sub eax,draw_data+(0x100000000-OS_BASE) |
|
cmp dword [esp],1 |
jne nobgrd |
5094,7 → 5089,7 |
align 4 |
system_shutdown: ; shut down the system |
|
cmp byte [BOOT_VAR+0x9030], 1 |
cmp byte [OS_BASE+0x9030], 1 |
jne @F |
ret |
@@: |
5107,10 → 5102,10 |
|
cli |
|
cmp byte [BOOT_VAR+0x9030], 3 |
cmp byte [OS_BASE+0x9030], 3 |
je _sys_reboot |
|
cmp byte [BOOT_VAR+0x9030], 4 |
cmp byte [OS_BASE+0x9030], 4 |
je _sys_restart |
|
cld |
5148,10 → 5143,6 |
call restorefatchain |
|
cld |
mov esi, BOOT_VAR ; restore 0x0 - 0xffff |
mov edi, OS_BASE |
mov ecx,0x10000/4 |
rep movsd |
|
; mov eax, [_copy_pg_balloc] |
mov [_pg_balloc], eax |