Rev 2513 | Rev 2516 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2513 | Rev 2515 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 68... | Line 68... | ||
68 | 68 | ||
69 | include 'macros.inc' |
69 | include 'macros.inc' |
Line 70... | Line 70... | ||
70 | include 'struct.inc' |
70 | include 'struct.inc' |
Line 71... | Line 71... | ||
71 | 71 | ||
Line 72... | Line 72... | ||
72 | $Revision: 2513 $ |
72 | $Revision: 2515 $ |
Line 2382... | Line 2382... | ||
2382 | db 0,7,7,0 ; version 0.7.7.0 |
2382 | db 0,7,7,0 ; version 0.7.7.0 |
2383 | db 0 |
2383 | db 0 |
2384 | dd __REV__ |
2384 | dd __REV__ |
2385 | version_end: |
2385 | version_end: |
2386 | endg |
2386 | endg |
- | 2387 | ;------------------------------------------------------------------------------ |
|
2387 | 2388 | align 4 |
|
2388 | sys_cachetodiskette: |
2389 | sys_cachetodiskette: |
2389 | cmp ebx, 1 |
2390 | cmp ebx, 1 |
2390 | jne .no_floppy_a_save |
2391 | jne .no_floppy_a_save |
2391 | mov [flp_number], 1 |
2392 | mov [flp_number], 1 |
2392 | jmp .save_image_on_floppy |
2393 | jmp .save_image_on_floppy |
- | 2394 | ;-------------------------------------- |
|
- | 2395 | align 4 |
|
2393 | .no_floppy_a_save: |
2396 | .no_floppy_a_save: |
2394 | cmp ebx, 2 |
2397 | cmp ebx, 2 |
2395 | jne .no_floppy_b_save |
2398 | jne .no_floppy_b_save |
2396 | mov [flp_number], 2 |
2399 | mov [flp_number], 2 |
- | 2400 | ;-------------------------------------- |
|
- | 2401 | align 4 |
|
2397 | .save_image_on_floppy: |
2402 | .save_image_on_floppy: |
2398 | call save_image |
2403 | call save_image |
2399 | mov [esp + 32], dword 0 |
2404 | mov [esp + 32], dword 0 |
2400 | cmp [FDC_Status], 0 |
2405 | cmp [FDC_Status], 0 |
2401 | je .yes_floppy_save |
2406 | je .yes_floppy_save |
- | 2407 | ;-------------------------------------- |
|
- | 2408 | align 4 |
|
2402 | .no_floppy_b_save: |
2409 | .no_floppy_b_save: |
2403 | mov [esp + 32], dword 1 |
2410 | mov [esp + 32], dword 1 |
- | 2411 | ;-------------------------------------- |
|
- | 2412 | align 4 |
|
2404 | .yes_floppy_save: |
2413 | .yes_floppy_save: |
2405 | ret |
2414 | ret |
2406 | - | ||
- | 2415 | ;------------------------------------------------------------------------------ |
|
2407 | uglobal |
2416 | uglobal |
2408 | ; bgrchanged dd 0x0 |
2417 | ; bgrchanged dd 0x0 |
2409 | align 4 |
2418 | align 4 |
2410 | bgrlockpid dd 0 |
2419 | bgrlockpid dd 0 |
2411 | bgrlock db 0 |
2420 | bgrlock db 0 |
2412 | endg |
2421 | endg |
- | 2422 | ;------------------------------------------------------------------------------ |
|
2413 | 2423 | align 4 |
|
2414 | sys_background: |
2424 | sys_background: |
2415 | - | ||
2416 | cmp ebx, 1 ; BACKGROUND SIZE |
2425 | cmp ebx, 1 ; BACKGROUND SIZE |
2417 | jnz nosb1 |
2426 | jnz nosb1 |
2418 | test ecx, ecx |
2427 | test ecx, ecx |
2419 | ; cmp ecx,0 |
2428 | ; cmp ecx,0 |
2420 | jz sbgrr |
2429 | jz sbgrr |
2421 | test edx, edx |
2430 | test edx, edx |
2422 | ; cmp edx,0 |
2431 | ; cmp edx,0 |
2423 | jz sbgrr |
2432 | jz sbgrr |
- | 2433 | ;-------------------------------------- |
|
- | 2434 | align 4 |
|
2424 | @@: |
2435 | @@: |
2425 | ;;Maxis use atomic bts for mutexes 4.4.2009 |
2436 | ;;Maxis use atomic bts for mutexes 4.4.2009 |
2426 | bts dword [bgrlock], 0 |
2437 | bts dword [bgrlock], 0 |
2427 | jnc @f |
2438 | jnc @f |
2428 | call change_task |
2439 | call change_task |
2429 | jmp @b |
2440 | jmp @b |
- | 2441 | ;-------------------------------------- |
|
- | 2442 | align 4 |
|
2430 | @@: |
2443 | @@: |
2431 | mov [BgrDataWidth], ecx |
2444 | mov [BgrDataWidth], ecx |
2432 | mov [BgrDataHeight], edx |
2445 | mov [BgrDataHeight], edx |
2433 | ; mov [bgrchanged],1 |
2446 | ; mov [bgrchanged],1 |
Line 2436... | Line 2449... | ||
2436 | ; return memory for old background |
2449 | ; return memory for old background |
2437 | mov eax, [img_background] |
2450 | mov eax, [img_background] |
2438 | cmp eax, static_background_data |
2451 | cmp eax, static_background_data |
2439 | jz @f |
2452 | jz @f |
2440 | stdcall kernel_free, eax |
2453 | stdcall kernel_free, eax |
- | 2454 | ;-------------------------------------- |
|
- | 2455 | align 4 |
|
2441 | @@: |
2456 | @@: |
2442 | ; calculate RAW size |
2457 | ; calculate RAW size |
2443 | xor eax, eax |
2458 | xor eax, eax |
2444 | inc eax |
2459 | inc eax |
2445 | cmp [BgrDataWidth], eax |
2460 | cmp [BgrDataWidth], eax |
2446 | jae @f |
2461 | jae @f |
2447 | mov [BgrDataWidth], eax |
2462 | mov [BgrDataWidth], eax |
- | 2463 | ;-------------------------------------- |
|
- | 2464 | align 4 |
|
2448 | @@: |
2465 | @@: |
2449 | cmp [BgrDataHeight], eax |
2466 | cmp [BgrDataHeight], eax |
2450 | jae @f |
2467 | jae @f |
2451 | mov [BgrDataHeight], eax |
2468 | mov [BgrDataHeight], eax |
- | 2469 | ;-------------------------------------- |
|
- | 2470 | align 4 |
|
2452 | @@: |
2471 | @@: |
2453 | mov eax, [BgrDataWidth] |
2472 | mov eax, [BgrDataWidth] |
2454 | imul eax, [BgrDataHeight] |
2473 | imul eax, [BgrDataHeight] |
2455 | lea eax, [eax*3] |
2474 | lea eax, [eax*3] |
2456 | ; it is reserved with aligned to the boundary of 4 KB pages, |
2475 | ; it is reserved with aligned to the boundary of 4 KB pages, |
Line 2464... | Line 2483... | ||
2464 | stdcall kernel_alloc, eax |
2483 | stdcall kernel_alloc, eax |
2465 | test eax, eax |
2484 | test eax, eax |
2466 | jz .memfailed |
2485 | jz .memfailed |
2467 | mov [img_background], eax |
2486 | mov [img_background], eax |
2468 | jmp .exit |
2487 | jmp .exit |
- | 2488 | ;-------------------------------------- |
|
- | 2489 | align 4 |
|
2469 | .memfailed: |
2490 | .memfailed: |
2470 | ; revert to static monotone data |
2491 | ; revert to static monotone data |
2471 | mov [img_background], static_background_data |
2492 | mov [img_background], static_background_data |
2472 | xor eax, eax |
2493 | xor eax, eax |
2473 | inc eax |
2494 | inc eax |
2474 | mov [BgrDataWidth], eax |
2495 | mov [BgrDataWidth], eax |
2475 | mov [BgrDataHeight], eax |
2496 | mov [BgrDataHeight], eax |
2476 | mov [mem_BACKGROUND], 4 |
2497 | mov [mem_BACKGROUND], 4 |
- | 2498 | ;-------------------------------------- |
|
- | 2499 | align 4 |
|
2477 | .exit: |
2500 | .exit: |
2478 | popad |
2501 | popad |
2479 | mov [bgrlock], 0 |
2502 | mov [bgrlock], 0 |
- | 2503 | ;-------------------------------------- |
|
2480 | 2504 | align 4 |
|
2481 | sbgrr: |
2505 | sbgrr: |
2482 | ret |
2506 | ret |
- | 2507 | ;------------------------------------------------------------------------------ |
|
2483 | 2508 | align 4 |
|
2484 | nosb1: |
2509 | nosb1: |
2485 | - | ||
2486 | cmp ebx, 2 ; SET PIXEL |
2510 | cmp ebx, 2 ; SET PIXEL |
2487 | jnz nosb2 |
2511 | jnz nosb2 |
Line 2488... | Line 2512... | ||
2488 | 2512 | ||
2489 | mov eax, [img_background] |
2513 | mov eax, [img_background] |
2490 | test ecx, ecx |
2514 | test ecx, ecx |
2491 | jz @f |
2515 | jz @f |
2492 | cmp eax, static_background_data |
2516 | cmp eax, static_background_data |
- | 2517 | jz .ret |
|
- | 2518 | ;-------------------------------------- |
|
2493 | jz .ret |
2519 | align 4 |
2494 | @@: |
2520 | @@: |
2495 | mov ebx, [mem_BACKGROUND] |
2521 | mov ebx, [mem_BACKGROUND] |
2496 | add ebx, 4095 |
2522 | add ebx, 4095 |
2497 | and ebx, -4096 |
2523 | and ebx, -4096 |
Line 2502... | Line 2528... | ||
2502 | mov ebx, [eax+ecx] |
2528 | mov ebx, [eax+ecx] |
2503 | and ebx, 0xFF000000;255*256*256*256 |
2529 | and ebx, 0xFF000000;255*256*256*256 |
2504 | and edx, 0x00FFFFFF;255*256*256+255*256+255 |
2530 | and edx, 0x00FFFFFF;255*256*256+255*256+255 |
2505 | add edx, ebx |
2531 | add edx, ebx |
2506 | mov [eax+ecx], edx |
2532 | mov [eax+ecx], edx |
- | 2533 | ;-------------------------------------- |
|
- | 2534 | align 4 |
|
2507 | .ret: |
2535 | .ret: |
2508 | ret |
2536 | ret |
- | 2537 | ;------------------------------------------------------------------------------ |
|
- | 2538 | align 4 |
|
2509 | nosb2: |
2539 | nosb2: |
2510 | - | ||
2511 | cmp ebx, 3 ; DRAW BACKGROUND |
2540 | cmp ebx, 3 ; DRAW BACKGROUND |
2512 | jnz nosb3 |
2541 | jnz nosb3 |
- | 2542 | ;-------------------------------------- |
|
- | 2543 | align 4 |
|
2513 | draw_background_temp: |
2544 | draw_background_temp: |
2514 | mov [background_defined], 1 |
2545 | mov [background_defined], 1 |
2515 | call force_redraw_background |
2546 | call force_redraw_background |
- | 2547 | ;-------------------------------------- |
|
- | 2548 | align 4 |
|
2516 | nosb31: |
2549 | nosb31: |
2517 | ret |
2550 | ret |
- | 2551 | ;------------------------------------------------------------------------------ |
|
- | 2552 | align 4 |
|
2518 | nosb3: |
2553 | nosb3: |
2519 | - | ||
2520 | cmp ebx, 4 ; TILED / STRETCHED |
2554 | cmp ebx, 4 ; TILED / STRETCHED |
2521 | jnz nosb4 |
2555 | jnz nosb4 |
2522 | cmp ecx, [BgrDrawMode] |
2556 | cmp ecx, [BgrDrawMode] |
2523 | je nosb41 |
2557 | je nosb41 |
2524 | mov [BgrDrawMode], ecx |
2558 | mov [BgrDrawMode], ecx |
- | 2559 | ;-------------------------------------- |
|
- | 2560 | align 4 |
|
2525 | nosb41: |
2561 | nosb41: |
2526 | ret |
2562 | ret |
- | 2563 | ;------------------------------------------------------------------------------ |
|
- | 2564 | align 4 |
|
2527 | nosb4: |
2565 | nosb4: |
2528 | - | ||
2529 | cmp ebx, 5 ; BLOCK MOVE TO BGR |
2566 | cmp ebx, 5 ; BLOCK MOVE TO BGR |
2530 | jnz nosb5 |
2567 | jnz nosb5 |
2531 | cmp [img_background], static_background_data |
2568 | cmp [img_background], static_background_data |
2532 | jnz @f |
2569 | jnz @f |
2533 | test edx, edx |
2570 | test edx, edx |
2534 | jnz .fin |
2571 | jnz .fin |
2535 | cmp esi, 4 |
2572 | cmp esi, 4 |
2536 | ja .fin |
2573 | ja .fin |
- | 2574 | ;-------------------------------------- |
|
- | 2575 | align 4 |
|
2537 | @@: |
2576 | @@: |
2538 | ; bughere |
2577 | ; bughere |
2539 | mov eax, ecx |
2578 | mov eax, ecx |
2540 | mov ebx, edx |
2579 | mov ebx, edx |
2541 | add ebx, [img_background];IMG_BACKGROUND |
2580 | add ebx, [img_background];IMG_BACKGROUND |
2542 | mov ecx, esi |
2581 | mov ecx, esi |
2543 | call memmove |
2582 | call memmove |
- | 2583 | ;-------------------------------------- |
|
- | 2584 | align 4 |
|
2544 | .fin: |
2585 | .fin: |
2545 | ret |
2586 | ret |
- | 2587 | ;------------------------------------------------------------------------------ |
|
- | 2588 | align 4 |
|
2546 | nosb5: |
2589 | nosb5: |
2547 | - | ||
2548 | cmp ebx, 6 |
2590 | cmp ebx, 6 |
2549 | jnz nosb6 |
2591 | jnz nosb6 |
- | 2592 | ;-------------------------------------- |
|
- | 2593 | align 4 |
|
2550 | ;;Maxis use atomic bts for mutex 4.4.2009 |
2594 | ;;Maxis use atomic bts for mutex 4.4.2009 |
2551 | @@: |
2595 | @@: |
2552 | bts dword [bgrlock], 0 |
2596 | bts dword [bgrlock], 0 |
2553 | jnc @f |
2597 | jnc @f |
2554 | call change_task |
2598 | call change_task |
2555 | jmp @b |
2599 | jmp @b |
- | 2600 | ;-------------------------------------- |
|
- | 2601 | align 4 |
|
2556 | @@: |
2602 | @@: |
2557 | mov eax, [CURRENT_TASK] |
2603 | mov eax, [CURRENT_TASK] |
2558 | mov [bgrlockpid], eax |
2604 | mov [bgrlockpid], eax |
2559 | cmp [img_background], static_background_data |
2605 | cmp [img_background], static_background_data |
2560 | jz .nomem |
2606 | jz .nomem |
Line 2568... | Line 2614... | ||
2568 | mov esi, [img_background] |
2614 | mov esi, [img_background] |
2569 | shr esi, 12 |
2615 | shr esi, 12 |
2570 | mov ecx, [mem_BACKGROUND] |
2616 | mov ecx, [mem_BACKGROUND] |
2571 | add ecx, 0xFFF |
2617 | add ecx, 0xFFF |
2572 | shr ecx, 12 |
2618 | shr ecx, 12 |
- | 2619 | ;-------------------------------------- |
|
- | 2620 | align 4 |
|
2573 | .z: |
2621 | .z: |
2574 | mov eax, [page_tabs+ebx*4] |
2622 | mov eax, [page_tabs+ebx*4] |
2575 | test al, 1 |
2623 | test al, 1 |
2576 | jz @f |
2624 | jz @f |
2577 | call free_page |
2625 | call free_page |
- | 2626 | ;-------------------------------------- |
|
- | 2627 | align 4 |
|
2578 | @@: |
2628 | @@: |
2579 | mov eax, [page_tabs+esi*4] |
2629 | mov eax, [page_tabs+esi*4] |
2580 | or al, PG_UW |
2630 | or al, PG_UW |
2581 | mov [page_tabs+ebx*4], eax |
2631 | mov [page_tabs+ebx*4], eax |
2582 | mov eax, ebx |
2632 | mov eax, ebx |
Line 2584... | Line 2634... | ||
2584 | invlpg [eax] |
2634 | invlpg [eax] |
2585 | inc ebx |
2635 | inc ebx |
2586 | inc esi |
2636 | inc esi |
2587 | loop .z |
2637 | loop .z |
2588 | ret |
2638 | ret |
- | 2639 | ;-------------------------------------- |
|
- | 2640 | align 4 |
|
2589 | .nomem: |
2641 | .nomem: |
2590 | and [bgrlockpid], 0 |
2642 | and [bgrlockpid], 0 |
2591 | mov [bgrlock], 0 |
2643 | mov [bgrlock], 0 |
- | 2644 | ;------------------------------------------------------------------------------ |
|
- | 2645 | align 4 |
|
2592 | nosb6: |
2646 | nosb6: |
2593 | cmp ebx, 7 |
2647 | cmp ebx, 7 |
2594 | jnz nosb7 |
2648 | jnz nosb7 |
2595 | cmp [bgrlock], 0 |
2649 | cmp [bgrlock], 0 |
2596 | jz .err |
2650 | jz .err |
Line 2605... | Line 2659... | ||
2605 | jz .err |
2659 | jz .err |
2606 | jnp .err |
2660 | jnp .err |
2607 | push eax |
2661 | push eax |
2608 | shr ecx, 12 |
2662 | shr ecx, 12 |
2609 | dec ecx |
2663 | dec ecx |
- | 2664 | ;-------------------------------------- |
|
- | 2665 | align 4 |
|
2610 | @@: |
2666 | @@: |
2611 | and dword [page_tabs+eax*4], 0 |
2667 | and dword [page_tabs+eax*4], 0 |
2612 | mov edx, eax |
2668 | mov edx, eax |
2613 | shl edx, 12 |
2669 | shl edx, 12 |
2614 | push eax |
2670 | push eax |
Line 2621... | Line 2677... | ||
2621 | stdcall user_free, ebx |
2677 | stdcall user_free, ebx |
2622 | mov [esp+32], eax |
2678 | mov [esp+32], eax |
2623 | and [bgrlockpid], 0 |
2679 | and [bgrlockpid], 0 |
2624 | mov [bgrlock], 0 |
2680 | mov [bgrlock], 0 |
2625 | ret |
2681 | ret |
- | 2682 | ;-------------------------------------- |
|
- | 2683 | align 4 |
|
2626 | .err: |
2684 | .err: |
2627 | and dword [esp+32], 0 |
2685 | and dword [esp+32], 0 |
2628 | ret |
2686 | ret |
- | 2687 | ;------------------------------------------------------------------------------ |
|
2629 | 2688 | align 4 |
|
2630 | nosb7: |
2689 | nosb7: |
- | 2690 | cmp ebx, 8 |
|
- | 2691 | jnz nosb8 |
|
- | 2692 | mov eax, [draw_data+32 + RECT.left] |
|
- | 2693 | shl eax, 16 |
|
- | 2694 | add eax, [draw_data+32 + RECT.right] |
|
- | 2695 | mov [esp + 32], eax ; eax = [left]*65536 + [right] |
|
- | 2696 | mov eax, [draw_data+32 + RECT.top] |
|
- | 2697 | shl eax, 16 |
|
- | 2698 | add eax, [draw_data+32 + RECT.bottom] |
|
- | 2699 | mov [esp + 20], eax ; ebx = [top]*65536 + [bottom] |
|
2631 | ret |
2700 | ret |
- | 2701 | ;------------------------------------------------------------------------------ |
|
- | 2702 | align 4 |
|
2632 | 2703 | nosb8: |
|
- | 2704 | ret |
|
- | 2705 | ;------------------------------------------------------------------------------ |
|
- | 2706 | align 4 |
|
2633 | force_redraw_background: |
2707 | force_redraw_background: |
2634 | and [draw_data+32 + RECT.left], 0 |
2708 | and [draw_data+32 + RECT.left], 0 |
2635 | and [draw_data+32 + RECT.top], 0 |
2709 | and [draw_data+32 + RECT.top], 0 |
2636 | push eax ebx |
2710 | push eax ebx |
2637 | mov eax, [Screen_Max_X] |
2711 | mov eax, [Screen_Max_X] |
Line 2639... | Line 2713... | ||
2639 | mov [draw_data+32 + RECT.right], eax |
2713 | mov [draw_data+32 + RECT.right], eax |
2640 | mov [draw_data+32 + RECT.bottom], ebx |
2714 | mov [draw_data+32 + RECT.bottom], ebx |
2641 | pop ebx eax |
2715 | pop ebx eax |
2642 | inc byte[REDRAW_BACKGROUND] |
2716 | inc byte[REDRAW_BACKGROUND] |
2643 | ret |
2717 | ret |
2644 | - | ||
- | 2718 | ;------------------------------------------------------------------------------ |
|
2645 | align 4 |
2719 | align 4 |
2646 | - | ||
2647 | sys_getbackground: |
2720 | sys_getbackground: |
2648 | ; cmp eax,1 ; SIZE |
2721 | ; cmp eax,1 ; SIZE |
2649 | dec ebx |
2722 | dec ebx |
2650 | jnz nogb1 |
2723 | jnz nogb1 |
2651 | mov eax, [BgrDataWidth] |
2724 | mov eax, [BgrDataWidth] |
2652 | shl eax, 16 |
2725 | shl eax, 16 |
2653 | mov ax, [BgrDataHeight] |
2726 | mov ax, [BgrDataHeight] |
2654 | mov [esp+32], eax |
2727 | mov [esp+32], eax |
2655 | ret |
2728 | ret |
- | 2729 | ;------------------------------------------------------------------------------ |
|
2656 | 2730 | align 4 |
|
2657 | nogb1: |
2731 | nogb1: |
2658 | ; cmp eax,2 ; PIXEL |
2732 | ; cmp eax,2 ; PIXEL |
2659 | dec ebx |
2733 | dec ebx |
2660 | jnz nogb2 |
2734 | jnz nogb2 |
Line 2661... | Line 2735... | ||
2661 | 2735 | ||
2662 | mov eax, [img_background] |
2736 | mov eax, [img_background] |
2663 | test ecx, ecx |
2737 | test ecx, ecx |
2664 | jz @f |
2738 | jz @f |
2665 | cmp eax, static_background_data |
2739 | cmp eax, static_background_data |
- | 2740 | jz .ret |
|
- | 2741 | ;-------------------------------------- |
|
2666 | jz .ret |
2742 | align 4 |
2667 | @@: |
2743 | @@: |
2668 | mov ebx, [mem_BACKGROUND] |
2744 | mov ebx, [mem_BACKGROUND] |
2669 | add ebx, 4095 |
2745 | add ebx, 4095 |
2670 | and ebx, -4096 |
2746 | and ebx, -4096 |
Line 2674... | Line 2750... | ||
2674 | 2750 | ||
Line 2675... | Line 2751... | ||
2675 | mov eax, [ecx+eax] |
2751 | mov eax, [ecx+eax] |
2676 | 2752 | ||
- | 2753 | and eax, 0xFFFFFF |
|
- | 2754 | mov [esp+32], eax |
|
2677 | and eax, 0xFFFFFF |
2755 | ;-------------------------------------- |
2678 | mov [esp+32], eax |
2756 | align 4 |
- | 2757 | .ret: |
|
- | 2758 | ret |
|
2679 | .ret: |
2759 | ;------------------------------------------------------------------------------ |
Line 2680... | Line 2760... | ||
2680 | ret |
2760 | align 4 |
2681 | nogb2: |
2761 | nogb2: |
2682 | 2762 | ||
2683 | ; cmp eax,4 ; TILED / STRETCHED |
2763 | ; cmp eax,4 ; TILED / STRETCHED |
2684 | dec ebx |
2764 | dec ebx |
- | 2765 | dec ebx |
|
- | 2766 | jnz nogb4 |
|
2685 | dec ebx |
2767 | mov eax, [BgrDrawMode] |
2686 | jnz nogb4 |
2768 | ;-------------------------------------- |
2687 | mov eax, [BgrDrawMode] |
2769 | align 4 |
2688 | nogb4: |
- | |
- | 2770 | nogb4: |
|
2689 | mov [esp+32], eax |
2771 | mov [esp+32], eax |
2690 | ret |
- | |
2691 | 2772 | ret |
|
2692 | align 4 |
2773 | ;------------------------------------------------------------------------------ |
2693 | 2774 | align 4 |
|
2694 | sys_getkey: |
2775 | sys_getkey: |
2695 | mov [esp + 32], dword 1 |
2776 | mov [esp + 32], dword 1 |
Line 2710... | Line 2791... | ||
2710 | add ecx, 2 |
2791 | add ecx, 2 |
2711 | mov eax, KEY_BUFF + 1 |
2792 | mov eax, KEY_BUFF + 1 |
2712 | mov ebx, KEY_BUFF |
2793 | mov ebx, KEY_BUFF |
2713 | call memmove |
2794 | call memmove |
2714 | pop eax |
2795 | pop eax |
- | 2796 | ;-------------------------------------- |
|
- | 2797 | align 4 |
|
2715 | .ret_eax: |
2798 | .ret_eax: |
2716 | mov [esp + 32], eax |
2799 | mov [esp + 32], eax |
2717 | ret |
2800 | ret |
- | 2801 | ;-------------------------------------- |
|
- | 2802 | align 4 |
|
2718 | .finish: |
2803 | .finish: |
2719 | ; test hotkeys buffer |
2804 | ; test hotkeys buffer |
2720 | mov ecx, hotkey_buffer |
2805 | mov ecx, hotkey_buffer |
- | 2806 | ;-------------------------------------- |
|
- | 2807 | align 4 |
|
2721 | @@: |
2808 | @@: |
2722 | cmp [ecx], ebx |
2809 | cmp [ecx], ebx |
2723 | jz .found |
2810 | jz .found |
2724 | add ecx, 8 |
2811 | add ecx, 8 |
2725 | cmp ecx, hotkey_buffer + 120 * 8 |
2812 | cmp ecx, hotkey_buffer + 120 * 8 |
2726 | jb @b |
2813 | jb @b |
2727 | ret |
2814 | ret |
- | 2815 | ;-------------------------------------- |
|
- | 2816 | align 4 |
|
2728 | .found: |
2817 | .found: |
2729 | mov ax, [ecx + 6] |
2818 | mov ax, [ecx + 6] |
2730 | shl eax, 16 |
2819 | shl eax, 16 |
2731 | mov ah, [ecx + 4] |
2820 | mov ah, [ecx + 4] |
2732 | mov al, 2 |
2821 | mov al, 2 |
2733 | and dword [ecx + 4], 0 |
2822 | and dword [ecx + 4], 0 |
2734 | and dword [ecx], 0 |
2823 | and dword [ecx], 0 |
2735 | jmp .ret_eax |
2824 | jmp .ret_eax |
2736 | - | ||
- | 2825 | ;------------------------------------------------------------------------------ |
|
2737 | align 4 |
2826 | align 4 |
2738 | - | ||
2739 | sys_getbutton: |
2827 | sys_getbutton: |
2740 | - | ||
2741 | mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK |
2828 | mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK |
2742 | mov [esp + 32], dword 1 |
2829 | mov [esp + 32], dword 1 |
2743 | movzx ecx, word [WIN_STACK + ebx * 2] |
2830 | movzx ecx, word [WIN_STACK + ebx * 2] |
2744 | mov edx, [TASK_COUNT] ; less than 256 processes |
2831 | mov edx, [TASK_COUNT] ; less than 256 processes |
2745 | cmp ecx, edx |
2832 | cmp ecx, edx |
Line 2749... | Line 2836... | ||
2749 | jz .exit |
2836 | jz .exit |
2750 | mov eax, [BTN_BUFF] |
2837 | mov eax, [BTN_BUFF] |
2751 | and al, 0xFE ; delete left button bit |
2838 | and al, 0xFE ; delete left button bit |
2752 | mov [BTN_COUNT], byte 0 |
2839 | mov [BTN_COUNT], byte 0 |
2753 | mov [esp + 32], eax |
2840 | mov [esp + 32], eax |
- | 2841 | ;-------------------------------------- |
|
- | 2842 | align 4 |
|
2754 | .exit: |
2843 | .exit: |
2755 | ret |
2844 | ret |
2756 | - | ||
2757 | - | ||
- | 2845 | ;------------------------------------------------------------------------------ |
|
2758 | align 4 |
2846 | align 4 |
2759 | - | ||
2760 | sys_cpuusage: |
2847 | sys_cpuusage: |
Line 2761... | Line 2848... | ||
2761 | 2848 | ||
2762 | ; RETURN: |
2849 | ; RETURN: |
2763 | ; |
2850 | ; |