Rev 757 | Rev 760 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 757 | Rev 759 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | ;; |
53 | ;; |
54 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
54 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 55... | Line 55... | ||
55 | 55 | ||
Line 56... | Line 56... | ||
56 | include 'macros.inc' |
56 | include 'macros.inc' |
Line 57... | Line 57... | ||
57 | 57 | ||
Line 58... | Line 58... | ||
58 | $Revision: 757 $ |
58 | $Revision: 759 $ |
Line 343... | Line 343... | ||
343 | mov al, [BOOT_VAR+0x901F] ; DMA access |
343 | mov al, [BOOT_VAR+0x901F] ; DMA access |
344 | mov [allow_dma_access], al |
344 | mov [allow_dma_access], al |
345 | mov al,[BOOT_VAR+0x9000] ; bpp |
345 | mov al,[BOOT_VAR+0x9000] ; bpp |
346 | mov [ScreenBPP],al |
346 | mov [ScreenBPP],al |
Line 347... | Line 347... | ||
347 | 347 | ||
Line 348... | Line 348... | ||
348 | xchg bx, bx |
348 | xchg bx, bx |
349 | 349 | ||
350 | movzx eax,word [BOOT_VAR+0x900A] ; X max |
350 | movzx eax,word [BOOT_VAR+0x900A] ; X max |
351 | dec eax |
351 | dec eax |
352 | mov [Screen_Max_X],eax |
352 | mov [Screen_Max_X],eax |
353 | mov [screen_workarea.right],eax |
353 | mov [screen_workarea.right],eax |
354 | movzx eax,word [BOOT_VAR+0x900C] ; Y max |
354 | movzx eax,word [BOOT_VAR+0x900C] ; Y max |
355 | dec eax |
355 | dec eax |
356 | mov [Screen_Max_Y],eax |
356 | mov [Screen_Max_Y],eax |
357 | mov [screen_workarea.bottom],eax |
357 | mov [screen_workarea.bottom],eax |
358 | movzx eax,word [BOOT_VAR+0x9008] ; screen mode |
358 | movzx eax,word [BOOT_VAR+0x9008] ; screen mode |
359 | mov [SCR_MODE],eax |
359 | mov [SCR_MODE],eax |
Line 1127... | Line 1127... | ||
1127 | ret |
1127 | ret |
Line 1128... | Line 1128... | ||
1128 | 1128 | ||
1129 | ;* mouse centered - start code- Mario79 |
1129 | ;* mouse centered - start code- Mario79 |
1130 | mouse_centered: |
1130 | mouse_centered: |
1131 | push eax |
1131 | push eax |
1132 | mov eax,[Screen_Max_X] |
1132 | mov eax,[Screen_Max_X] |
1133 | shr eax,1 |
1133 | shr eax,1 |
1134 | mov [MOUSE_X],ax |
1134 | mov [MOUSE_X],ax |
1135 | mov eax,[Screen_Max_Y] |
1135 | mov eax,[Screen_Max_Y] |
1136 | shr eax,1 |
1136 | shr eax,1 |
1137 | mov [MOUSE_Y],ax |
1137 | mov [MOUSE_Y],ax |
1138 | pop eax |
1138 | pop eax |
1139 | ret |
1139 | ret |
Line 2027... | Line 2027... | ||
2027 | jmp waitterm |
2027 | jmp waitterm |
Line 2028... | Line 2028... | ||
2028 | 2028 | ||
2029 | iglobal |
2029 | iglobal |
2030 | align 4 |
2030 | align 4 |
2031 | sys_system_table: |
2031 | sys_system_table: |
2032 | dd exit_for_anyone ; 1 = obsolete |
2032 | dd exit_for_anyone ; 1 = obsolete |
2033 | dd sysfn_terminate ; 2 = terminate thread |
2033 | dd sysfn_terminate ; 2 = terminate thread |
2034 | dd sysfn_activate ; 3 = activate window |
2034 | dd sysfn_activate ; 3 = activate window |
2035 | dd sysfn_getidletime ; 4 = get idle time |
2035 | dd sysfn_getidletime ; 4 = get idle time |
2036 | dd sysfn_getcpuclock ; 5 = get cpu clock |
2036 | dd sysfn_getcpuclock ; 5 = get cpu clock |
Line 2062... | Line 2062... | ||
2062 | jmp dword [sys_system_table + ebx*4] |
2062 | jmp dword [sys_system_table + ebx*4] |
2063 | @@: |
2063 | @@: |
2064 | ret |
2064 | ret |
Line 2065... | Line 2065... | ||
2065 | 2065 | ||
2066 | 2066 | ||
2067 | sysfn_shutdown: ; 18.9 = system shutdown |
2067 | sysfn_shutdown: ; 18.9 = system shutdown |
2068 | cmp ecx,1 |
2068 | cmp ecx,1 |
2069 | jl exit_for_anyone |
2069 | jl exit_for_anyone |
2070 | cmp ecx,4 |
2070 | cmp ecx,4 |
Line 2881... | Line 2881... | ||
2881 | 2881 | ||
2882 | mov edx, [TASK_BASE] ; return whole screen draw area for this app |
2882 | mov edx, [TASK_BASE] ; return whole screen draw area for this app |
2883 | add edx, draw_data - CURRENT_TASK |
2883 | add edx, draw_data - CURRENT_TASK |
2884 | mov [edx + RECT.left], 0 |
2884 | mov [edx + RECT.left], 0 |
2885 | mov [edx + RECT.top], 0 |
2885 | mov [edx + RECT.top], 0 |
2886 | mov eax, [Screen_Max_X] |
2886 | mov eax, [Screen_Max_X] |
2887 | mov [edx + RECT.right], eax |
2887 | mov [edx + RECT.right], eax |
2888 | mov eax, [Screen_Max_Y] |
2888 | mov eax, [Screen_Max_Y] |
Line 2889... | Line 2889... | ||
2889 | mov [edx + RECT.bottom], eax |
2889 | mov [edx + RECT.bottom], eax |
2890 | 2890 | ||
2891 | mov edi, [TASK_BASE] |
2891 | mov edi, [TASK_BASE] |
Line 3484... | Line 3484... | ||
3484 | ; check if pixel is allowed to be drawn |
3484 | ; check if pixel is allowed to be drawn |
Line 3485... | Line 3485... | ||
3485 | 3485 | ||
3486 | checkpixel: |
3486 | checkpixel: |
Line 3487... | Line 3487... | ||
3487 | push eax edx |
3487 | push eax edx |
3488 | 3488 | ||
3489 | mov edx,[Screen_Max_X] ; screen x size |
3489 | mov edx,[Screen_Max_X] ; screen x size |
3490 | inc edx |
3490 | inc edx |
Line 3491... | Line 3491... | ||
3491 | imul edx, ebx |
3491 | imul edx, ebx |
Line 3946... | Line 3946... | ||
3946 | ret |
3946 | ret |
Line 3947... | Line 3947... | ||
3947 | 3947 | ||
Line 3948... | Line 3948... | ||
3948 | gidril1: |
3948 | gidril1: |
- | 3949 | ||
3949 | 3950 | shl ebx,12 |
|
3950 | shl ebx,12 |
3951 | xor ecx, ecx |
3951 | mov ecx,1 |
3952 | inc ecx |
3952 | lea eax,[ebx + IRQ_SAVE + 0x10] |
3953 | lea eax,[ebx + IRQ_SAVE] |
3953 | mov edx,[eax - 0x10] |
3954 | mov edx,[eax] |
Line -... | Line 3955... | ||
- | 3955 | test edx,edx |
|
3954 | test edx,edx |
3956 | jz gid1 |
Line 3955... | Line 3957... | ||
3955 | jz gid1 |
3957 | |
Line 3956... | Line 3958... | ||
3956 | 3958 | dec edx |
|
- | 3959 | mov [eax], edx |
|
- | 3960 | ||
3957 | dec dword [eax - 0x10] |
3961 | mov ecx, [eax + 0x4] |
- | 3962 | ||
- | 3963 | cmp ecx, 4000 |
|
3958 | 3964 | jb @f |
|
- | 3965 | ||
- | 3966 | xor ecx, ecx |
|
- | 3967 | ||
- | 3968 | @@: |
|
- | 3969 | inc ecx |
|
- | 3970 | mov [eax + 0x4], ecx |
|
- | 3971 | dec ecx |
|
Line 3959... | Line -... | ||
3959 | movzx ebx,byte [eax] |
- | |
3960 | - | ||
3961 | mov edi, eax |
- | |
3962 | xchg esi, eax |
- | |
3963 | inc esi |
- | |
3964 | 3972 | add eax, ecx |
|
3965 | mov ecx,4000 / 4 |
3973 | |
3966 | cld |
3974 | movzx ebx,byte [eax + 0x10] |
3967 | rep movsd |
3975 | |
3968 | ; xor ecx,ecx ; as result of 'rep' ecx=0 |
3976 | xor ecx, ecx |
Line 4971... | Line 4979... | ||
4971 | .drectr: |
4979 | .drectr: |
4972 | ret |
4980 | ret |
Line 4973... | Line 4981... | ||
4973 | 4981 | ||
4974 | align 4 |
4982 | align 4 |
4975 | syscall_getscreensize: ; GetScreenSize |
4983 | syscall_getscreensize: ; GetScreenSize |
4976 | mov ax, [Screen_Max_X] |
4984 | mov ax, [Screen_Max_X] |
4977 | shl eax, 16 |
4985 | shl eax, 16 |
4978 | mov ax, [Screen_Max_Y] |
4986 | mov ax, [Screen_Max_Y] |
4979 | mov [esp + 32], eax |
4987 | mov [esp + 32], eax |
Line 4980... | Line 4988... | ||
4980 | ret |
4988 | ret |
Line 5090... | Line 5098... | ||
5090 | movzx ebx, word[edi-twdw+WDATA.box.top] |
5098 | movzx ebx, word[edi-twdw+WDATA.box.top] |
5091 | add eax, ebp |
5099 | add eax, ebp |
5092 | mov ebp, ebx |
5100 | mov ebp, ebx |
5093 | add ebp, [esi+APPDATA.wnd_clientbox.top] |
5101 | add ebp, [esi+APPDATA.wnd_clientbox.top] |
5094 | add bx, word[esi+APPDATA.wnd_clientbox.top] |
5102 | add bx, word[esi+APPDATA.wnd_clientbox.top] |
5095 | add ebp, ecx |
5103 | add ebp, ecx |
5096 | shl ebx, 16 |
5104 | shl ebx, 16 |
5097 | xor edi, edi |
5105 | xor edi, edi |
5098 | add ebx, ebp |
5106 | add ebx, ebp |
5099 | mov ecx, edx |
5107 | mov ecx, edx |
5100 | jmp [draw_line] |
5108 | jmp [draw_line] |
Line 5173... | Line 5181... | ||
5173 | paleholder: |
5181 | paleholder: |
5174 | ret |
5182 | ret |
Line 5175... | Line 5183... | ||
5175 | 5183 | ||
5176 | align 4 |
5184 | align 4 |
5177 | set_screen: |
5185 | set_screen: |
5178 | cmp eax, [Screen_Max_X] |
5186 | cmp eax, [Screen_Max_X] |
Line 5179... | Line 5187... | ||
5179 | jne .set |
5187 | jne .set |
5180 | 5188 | ||
5181 | cmp edx, [Screen_Max_Y] |
5189 | cmp edx, [Screen_Max_Y] |
5182 | jne .set |
5190 | jne .set |
5183 | ret |
5191 | ret |
5184 | .set: |
5192 | .set: |
Line 5185... | Line 5193... | ||
5185 | pushfd |
5193 | pushfd |
5186 | cli |
5194 | cli |
Line 5187... | Line 5195... | ||
5187 | 5195 | ||
5188 | mov [Screen_Max_X], eax |
5196 | mov [Screen_Max_X], eax |
5189 | mov [Screen_Max_Y], edx |
5197 | mov [Screen_Max_Y], edx |
5190 | 5198 | ||
5191 | mov [screen_workarea.right],eax |
5199 | mov [screen_workarea.right],eax |
5192 | mov [screen_workarea.bottom], edx |
5200 | mov [screen_workarea.bottom], edx |
5193 | inc eax |
5201 | inc eax |
5194 | shl eax, 2 ;32 bpp |
5202 | shl eax, 2 ;32 bpp |
5195 | mov [BytesPerScanLine], eax |
5203 | mov [BytesPerScanLine], eax |
5196 | push ebx |
5204 | push ebx |
5197 | push esi |
5205 | push esi |
5198 | push edi |
5206 | push edi |
5199 | call repos_windows |
5207 | call repos_windows |
5200 | mov eax, 0 |
5208 | mov eax, 0 |
5201 | mov ebx, 0 |
5209 | mov ebx, 0 |
5202 | mov ecx, [Screen_Max_X] |
5210 | mov ecx, [Screen_Max_X] |
5203 | mov edx, [Screen_Max_Y] |
5211 | mov edx, [Screen_Max_Y] |
Line 5204... | Line 5212... | ||
5204 | call calculatescreen |
5212 | call calculatescreen |
5205 | pop edi |
5213 | pop edi |
Line 5206... | Line 5214... | ||
5206 | pop esi |
5214 | pop esi |
5207 | pop ebx |
5215 | pop ebx |
5208 | 5216 | ||
5209 | popfd |
5217 | popfd |