Rev 1300 | Rev 1326 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1300 | Rev 1324 | ||
---|---|---|---|
Line 4... | Line 4... | ||
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;; ;; |
6 | ;; ;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 8... | Line 8... | ||
8 | 8 | ||
Line 9... | Line 9... | ||
9 | $Revision: 1300 $ |
9 | $Revision: 1324 $ |
10 | 10 | ||
11 | 11 | ||
Line 312... | Line 312... | ||
312 | add esp, 24 |
312 | add esp, 24 |
313 | popad |
313 | popad |
314 | ret |
314 | ret |
Line -... | Line 315... | ||
- | 315 | ||
- | 316 | ||
- | 317 | iglobal |
|
- | 318 | align 4 |
|
- | 319 | f48call: |
|
- | 320 | dd display_settings.00 |
|
- | 321 | dd display_settings.01 |
|
- | 322 | dd display_settings.02 |
|
- | 323 | dd display_settings.03 |
|
- | 324 | dd display_settings.04 |
|
- | 325 | dd display_settings.05 |
|
- | 326 | dd display_settings.06 |
|
- | 327 | dd display_settings.07 |
|
- | 328 | dd display_settings.08 |
|
315 | 329 | endg |
|
Line 316... | Line 330... | ||
316 | 330 | ||
317 | display_settings: |
331 | display_settings: |
318 | 332 | ||
319 | ; eax = 0 ; DISPLAY redraw |
333 | ; ebx = 0 ; DISPLAY redraw |
320 | ; ebx = 0 ; all |
334 | ; ebx = 0 ; all |
321 | ; |
335 | ; |
322 | ; eax = 1 ; BUTTON type |
336 | ; ebx = 1 ; BUTTON type |
323 | ; ebx = 0 ; flat |
337 | ; ebx = 0 ; flat |
324 | ; ebx = 1 ; 3D |
338 | ; ebx = 1 ; 3D |
325 | ; eax = 2 ; set WINDOW colours |
339 | ; ebx = 2 ; set WINDOW colours |
326 | ; ebx = pointer to table |
340 | ; ebx = pointer to table |
327 | ; ecx = number of bytes define |
341 | ; ecx = number of bytes define |
328 | ; eax = 3 ; get WINDOW colours |
342 | ; ebx = 3 ; get WINDOW colours |
329 | ; ebx = pointer to table |
343 | ; ebx = pointer to table |
330 | ; ecx = number of bytes wanted |
344 | ; ecx = number of bytes wanted |
331 | ; eax = 4 ; get skin height |
345 | ; ebx = 4 ; get skin height |
332 | ; input : nothing |
346 | ; input : nothing |
333 | ; output : eax = skin height in pixel |
347 | ; output : eax = skin height in pixel |
334 | ; eax = 5 ; get screen workarea |
348 | ; ebx = 5 ; get screen workarea |
335 | ; input : nothing |
349 | ; input : nothing |
336 | ; output : eax = [left]*65536+[right] |
350 | ; output : eax = [left]*65536+[right] |
337 | ; ebx = [top]*65536+[bottom] |
351 | ; ebx = [top]*65536+[bottom] |
338 | ; eax = 6 ; set screen workarea |
352 | ; ebx = 6 ; set screen workarea |
339 | ; input : ecx = [left]*65536+[right] |
353 | ; input : ecx = [left]*65536+[right] |
340 | ; edx = [top]*65536+[bottom] |
354 | ; edx = [top]*65536+[bottom] |
341 | ; output : nothing |
355 | ; output : nothing |
342 | ; eax = 7 ; get skin margins |
356 | ; ebx = 7 ; get skin margins |
343 | ; input : nothing |
357 | ; input : nothing |
344 | ; output : eax = [left]*65536+[right] |
358 | ; output : eax = [left]*65536+[right] |
345 | ; ebx = [top]*65536+[bottom] |
359 | ; ebx = [top]*65536+[bottom] |
346 | ; eax = 8 ; set window skin |
- | |
347 | ; input : ecx = pointer to file info block |
360 | ; ebx = 8 ; set window skin |
348 | ; output : eax = FS error code |
361 | ; input : ecx = pointer to file info block |
- | 362 | ; output : eax = FS error code |
|
- | 363 | cmp ebx,8 |
|
349 | 364 | ja .fail |
|
350 | 365 | jmp dword [f48call+ebx*4] |
|
351 | pushad |
366 | .00: |
352 | 367 | ||
353 | test eax, eax ; redraw display |
368 | ; redraw display |
354 | jnz dspl0 |
369 | test ecx, ecx |
355 | test ebx, ebx |
370 | jnz .01 |
356 | jnz dspl0 |
371 | inc ecx |
357 | cmp [windowtypechanged],dword 1 |
372 | cmp [windowtypechanged],dword ecx ;ebx=1 |
- | 373 | jne .fail |
|
358 | jne dspl00 |
374 | mov [windowtypechanged],dword ebx ;eax=0 |
359 | mov [windowtypechanged],dword 0 |
375 | .redraw_screen_direct: |
360 | redraw_screen_direct: |
376 | xor eax,eax |
361 | mov [dlx],dword 0 |
377 | mov [dlx],dword eax |
362 | mov [dly],dword 0 |
378 | mov [dly],dword eax |
363 | mov eax,[Screen_Max_X] |
379 | mov eax,[Screen_Max_X] |
364 | mov [dlxe],eax |
380 | mov [dlxe],eax |
- | 381 | mov eax,[Screen_Max_Y] |
|
365 | mov eax,[Screen_Max_Y] |
382 | mov [dlye],eax |
366 | mov [dlye],eax |
383 | mov eax,window_data |
367 | mov eax,window_data |
384 | ;maybe use jmp? |
368 | call redrawscreen |
385 | ; call redrawscreen |
369 | dspl00: |
386 | jmp redrawscreen |
370 | popad |
- | |
371 | ret |
- | |
372 | dspl0: |
387 | .fail: |
373 | 388 | ret |
|
374 | cmp eax,1 ; button type |
389 | .01: |
375 | jne dspl1 |
390 | ; button type |
376 | and ebx,1 |
391 | and ecx,1 |
377 | cmp ebx,[buttontype] |
392 | cmp ecx,[buttontype] |
378 | je dspl9 |
393 | je .01_ex |
379 | mov [buttontype],ebx |
- | |
380 | mov [windowtypechanged],dword 1 |
394 | mov [buttontype],ecx |
381 | dspl9: |
- | |
382 | popad |
395 | mov [windowtypechanged],dword ebx ;eax=1 |
- | 396 | .01_ex: |
|
383 | ret |
397 | ret |
384 | dspl1: |
398 | |
385 | 399 | .02: |
|
386 | cmp eax,2 ; set common window colours |
400 | ; set common window colours |
387 | jne no_com_colours |
401 | dec ebx |
388 | mov [windowtypechanged],dword 1 |
402 | mov [windowtypechanged],dword ebx ;eax=1 |
389 | mov esi,[TASK_BASE] |
403 | mov esi,[TASK_BASE] |
- | 404 | add esi,TASKDATA.mem_start |
|
390 | add esi,TASKDATA.mem_start |
405 | add ecx,[esi] |
391 | add ebx,[esi] |
406 | mov esi,ecx |
392 | mov esi,ebx |
407 | and edx,127 |
393 | mov edi,common_colours |
408 | mov edi,common_colours |
394 | and ecx,127 |
- | |
395 | cld |
409 | mov ecx,edx |
396 | rep movsb |
- | |
Line -... | Line 410... | ||
- | 410 | ; cld not need because cld is set previous call |
|
397 | popad |
411 | rep movsb |
398 | ret |
- | |
399 | no_com_colours: |
412 | ret |
400 | 413 | ||
401 | cmp eax,3 ; get common window colours |
414 | .03: |
402 | jne no_get_com |
415 | ; get common window colours |
- | 416 | mov esi,[TASK_BASE] |
|
403 | mov esi,[TASK_BASE] |
417 | add esi,TASKDATA.mem_start |
404 | add esi,TASKDATA.mem_start |
418 | add ecx,[esi] |
405 | add ebx,[esi] |
419 | mov edi,ecx |
406 | mov edi,ebx |
420 | and edx,127 |
407 | mov esi,common_colours |
- | |
408 | and ecx,127 |
421 | mov esi,common_colours |
409 | cld |
- | |
Line 410... | Line -... | ||
410 | rep movsb |
- | |
- | 422 | mov ecx,edx |
|
411 | popad |
423 | ; cld not need because cld is set previous call |
412 | ret |
- | |
413 | no_get_com: |
424 | rep movsb |
414 | 425 | ret |
|
415 | cmp eax,4 ; get skin height |
426 | |
416 | jne no_skin_height |
- | |
Line 417... | Line 427... | ||
417 | popad |
427 | .04: |
418 | mov eax,[_skinh] |
428 | ; get skin height |
419 | mov [esp+36],eax |
- | |
420 | ret |
429 | mov eax,[_skinh] |
421 | no_skin_height: |
430 | mov [esp+32],eax |
422 | 431 | ret |
|
423 | cmp eax,5 ; get screen workarea |
432 | |
424 | jne no_get_workarea |
433 | .05: |
425 | popad |
434 | ; get screen workarea |
426 | mov eax,[screen_workarea.left-2] |
435 | mov eax,[screen_workarea.left-2] |
427 | mov ax,word[screen_workarea.right] |
- | |
Line -... | Line 436... | ||
- | 436 | mov ax,word[screen_workarea.right] |
|
428 | mov [esp+36],eax |
437 | mov [esp+32],eax |
429 | mov eax,[screen_workarea.top-2] |
438 | mov eax,[screen_workarea.top-2] |
430 | mov ax,word[screen_workarea.bottom] |
439 | mov ax,word[screen_workarea.bottom] |
431 | mov [esp+24],eax |
440 | mov [esp+20],eax |
432 | ret |
441 | ret |
433 | no_get_workarea: |
442 | |
434 | 443 | .06: |
|
435 | cmp eax,6 ; set screen workarea |
444 | ; set screen workarea |
436 | jne no_set_workarea |
445 | ; pushad |
437 | movsx eax,word[esp+16+2] |
446 | movsx eax,word[esp+16+2+12] ;ecx in the stack |
438 | movsx ebx,word[esp+16] |
447 | movsx ebx,word[esp+16+12] |
439 | cmp eax,ebx |
448 | cmp eax,ebx |
440 | jge .lp1 |
449 | jge .lp1 |
441 | or eax,eax;[Screen_Max_X] |
450 | or eax,eax;[Screen_Max_X] |
442 | jl @f |
451 | jl @f |
443 | mov [screen_workarea.left],eax |
452 | mov [screen_workarea.left],eax |
444 | @@: cmp ebx,[Screen_Max_X] |
453 | @@: cmp ebx,[Screen_Max_X] |
445 | jg .lp1 |
454 | jg .lp1 |
446 | mov [screen_workarea.right],ebx |
455 | mov [screen_workarea.right],ebx |
447 | .lp1: movsx eax,word[esp+24+2] |
456 | .lp1: movsx eax,word[esp+24+2] ;edx in the stack |
448 | movsx ebx,word[esp+24] |
457 | movsx ebx,word[esp+24] |
449 | cmp eax,ebx |
458 | cmp eax,ebx |
450 | jge .lp2 |
459 | jge .lp2 |
451 | or eax,eax;[0xFE04] |
460 | or eax,eax;[0xFE04] |
452 | jl @f |
461 | jl @f |
453 | mov [screen_workarea.top],eax |
462 | mov [screen_workarea.top],eax |
454 | @@: cmp ebx,[Screen_Max_Y] |
463 | @@: cmp ebx,[Screen_Max_Y] |
455 | jg .lp2 |
464 | jg .lp2 |
- | 465 | mov [screen_workarea.bottom],ebx |
|
456 | mov [screen_workarea.bottom],ebx |
466 | .lp2: call repos_windows |
457 | .lp2: call repos_windows |
467 | xor eax, eax |
458 | mov eax, 0 |
468 | xor ebx, ebx |
459 | mov ebx, 0 |
469 | mov ecx, [Screen_Max_X] |
460 | mov ecx, [Screen_Max_X] |
- | |
Line 461... | Line 470... | ||
461 | mov edx, [Screen_Max_Y] |
470 | mov edx, [Screen_Max_Y] |
462 | call calculatescreen |
471 | ; call calculatescreen |
463 | ; jmp redraw_screen_direct |
- | |
464 | .exit: |
472 | jmp calculatescreen |
465 | popad |
473 | ; jmp redraw_screen_direct |
466 | ret |
474 | ; .exit: |
467 | no_set_workarea: |
475 | ; popad |
468 | 476 | ; ret |
|
469 | cmp eax,7 ; get skin margins |
- | |
Line -... | Line 477... | ||
- | 477 | ||
470 | jne no_get_skinmargins |
478 | .07: |
471 | popad |
479 | ; get skin margins |
472 | mov eax,dword[_skinmargins+0] |
480 | mov eax,dword[_skinmargins+0] |
- | 481 | mov [esp+32],eax |
|
473 | mov [esp+36],eax |
482 | mov eax,dword[_skinmargins+4] |
474 | mov eax,dword[_skinmargins+4] |
483 | mov [esp+20],eax |
475 | mov [esp+24],eax |
484 | ret |
476 | ret |
485 | |
477 | no_get_skinmargins: |
486 | .08: |
478 | 487 | ; set window skin |
|
479 | cmp eax,8 ; set window skin |
488 | mov ebx, ecx |
480 | jne no_set_skin |
489 | call read_skin_file |
481 | call read_skin_file |
490 | |
482 | mov [esp+32+36], eax |
491 | mov [esp+32], eax |
483 | test eax, eax |
- | |
484 | jnz .ret |
- | |
485 | xor eax, eax |
- | |
486 | xor ebx, ebx |
- | |
487 | mov ecx, [Screen_Max_X] |
- | |
488 | mov edx, [Screen_Max_Y] |
492 | test eax, eax |
Line 489... | Line 493... | ||
489 | call calculatescreen |
493 | jnz .ret |
490 | jmp redraw_screen_direct |
494 | xor eax, eax |