Rev 4287 | Rev 4423 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4287 | Rev 4288 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | format binary as "mnt" |
69 | format binary as "mnt" |
Line 70... | Line 70... | ||
70 | 70 | ||
71 | include 'macros.inc' |
71 | include 'macros.inc' |
Line 72... | Line 72... | ||
72 | include 'struct.inc' |
72 | include 'struct.inc' |
Line 73... | Line 73... | ||
73 | 73 | ||
74 | $Revision: 4287 $ |
74 | $Revision: 4288 $ |
Line 484... | Line 484... | ||
484 | mov [launcher_start], al |
484 | mov [launcher_start], al |
485 | movzx eax, word [BOOT_VARS+BOOT_X_RES]; X max |
485 | movzx eax, word [BOOT_VARS+BOOT_X_RES]; X max |
486 | mov [_display.width], eax |
486 | mov [_display.width], eax |
487 | mov [display_width_standard], eax |
487 | mov [display_width_standard], eax |
488 | dec eax |
488 | dec eax |
489 | mov [Screen_Max_X], eax |
- | |
490 | mov [screen_workarea.right], eax |
489 | mov [screen_workarea.right], eax |
491 | movzx eax, word [BOOT_VARS+BOOT_Y_RES]; Y max |
490 | movzx eax, word [BOOT_VARS+BOOT_Y_RES]; Y max |
492 | mov [_display.height], eax |
491 | mov [_display.height], eax |
493 | mov [display_height_standard], eax |
492 | mov [display_height_standard], eax |
494 | dec eax |
493 | dec eax |
495 | mov [Screen_Max_Y], eax |
- | |
496 | mov [screen_workarea.bottom], eax |
494 | mov [screen_workarea.bottom], eax |
497 | movzx eax, word [BOOT_VARS+BOOT_VESA_MODE] ; screen mode |
495 | movzx eax, word [BOOT_VARS+BOOT_VESA_MODE] ; screen mode |
498 | mov dword [SCR_MODE], eax |
496 | mov dword [SCR_MODE], eax |
499 | ; mov eax, [BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add |
497 | ; mov eax, [BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add |
500 | ; mov [BANK_SWITCH], eax |
498 | ; mov [BANK_SWITCH], eax |
Line 2189... | Line 2187... | ||
2189 | mov eax, [def_cursor] |
2187 | mov eax, [def_cursor] |
2190 | mov [ecx+APPDATA.cursor], eax |
2188 | mov [ecx+APPDATA.cursor], eax |
Line 2191... | Line 2189... | ||
2191 | 2189 | ||
2192 | movzx eax, word [MOUSE_Y] |
2190 | movzx eax, word [MOUSE_Y] |
2193 | movzx ebx, word [MOUSE_X] |
- | |
2194 | ; mov ecx, [Screen_Max_X] |
- | |
2195 | ; inc ecx |
- | |
2196 | ; mul ecx |
2191 | movzx ebx, word [MOUSE_X] |
Line 2197... | Line 2192... | ||
2197 | mov eax, [d_width_calc_area + eax*4] |
2192 | mov eax, [d_width_calc_area + eax*4] |
2198 | 2193 | ||
2199 | add eax, [_WinMapAddress] |
2194 | add eax, [_WinMapAddress] |
Line 2498... | Line 2493... | ||
2498 | ; removed here by |
2493 | ; removed here by |
2499 | ; call mouse_centered |
2494 | ; call mouse_centered |
2500 | ;* mouse centered - start code- Mario79 |
2495 | ;* mouse centered - start code- Mario79 |
2501 | ;mouse_centered: |
2496 | ;mouse_centered: |
2502 | ; push eax |
2497 | ; push eax |
2503 | mov eax, [Screen_Max_X] |
2498 | mov eax, [_display.width] |
2504 | shr eax, 1 |
2499 | shr eax, 1 |
2505 | mov [MOUSE_X], ax |
2500 | mov [MOUSE_X], ax |
2506 | mov eax, [Screen_Max_Y] |
2501 | mov eax, [_display.height] |
2507 | shr eax, 1 |
2502 | shr eax, 1 |
2508 | mov [MOUSE_Y], ax |
2503 | mov [MOUSE_Y], ax |
2509 | call wakeup_osloop |
2504 | call wakeup_osloop |
2510 | ; ret |
2505 | ; ret |
2511 | ;* mouse centered - end code- Mario79 |
2506 | ;* mouse centered - end code- Mario79 |
Line 2543... | Line 2538... | ||
2543 | ret |
2538 | ret |
2544 | .set_pointer_position: |
2539 | .set_pointer_position: |
2545 | ; cmp ecx,4 ; set mouse pointer position |
2540 | ; cmp ecx,4 ; set mouse pointer position |
2546 | dec ecx |
2541 | dec ecx |
2547 | jnz .set_mouse_button |
2542 | jnz .set_mouse_button |
2548 | cmp dx, word[Screen_Max_Y] |
2543 | cmp dx, word[_display.width] |
2549 | ja .end |
2544 | jae .end |
2550 | rol edx, 16 |
2545 | rol edx, 16 |
2551 | cmp dx, word[Screen_Max_X] |
2546 | cmp dx, word[_display.height] |
2552 | ja .end |
2547 | jae .end |
2553 | mov [MOUSE_X], edx |
2548 | mov [MOUSE_X], edx |
2554 | call wakeup_osloop |
2549 | call wakeup_osloop |
2555 | ret |
2550 | ret |
2556 | .set_mouse_button: |
2551 | .set_mouse_button: |
2557 | ; cmp ecx,5 ; set mouse button features |
2552 | ; cmp ecx,5 ; set mouse button features |
Line 2634... | Line 2629... | ||
2634 | pushfd |
2629 | pushfd |
2635 | cli |
2630 | cli |
2636 | mov eax, ecx |
2631 | mov eax, ecx |
2637 | mov ecx, [_display.pitch] |
2632 | mov ecx, [_display.pitch] |
2638 | mov [_display.width], eax |
2633 | mov [_display.width], eax |
2639 | dec eax |
- | |
2640 | mov [_display.height], edx |
2634 | mov [_display.height], edx |
2641 | dec edx |
- | |
2642 | ; eax - new Screen_Max_X |
2635 | ; eax - new Screen_Max_X |
2643 | ; edx - new Screen_Max_Y |
2636 | ; edx - new Screen_Max_Y |
2644 | mov [do_not_touch_winmap], 1 |
2637 | mov [do_not_touch_winmap], 1 |
2645 | call set_screen |
2638 | call set_screen |
2646 | mov [do_not_touch_winmap], 0 |
2639 | mov [do_not_touch_winmap], 0 |
Line 2973... | Line 2966... | ||
2973 | nosb8: |
2966 | nosb8: |
2974 | cmp ebx, 9 |
2967 | cmp ebx, 9 |
2975 | jnz nosb9 |
2968 | jnz nosb9 |
2976 | ; ecx = [left]*65536 + [right] |
2969 | ; ecx = [left]*65536 + [right] |
2977 | ; edx = [top]*65536 + [bottom] |
2970 | ; edx = [top]*65536 + [bottom] |
2978 | mov eax, [Screen_Max_X] |
2971 | mov eax, [_display.width] |
2979 | mov ebx, [Screen_Max_Y] |
2972 | mov ebx, [_display.height] |
2980 | ; check [right] |
2973 | ; check [right] |
2981 | cmp cx, ax |
2974 | cmp cx, ax |
2982 | ja .exit |
2975 | jae .exit |
2983 | ; check [left] |
2976 | ; check [left] |
2984 | ror ecx, 16 |
2977 | ror ecx, 16 |
2985 | cmp cx, ax |
2978 | cmp cx, ax |
2986 | ja .exit |
2979 | jae .exit |
2987 | ; check [bottom] |
2980 | ; check [bottom] |
2988 | cmp dx, bx |
2981 | cmp dx, bx |
2989 | ja .exit |
2982 | jae .exit |
2990 | ; check [top] |
2983 | ; check [top] |
2991 | ror edx, 16 |
2984 | ror edx, 16 |
2992 | cmp dx, bx |
2985 | cmp dx, bx |
2993 | ja .exit |
2986 | jae .exit |
Line 2994... | Line 2987... | ||
2994 | 2987 | ||
2995 | movzx eax, cx ; [left] |
2988 | movzx eax, cx ; [left] |
Line 2996... | Line 2989... | ||
2996 | movzx ebx, dx ; [top] |
2989 | movzx ebx, dx ; [top] |
Line 3026... | Line 3019... | ||
3026 | align 4 |
3019 | align 4 |
3027 | force_redraw_background: |
3020 | force_redraw_background: |
3028 | and [draw_data+32 + RECT.left], 0 |
3021 | and [draw_data+32 + RECT.left], 0 |
3029 | and [draw_data+32 + RECT.top], 0 |
3022 | and [draw_data+32 + RECT.top], 0 |
3030 | push eax ebx |
3023 | push eax ebx |
3031 | mov eax, [Screen_Max_X] |
3024 | mov eax, [_display.width] |
3032 | mov ebx, [Screen_Max_Y] |
3025 | mov ebx, [_display.height] |
3033 | mov [draw_data+32 + RECT.right], eax |
3026 | mov [draw_data+32 + RECT.right], eax |
3034 | mov [draw_data+32 + RECT.bottom], ebx |
3027 | mov [draw_data+32 + RECT.bottom], ebx |
3035 | pop ebx eax |
3028 | pop ebx eax |
3036 | inc byte[REDRAW_BACKGROUND] |
3029 | inc byte[REDRAW_BACKGROUND] |
3037 | call wakeup_osloop |
3030 | call wakeup_osloop |
Line 3383... | Line 3376... | ||
3383 | 3376 | ||
3384 | mov edx, [TASK_BASE] ; return whole screen draw area for this app |
3377 | mov edx, [TASK_BASE] ; return whole screen draw area for this app |
3385 | add edx, draw_data - CURRENT_TASK |
3378 | add edx, draw_data - CURRENT_TASK |
3386 | mov [edx + RECT.left], 0 |
3379 | mov [edx + RECT.left], 0 |
3387 | mov [edx + RECT.top], 0 |
3380 | mov [edx + RECT.top], 0 |
3388 | mov eax, [Screen_Max_X] |
3381 | mov eax, [_display.width] |
3389 | mov [edx + RECT.right], eax |
3382 | mov [edx + RECT.right], eax |
3390 | mov eax, [Screen_Max_Y] |
3383 | mov eax, [_display.height] |
Line 3391... | Line 3384... | ||
3391 | mov [edx + RECT.bottom], eax |
3384 | mov [edx + RECT.bottom], eax |
3392 | 3385 | ||
Line 3516... | Line 3509... | ||
3516 | mov [esp+32], eax |
3509 | mov [esp+32], eax |
3517 | ret |
3510 | ret |
3518 | ;--------------------------------------------------------------------------------------------- |
3511 | ;--------------------------------------------------------------------------------------------- |
Line 3519... | Line -... | ||
3519 | - | ||
3520 | - | ||
3521 | ; check if pixel is allowed to be drawn |
- | |
3522 | - | ||
3523 | ;checkpixel: |
- | |
3524 | ; push eax edx |
- | |
3525 | - | ||
3526 | ;; mov edx, [Screen_Max_X] ; screen x size |
- | |
3527 | ;; inc edx |
- | |
3528 | ;; imul edx, ebx |
- | |
3529 | ; mov edx, [d_width_calc_area + ebx*4] |
- | |
3530 | ; add eax, [_WinMapAddress] |
- | |
3531 | ; mov dl, [eax+edx]; lea eax, [...] |
- | |
3532 | - | ||
3533 | ; xor ecx, ecx |
- | |
3534 | ; mov eax, [CURRENT_TASK] |
- | |
3535 | ; cmp al, dl |
- | |
3536 | ; setne cl |
- | |
3537 | - | ||
3538 | ; pop edx eax |
- | |
3539 | ; ret |
3512 | |
3540 | 3513 | ||
3541 | iglobal |
3514 | iglobal |
Line 3542... | Line 3515... | ||
3542 | cpustring db 'CPU',0 |
3515 | cpustring db 'CPU',0 |
Line 4972... | Line 4945... | ||
4972 | add word [msg_board_pos+2], 6 |
4945 | add word [msg_board_pos+2], 6 |
4973 | cmp bl, 10 |
4946 | cmp bl, 10 |
4974 | jnz @f |
4947 | jnz @f |
4975 | mov word [msg_board_pos+2], (42*6) |
4948 | mov word [msg_board_pos+2], (42*6) |
4976 | add word [msg_board_pos], 10 |
4949 | add word [msg_board_pos], 10 |
4977 | mov ax, word [Screen_Max_Y] |
4950 | mov ax, word [_display.height] |
4978 | cmp word [msg_board_pos], ax |
4951 | cmp word [msg_board_pos], ax |
4979 | jbe @f |
4952 | jb @f |
4980 | mov word [msg_board_pos], 10 |
4953 | mov word [msg_board_pos], 10 |
4981 | @@: |
4954 | @@: |
4982 | ; // end if |
4955 | ; // end if |
Line 4983... | Line 4956... | ||
4983 | 4956 | ||
Line 5191... | Line 5164... | ||
5191 | or [esp+32], dword -1 |
5164 | or [esp+32], dword -1 |
5192 | ret |
5165 | ret |
Line 5193... | Line 5166... | ||
5193 | 5166 | ||
5194 | 5167 | ||
5195 | .1: ; resolution |
5168 | .1: ; resolution |
5196 | mov eax, [Screen_Max_X] |
5169 | mov eax, [_display.width] |
5197 | shl eax, 16 |
5170 | shl eax, 16 |
5198 | mov ax, word [Screen_Max_Y] |
5171 | mov ax, word [_display.height] |
5199 | add eax, 0x00010001 |
5172 | add eax, 0x00010001 |
5200 | mov [esp+32], eax |
5173 | mov [esp+32], eax |
5201 | ret |
5174 | ret |
Line 5279... | Line 5252... | ||
5279 | .drectr: |
5252 | .drectr: |
5280 | ret |
5253 | ret |
Line 5281... | Line 5254... | ||
5281 | 5254 | ||
5282 | align 4 |
5255 | align 4 |
5283 | syscall_getscreensize: ; GetScreenSize |
5256 | syscall_getscreensize: ; GetScreenSize |
5284 | mov ax, word [Screen_Max_X] |
5257 | mov ax, word [_display.width] |
5285 | shl eax, 16 |
5258 | shl eax, 16 |
5286 | mov ax, word [Screen_Max_Y] |
5259 | mov ax, word [_display.height] |
5287 | mov [esp + 32], eax |
5260 | mov [esp + 32], eax |
Line 5288... | Line 5261... | ||
5288 | ret |
5261 | ret |
Line 5347... | Line 5320... | ||
5347 | ; pop eax |
5320 | ; pop eax |
5348 | ret |
5321 | ret |
5349 | ;----------------------------------------------------------------------------- |
5322 | ;----------------------------------------------------------------------------- |
5350 | align 4 |
5323 | align 4 |
5351 | syscall_getpixel_WinMap: ; GetPixel WinMap |
5324 | syscall_getpixel_WinMap: ; GetPixel WinMap |
5352 | cmp ebx, [Screen_Max_X] |
5325 | cmp ebx, [_display.width] |
5353 | jbe @f |
5326 | jb @f |
5354 | cmp ecx, [Screen_Max_Y] |
5327 | cmp ecx, [_display.height] |
5355 | jbe @f |
5328 | jb @f |
5356 | xor eax, eax |
5329 | xor eax, eax |
5357 | jmp .store |
5330 | jmp .store |
5358 | ;-------------------------------------- |
5331 | ;-------------------------------------- |
5359 | align 4 |
5332 | align 4 |
5360 | @@: |
5333 | @@: |
Line 5367... | Line 5340... | ||
5367 | mov [esp + 32], eax |
5340 | mov [esp + 32], eax |
5368 | ret |
5341 | ret |
5369 | ;----------------------------------------------------------------------------- |
5342 | ;----------------------------------------------------------------------------- |
5370 | align 4 |
5343 | align 4 |
5371 | syscall_getpixel: ; GetPixel |
5344 | syscall_getpixel: ; GetPixel |
5372 | mov ecx, [Screen_Max_X] |
5345 | mov ecx, [_display.width] |
5373 | inc ecx |
- | |
5374 | xor edx, edx |
5346 | xor edx, edx |
5375 | mov eax, ebx |
5347 | mov eax, ebx |
5376 | div ecx |
5348 | div ecx |
5377 | mov ebx, edx |
5349 | mov ebx, edx |
5378 | xchg eax, ebx |
5350 | xchg eax, ebx |
Line 5613... | Line 5585... | ||
5613 | ; edx - new Screen_Max_Y |
5585 | ; edx - new Screen_Max_Y |
Line 5614... | Line 5586... | ||
5614 | 5586 | ||
5615 | pushfd |
5587 | pushfd |
Line 5616... | Line -... | ||
5616 | cli |
- | |
5617 | - | ||
5618 | mov [Screen_Max_X], eax |
5588 | cli |
Line 5619... | Line 5589... | ||
5619 | mov [Screen_Max_Y], edx |
5589 | |
5620 | mov [_display.pitch], ecx |
5590 | mov [_display.pitch], ecx |
Line 5656... | Line 5626... | ||
5656 | popad |
5626 | popad |
Line 5657... | Line 5627... | ||
5657 | 5627 | ||
5658 | call repos_windows |
5628 | call repos_windows |
5659 | xor eax, eax |
5629 | xor eax, eax |
5660 | xor ebx, ebx |
5630 | xor ebx, ebx |
5661 | mov ecx, [Screen_Max_X] |
5631 | mov ecx, [_display.width] |
5662 | mov edx, [Screen_Max_Y] |
5632 | mov edx, [_display.height] |
5663 | call calculatescreen |
5633 | call calculatescreen |
5664 | pop edi |
5634 | pop edi |
5665 | pop esi |
5635 | pop esi |