Subversion Repositories Kolibri OS

Rev

Rev 2465 | Rev 3232 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2465 Rev 2987
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: 2465 $
72
$Revision: 2987 $
Line 400... Line 400...
400
        call    mutex_init
400
        call    mutex_init
Line 401... Line 401...
401
 
401
 
402
        mov     ecx, disk_list_mutex
402
        mov     ecx, disk_list_mutex
Line -... Line 403...
-
 
403
        call    mutex_init
-
 
404
 
-
 
405
        mov     ecx, keyboard_list_mutex
-
 
406
        call    mutex_init
-
 
407
 
-
 
408
        mov     ecx, unpack_mutex
403
        call    mutex_init
409
        call    mutex_init
404
 
410
 
405
; SAVE REAL MODE VARIABLES
411
; SAVE REAL MODE VARIABLES
406
        mov     ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
412
        mov     ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
Line 445... Line 451...
445
        mov     [_display.bpp], eax
451
        mov     [_display.bpp], eax
446
        mov     [_display.vrefresh], 60
452
        mov     [_display.vrefresh], 60
Line 447... Line 453...
447
 
453
 
448
        movzx   eax, word [BOOT_VAR+BOOT_X_RES]; X max
454
        movzx   eax, word [BOOT_VAR+BOOT_X_RES]; X max
-
 
455
        mov     [_display.width], eax
449
        mov     [_display.width], eax
456
        mov     [display_width_standard], eax
450
        dec     eax
457
        dec     eax
451
        mov     [Screen_Max_X], eax
458
        mov     [Screen_Max_X], eax
452
        mov     [screen_workarea.right], eax
459
        mov     [screen_workarea.right], eax
453
        movzx   eax, word [BOOT_VAR+BOOT_Y_RES]; Y max
460
        movzx   eax, word [BOOT_VAR+BOOT_Y_RES]; Y max
-
 
461
        mov     [_display.height], eax
454
        mov     [_display.height], eax
462
        mov     [display_height_standard], eax
455
        dec     eax
463
        dec     eax
456
        mov     [Screen_Max_Y], eax
464
        mov     [Screen_Max_Y], eax
457
        mov     [screen_workarea.bottom], eax
465
        mov     [screen_workarea.bottom], eax
458
        movzx   eax, word [BOOT_VAR+BOOT_VESA_MODE]; screen mode
466
        movzx   eax, word [BOOT_VAR+BOOT_VESA_MODE]; screen mode
Line 471... Line 479...
471
        mov     eax, [_display.width]
479
        mov     eax, [_display.width]
472
        mul     [_display.height]
480
        mul     [_display.height]
473
        mov     [_WinMapSize], eax
481
        mov     [_WinMapSize], eax
Line 474... Line 482...
474
 
482
 
-
 
483
        call    calculate_fast_getting_offset_for_WinMapAddress
-
 
484
; for Qemu or non standart video cards
-
 
485
; Unfortunately [BytesPerScanLine] does not always 
-
 
486
;                             equal to [_display.width] * [ScreenBPP] / 8
Line 475... Line 487...
475
        call    calculate_fast_getting_offset_for_WinMapAddress
487
        call    calculate_fast_getting_offset_for_LFB
476
 
488
 
477
        mov     esi, BOOT_VAR+0x9080
489
        mov     esi, BOOT_VAR+0x9080
478
        movzx   ecx, byte [esi-1]
490
        movzx   ecx, byte [esi-1]
Line 505... Line 517...
505
        jne     no_mode_0x12
517
        jne     no_mode_0x12
506
        mov     [PUTPIXEL], dword VGA_putpixel
518
        mov     [PUTPIXEL], dword VGA_putpixel
507
        mov     [GETPIXEL], dword Vesa20_getpixel32
519
        mov     [GETPIXEL], dword Vesa20_getpixel32
508
no_mode_0x12:
520
no_mode_0x12:
Line -... Line 521...
-
 
521
 
-
 
522
        mov     [MOUSE_PICTURE], dword mousepointer
-
 
523
        mov     [_display.check_mouse], check_mouse_area_for_putpixel
-
 
524
        mov     [_display.check_m_pixel], check_mouse_area_for_getpixel
509
 
525
 
510
; -------- Fast System Call init ----------
526
; -------- Fast System Call init ----------
511
; Intel SYSENTER/SYSEXIT (AMD CPU support it too)
527
; Intel SYSENTER/SYSEXIT (AMD CPU support it too)
512
        bt      [cpu_caps], CAPS_SEP
528
        bt      [cpu_caps], CAPS_SEP
513
        jnc     .SEnP  ; SysEnter not Present
529
        jnc     .SEnP  ; SysEnter not Present
Line 590... Line 606...
590
        rep stosd                    ; access to 4096*8=65536 ports
606
        rep stosd                    ; access to 4096*8=65536 ports
Line 591... Line 607...
591
 
607
 
592
        mov     ax, tss0
608
        mov     ax, tss0
Line 593... Line 609...
593
        ltr     ax
609
        ltr     ax
594
 
610
 
595
        mov     [LFBSize], 0x800000
611
        mov     [LFBSize], 0xC00000
596
        call    init_LFB
612
        call    init_LFB
Line 597... Line 613...
597
        call    init_fpu
613
        call    init_fpu
Line 668... Line 684...
668
        or      eax, -1
684
        or      eax, -1
669
        mov     ecx, 0x10000/32
685
        mov     ecx, 0x10000/32
670
        rep stosd
686
        rep stosd
Line 671... Line 687...
671
 
687
 
672
; REDIRECT ALL IRQ'S TO INT'S 0x20-0x2f
-
 
-
 
688
; REDIRECT ALL IRQ'S TO INT'S 0x20-0x2f
-
 
689
        mov     esi, boot_initirq
673
 
690
        call    boot_log
-
 
691
        call    init_irqs
-
 
692
 
-
 
693
        mov     esi, boot_picinit
674
        call    init_irqs
694
        call    boot_log
Line -... Line 695...
-
 
695
        call    PIC_init
-
 
696
 
675
        call    PIC_init
697
        mov     esi, boot_v86machine
676
 
698
        call    boot_log
Line -... Line 699...
-
 
699
; Initialize system V86 machine
-
 
700
        call    init_sys_v86
677
; Initialize system V86 machine
701
 
678
        call    init_sys_v86
702
        mov     esi, boot_inittimer
Line -... Line 703...
-
 
703
        call    boot_log
-
 
704
; Initialize system timer (IRQ0)
679
 
705
        call    PIT_init
680
; Initialize system timer (IRQ0)
706
 
Line 681... Line 707...
681
        call    PIT_init
707
        mov     esi, boot_initapic
Line 695... Line 721...
695
        stdcall enable_irq, 6               ; FDD
721
        stdcall enable_irq, 6               ; FDD
696
        stdcall enable_irq, 13              ; co-processor
722
        stdcall enable_irq, 13              ; co-processor
697
        stdcall enable_irq, 14
723
        stdcall enable_irq, 14
698
        stdcall enable_irq, 15
724
        stdcall enable_irq, 15
Line -... Line 725...
-
 
725
 
-
 
726
        mov     esi, boot_enablint_ide
699
 
727
        call    boot_log
700
; Enable interrupts in IDE controller
728
; Enable interrupts in IDE controller
701
        mov     al, 0
729
        mov     al, 0
702
        mov     dx, 0x3F6
730
        mov     dx, 0x3F6
703
        out     dx, al
731
        out     dx, al
704
        mov     dl, 0x76
732
        mov     dl, 0x76
Line 705... Line 733...
705
        out     dx, al
733
        out     dx, al
-
 
734
 
-
 
735
;!!!!!!!!!!!!!!!!!!!!!!!!!!
706
 
736
;        mov     esi, boot_detectdisks
-
 
737
;        call    boot_log
-
 
738
;include 'detect/disks.inc'
-
 
739
        mov     esi, boot_detectfloppy
-
 
740
        call    boot_log
-
 
741
include 'detect/dev_fd.inc'
-
 
742
        mov     esi, boot_detecthdcd
-
 
743
        call    boot_log
-
 
744
include 'detect/dev_hdcd.inc'
-
 
745
        mov     esi, boot_getcache
-
 
746
        call    boot_log
-
 
747
include 'detect/getcache.inc'
-
 
748
        mov     esi, boot_detectpart
707
;!!!!!!!!!!!!!!!!!!!!!!!!!!
749
        call    boot_log
Line -... Line 750...
-
 
750
include 'detect/sear_par.inc'
-
 
751
;!!!!!!!!!!!!!!!!!!!!!!!!!!
708
include 'detect/disks.inc'
752
 
Line 709... Line 753...
709
;!!!!!!!!!!!!!!!!!!!!!!!!!!
753
        mov     esi, boot_init_sys
710
 
754
        call    boot_log
711
        call    Parser_params
755
        call    Parser_params
Line 725... Line 769...
725
 
769
 
726
if 0
770
if 0
727
        mov     ax, [OS_BASE+0x10000+bx_from_load]
771
        mov     ax, [OS_BASE+0x10000+bx_from_load]
728
        cmp     ax, 'r1'; if using not ram disk, then load librares and parameters {SPraid.simba}
772
        cmp     ax, 'r1'; if using not ram disk, then load librares and parameters {SPraid.simba}
-
 
773
        je      no_lib_load
-
 
774
 
-
 
775
        mov     esi, boot_loadlibs
729
        je      no_lib_load
776
        call    boot_log
730
; LOADING LIBRARES
777
; LOADING LIBRARES
731
        stdcall dll.Load, @IMPORT           ; loading librares for kernel (.obj files)
778
        stdcall dll.Load, @IMPORT           ; loading librares for kernel (.obj files)
732
        call    load_file_parse_table       ; prepare file parse table
779
        call    load_file_parse_table       ; prepare file parse table
733
        call    set_kernel_conf             ; configure devices and gui
780
        call    set_kernel_conf             ; configure devices and gui
734
no_lib_load:
781
no_lib_load:
Line 735... Line -...
735
end if
-
 
736
 
-
 
737
; LOAD FONTS I and II
-
 
738
 
-
 
739
        stdcall read_file, char, FONT_I, 0, 2304
-
 
740
        stdcall read_file, char2, FONT_II, 0, 2560
-
 
741
 
-
 
742
        mov     [MOUSE_PICTURE], dword mousepointer
-
 
743
        mov     [_display.check_mouse], check_mouse_area_for_putpixel
-
 
744
        mov     [_display.check_m_pixel], check_mouse_area_for_getpixel
-
 
745
 
-
 
746
        mov     esi, boot_fonts
-
 
747
        call    boot_log
782
end if
748
 
783
 
749
; Display APIC status
784
; Display APIC status
750
        mov     esi, boot_APIC_found
785
        mov     esi, boot_APIC_found
751
        cmp     [irq_mode], IRQ_APIC
786
        cmp     [irq_mode], IRQ_APIC
752
        je      @f
787
        je      @f
-
 
788
        mov     esi, boot_APIC_nfound
Line 753... Line 789...
753
        mov     esi, boot_APIC_nfound
789
@@:
754
@@:
790
        call    boot_log
755
 
791
 
Line 772... Line 808...
772
        inc     edi
808
        inc     edi
773
        call    display_number_force
809
        call    display_number_force
Line 774... Line 810...
774
 
810
 
Line 775... Line 811...
775
; BUILD SCHEDULER
811
; BUILD SCHEDULER
Line 776... Line 812...
776
 
812
 
777
        call    build_scheduler; sys32.inc
813
;        call    build_scheduler; sys32.inc
Line 778... Line 814...
778
 
814
 
Line 779... Line 815...
779
        mov     esi, boot_devices
815
;        mov     esi, boot_devices
Line 976... Line 1012...
976
        pop     dword [CURRENT_TASK]    ; set OS task fisrt
1012
        pop     dword [CURRENT_TASK]    ; set OS task fisrt
Line 977... Line 1013...
977
 
1013
 
978
; SET KEYBOARD PARAMETERS
1014
; SET KEYBOARD PARAMETERS
979
        mov     al, 0xf6       ; reset keyboard, scan enabled
1015
        mov     al, 0xf6       ; reset keyboard, scan enabled
-
 
1016
        call    kb_write
-
 
1017
        test    ah, ah
Line 980... Line 1018...
980
        call    kb_write
1018
        jnz     .no_keyboard
981
 
1019
 
982
        ; wait until 8042 is ready
1020
        ; wait until 8042 is ready
983
        xor     ecx, ecx
1021
        xor     ecx, ecx
984
      @@:
1022
      @@:
985
        in      al, 64h
1023
        in      al, 64h
Line -... Line 1024...
-
 
1024
        and     al, 00000010b
-
 
1025
        loopnz  @b
-
 
1026
 
-
 
1027
iglobal
-
 
1028
align 4
-
 
1029
ps2_keyboard_functions:
-
 
1030
        dd      .end - $
-
 
1031
        dd      0       ; no close
-
 
1032
        dd      ps2_set_lights
986
        and     al, 00000010b
1033
.end:
987
        loopnz  @b
1034
endg
988
 
1035
        stdcall register_keyboard, ps2_keyboard_functions, 0
989
       ; mov   al, 0xED       ; Keyboard LEDs - only for testing!
1036
       ; mov   al, 0xED       ; Keyboard LEDs - only for testing!
990
       ; call  kb_write
1037
       ; call  kb_write
Line 1001... Line 1048...
1001
;        call  kb_read
1048
;        call  kb_read
1002
     ;// mike.dld [
1049
     ;// mike.dld [
1003
        call    set_lights
1050
        call    set_lights
1004
     ;// mike.dld ]
1051
     ;// mike.dld ]
1005
        stdcall attach_int_handler, 1, irq1, 0
1052
        stdcall attach_int_handler, 1, irq1, 0
-
 
1053
.no_keyboard:
Line 1006... Line 1054...
1006
 
1054
 
Line 1007... Line 1055...
1007
; SET MOUSE
1055
; SET MOUSE
1008
 
1056
 
Line 1051... Line 1099...
1051
        mov     al, 0x7 + 1 shl 5
1099
        mov     al, 0x7 + 1 shl 5
1052
        out     dx, al
1100
        out     dx, al
Line 1053... Line 1101...
1053
 
1101
 
-
 
1102
 
1054
 
1103
end if
1055
end if
1104
 
1056
        mov     eax, [cpu_count]
1105
        mov     eax, [cpu_count]
1057
        test    eax, eax
1106
        test    eax, eax
1058
        jnz     @F
1107
        jnz     @F
Line 1123... Line 1172...
1123
        call    checkVga_N13
1172
        call    checkVga_N13
1124
        call    stack_handler
1173
        call    stack_handler
1125
        call    checkidle
1174
        call    checkidle
1126
        call    check_fdd_motor_status
1175
        call    check_fdd_motor_status
1127
        call    check_ATAPI_device_event
1176
        call    check_ATAPI_device_event
-
 
1177
        call    check_lights_state
1128
        call    check_timers
1178
        call    check_timers
1129
        jmp     osloop
1179
        jmp     osloop
1130
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1180
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1131
;                                                                    ;
1181
;                                                                    ;
1132
;                      MAIN OS LOOP END                              ;
1182
;                      MAIN OS LOOP END                              ;
Line 2023... Line 2073...
2023
        call    delay_hs
2073
        call    delay_hs
2024
        jmp     waitterm
2074
        jmp     waitterm
2025
;------------------------------------------------------------------------------
2075
;------------------------------------------------------------------------------
2026
align 4
2076
align 4
2027
restore_default_cursor_before_killing:
2077
restore_default_cursor_before_killing:
-
 
2078
        pushfd
-
 
2079
        cli
2028
        mov     eax, [def_cursor]
2080
        mov     eax, [def_cursor]
2029
        mov     [ecx+APPDATA.cursor], eax
2081
        mov     [ecx+APPDATA.cursor], eax
Line 2030... Line 2082...
2030
 
2082
 
2031
        movzx   eax, word [MOUSE_Y]
2083
        movzx   eax, word [MOUSE_Y]
Line 2046... Line 2098...
2046
        push    esi
2098
        push    esi
2047
        call    [_display.select_cursor]
2099
        call    [_display.select_cursor]
2048
        mov     [current_cursor], esi
2100
        mov     [current_cursor], esi
2049
@@:
2101
@@:
2050
        mov     [redrawmouse_unconditional], 1
2102
        mov     [redrawmouse_unconditional], 1
-
 
2103
        popfd
2051
;        call    [draw_pointer]
2104
;        call    [draw_pointer]
2052
        call    __sys_draw_pointer
2105
        call    __sys_draw_pointer
2053
        ret
2106
        ret
2054
;------------------------------------------------------------------------------
2107
;------------------------------------------------------------------------------
2055
iglobal
2108
iglobal
Line 2076... Line 2129...
2076
                                        ;                 instead of slot
2129
                                        ;                 instead of slot
2077
        dd      sysfn_mouse_acceleration; 19 = set/get mouse acceleration
2130
        dd      sysfn_mouse_acceleration; 19 = set/get mouse acceleration
2078
        dd      sysfn_meminfo           ; 20 = get extended memory info
2131
        dd      sysfn_meminfo           ; 20 = get extended memory info
2079
        dd      sysfn_pid_to_slot       ; 21 = get slot number for pid
2132
        dd      sysfn_pid_to_slot       ; 21 = get slot number for pid
2080
        dd      sysfn_min_rest_window   ; 22 = minimize and restore any window
2133
        dd      sysfn_min_rest_window   ; 22 = minimize and restore any window
-
 
2134
        dd      sysfn_min_windows       ; 23 = minimize all windows
-
 
2135
        dd      sysfn_set_screen_sizes  ; 24 = set screen sizes for Vesa
2081
sysfn_num = ($ - sys_system_table)/4
2136
sysfn_num = ($ - sys_system_table)/4
2082
endg
2137
endg
2083
;------------------------------------------------------------------------------
2138
;------------------------------------------------------------------------------
2084
sys_system:
2139
sys_system:
2085
        dec     ebx
2140
        dec     ebx
Line 2106... Line 2161...
2106
   shutdown_processes:
2161
   shutdown_processes:
2107
                       dd 0x0
2162
                       dd 0x0
2108
  endg
2163
  endg
2109
;------------------------------------------------------------------------------
2164
;------------------------------------------------------------------------------
2110
sysfn_terminate:        ; 18.2 = TERMINATE
2165
sysfn_terminate:        ; 18.2 = TERMINATE
-
 
2166
        push    ecx
2111
        cmp     ecx, 2
2167
        cmp     ecx, 2
2112
        jb      noprocessterminate
2168
        jb      noprocessterminate
2113
        mov     edx, [TASK_COUNT]
2169
        mov     edx, [TASK_COUNT]
2114
        cmp     ecx, edx
2170
        cmp     ecx, edx
2115
        ja      noprocessterminate
2171
        ja      noprocessterminate
2116
        mov     eax, [TASK_COUNT]
2172
        mov     eax, [TASK_COUNT]
2117
        push    ecx
-
 
2118
        shl     ecx, 5
2173
        shl     ecx, 5
2119
        mov     edx, [ecx+CURRENT_TASK+TASKDATA.pid]
2174
        mov     edx, [ecx+CURRENT_TASK+TASKDATA.pid]
2120
        add     ecx, CURRENT_TASK+TASKDATA.state
2175
        add     ecx, CURRENT_TASK+TASKDATA.state
2121
        cmp     byte [ecx], 9
2176
        cmp     byte [ecx], 9
2122
        jz      noprocessterminate
2177
        jz      noprocessterminate
Line 2133... Line 2188...
2133
        je      @f
2188
        je      @f
2134
        call    restore_default_cursor_before_killing
2189
        call    restore_default_cursor_before_killing
2135
@@:
2190
@@:
2136
        popa
2191
        popa
2137
.restore_end:
2192
.restore_end:
2138
        add     esp, 4
-
 
2139
;--------------------------------------
2193
;--------------------------------------
2140
     ;call MEM_Heap_Lock      ;guarantee that process isn't working with heap
2194
     ;call MEM_Heap_Lock      ;guarantee that process isn't working with heap
2141
        mov     [ecx], byte 3; clear possible i40's
2195
        mov     [ecx], byte 3; clear possible i40's
2142
     ;call MEM_Heap_UnLock
2196
     ;call MEM_Heap_UnLock
Line 2143... Line 2197...
2143
 
2197
 
2144
        cmp     edx, [application_table_status]; clear app table stat
2198
        cmp     edx, [application_table_status]; clear app table stat
2145
        jne     noatsc
2199
        jne     noatsc
2146
        and     [application_table_status], 0
2200
        and     [application_table_status], 0
2147
   noatsc:
2201
noatsc:
-
 
2202
noprocessterminate:
2148
   noprocessterminate:
2203
        add     esp, 4
2149
        ret
2204
        ret
2150
;------------------------------------------------------------------------------
2205
;------------------------------------------------------------------------------
2151
sysfn_terminate2:
2206
sysfn_terminate2:
2152
;lock application_table_status mutex
2207
;lock application_table_status mutex
Line 2381... Line 2436...
2381
sysfn_getfreemem:
2436
sysfn_getfreemem:
2382
        mov     eax, [pg_data.pages_free]
2437
        mov     eax, [pg_data.pages_free]
2383
        shl     eax, 2
2438
        shl     eax, 2
2384
        mov     [esp+32], eax
2439
        mov     [esp+32], eax
2385
        ret
2440
        ret
2386
 
-
 
-
 
2441
;------------------------------------------------------------------------------
2387
sysfn_getallmem:
2442
sysfn_getallmem:
2388
        mov     eax, [MEM_AMOUNT]
2443
        mov     eax, [MEM_AMOUNT]
2389
        shr     eax, 10
2444
        shr     eax, 10
2390
        mov     [esp+32], eax
2445
        mov     [esp+32], eax
2391
        ret
2446
        ret
2392
 
-
 
2393
; // Alver, 2007-22-08 // {
2447
;------------------------------------------------------------------------------
2394
sysfn_pid_to_slot:
2448
sysfn_pid_to_slot:
2395
        mov     eax, ecx
2449
        mov     eax, ecx
2396
        call    pid_to_slot
2450
        call    pid_to_slot
2397
        mov     [esp+32], eax
2451
        mov     [esp+32], eax
2398
        ret
2452
        ret
2399
 
-
 
-
 
2453
;------------------------------------------------------------------------------
2400
sysfn_min_rest_window:
2454
sysfn_min_rest_window:
2401
        pushad
2455
        pushad
2402
        mov     eax, edx ; ebx - operating
2456
        mov     eax, edx ; ebx - operating
2403
        shr     ecx, 1
2457
        shr     ecx, 1
2404
        jnc     @f
2458
        jnc     @f
Line 2425... Line 2479...
2425
        popad
2479
        popad
2426
        xor     eax, eax
2480
        xor     eax, eax
2427
        dec     eax
2481
        dec     eax
2428
        mov     [esp+32], eax
2482
        mov     [esp+32], eax
2429
        ret
2483
        ret
-
 
2484
;------------------------------------------------------------------------------
-
 
2485
sysfn_min_windows:
-
 
2486
        call    minimize_all_window
2430
; } \\ Alver, 2007-22-08 \\
2487
        mov     [esp+32], eax
-
 
2488
        call    change_task
-
 
2489
        ret
-
 
2490
;------------------------------------------------------------------------------
-
 
2491
sysfn_set_screen_sizes:
-
 
2492
        cmp     [SCR_MODE], word 0x13
-
 
2493
        jbe     .exit
-
 
2494
 
-
 
2495
        cmp     [_display.select_cursor], select_cursor
-
 
2496
        jne     .exit
-
 
2497
 
-
 
2498
        cmp     ecx, [display_width_standard]
-
 
2499
        ja      .exit
Line -... Line 2500...
-
 
2500
 
-
 
2501
        cmp     edx, [display_height_standard]
-
 
2502
        ja      .exit
-
 
2503
 
-
 
2504
        pushfd
-
 
2505
        cli
-
 
2506
        mov     eax, ecx
-
 
2507
        mov     ecx, [BytesPerScanLine]
-
 
2508
        mov     [_display.width], eax
-
 
2509
        dec     eax
-
 
2510
        mov     [_display.height], edx
-
 
2511
        dec     edx
-
 
2512
; eax - new Screen_Max_X
-
 
2513
; edx - new Screen_Max_Y
-
 
2514
        mov     [do_not_touch_winmap], 1
-
 
2515
        call    set_screen
-
 
2516
        mov     [do_not_touch_winmap], 0
-
 
2517
        popfd
-
 
2518
        call    change_task
-
 
2519
.exit:
-
 
2520
        ret
2431
 
2521
;------------------------------------------------------------------------------
2432
uglobal
-
 
2433
;// mike.dld, 2006-29-01 [
2522
uglobal
2434
screen_workarea RECT
2523
screen_workarea RECT
-
 
2524
display_width_standard dd 0
-
 
2525
display_height_standard dd 0
2435
;// mike.dld, 2006-29-01 ]
2526
do_not_touch_winmap db 0
2436
window_minimize db 0
2527
window_minimize db 0
-
 
2528
sound_flag      db 0
2437
sound_flag      db 0
2529
 
Line 2438... Line 2530...
2438
endg
2530
endg
2439
 
2531
 
2440
UID_NONE=0
2532
UID_NONE=0
Line 2446... Line 2538...
2446
  db 0,7,7,0  ; version 0.7.7.0
2538
  db 0,7,7,0  ; version 0.7.7.0
2447
  db 0
2539
  db 0
2448
  dd __REV__
2540
  dd __REV__
2449
version_end:
2541
version_end:
2450
endg
2542
endg
-
 
2543
;------------------------------------------------------------------------------
2451
 
2544
align 4
2452
sys_cachetodiskette:
2545
sys_cachetodiskette:
2453
        cmp     ebx, 1
2546
        cmp     ebx, 1
2454
        jne     .no_floppy_a_save
2547
        jne     .no_floppy_a_save
2455
        mov     [flp_number], 1
2548
        mov     [flp_number], 1
2456
        jmp     .save_image_on_floppy
2549
        jmp     .save_image_on_floppy
-
 
2550
;--------------------------------------
-
 
2551
align 4
2457
.no_floppy_a_save:
2552
.no_floppy_a_save:
2458
        cmp     ebx, 2
2553
        cmp     ebx, 2
2459
        jne     .no_floppy_b_save
2554
        jne     .no_floppy_b_save
2460
        mov     [flp_number], 2
2555
        mov     [flp_number], 2
-
 
2556
;--------------------------------------
-
 
2557
align 4
2461
.save_image_on_floppy:
2558
.save_image_on_floppy:
2462
        call    save_image
2559
        call    save_image
2463
        mov     [esp + 32], dword 0
2560
        mov     [esp + 32], dword 0
2464
        cmp     [FDC_Status], 0
2561
        cmp     [FDC_Status], 0
2465
        je      .yes_floppy_save
2562
        je      .yes_floppy_save
-
 
2563
;--------------------------------------
-
 
2564
align 4
2466
.no_floppy_b_save:
2565
.no_floppy_b_save:
2467
        mov     [esp + 32], dword 1
2566
        mov     [esp + 32], dword 1
-
 
2567
;--------------------------------------
-
 
2568
align 4
2468
.yes_floppy_save:
2569
.yes_floppy_save:
2469
        ret
2570
        ret
2470
 
-
 
-
 
2571
;------------------------------------------------------------------------------
2471
uglobal
2572
uglobal
2472
;  bgrchanged  dd  0x0
2573
;  bgrchanged  dd  0x0
2473
align 4
2574
align 4
2474
bgrlockpid dd 0
2575
bgrlockpid dd 0
2475
bgrlock db 0
2576
bgrlock db 0
2476
endg
2577
endg
-
 
2578
;------------------------------------------------------------------------------
2477
 
2579
align 4
2478
sys_background:
2580
sys_background:
2479
 
-
 
2480
        cmp     ebx, 1                     ; BACKGROUND SIZE
2581
        cmp     ebx, 1                     ; BACKGROUND SIZE
2481
        jnz     nosb1
2582
        jnz     nosb1
2482
        test    ecx, ecx
2583
        test    ecx, ecx
2483
;    cmp   ecx,0
-
 
2484
        jz      sbgrr
2584
        jz      sbgrr
-
 
2585
 
2485
        test    edx, edx
2586
        test    edx, edx
2486
;    cmp   edx,0
-
 
2487
        jz      sbgrr
2587
        jz      sbgrr
-
 
2588
;--------------------------------------
-
 
2589
align 4
2488
@@:
2590
@@:
2489
;;Maxis use atomic bts for mutexes  4.4.2009
2591
;;Maxis use atomic bts for mutexes  4.4.2009
2490
        bts     dword [bgrlock], 0
2592
        bts     dword [bgrlock], 0
2491
        jnc     @f
2593
        jnc     @f
2492
        call    change_task
2594
        call    change_task
2493
        jmp     @b
2595
        jmp     @b
-
 
2596
;--------------------------------------
-
 
2597
align 4
2494
@@:
2598
@@:
2495
        mov     [BgrDataWidth], ecx
2599
        mov     [BgrDataWidth], ecx
2496
        mov     [BgrDataHeight], edx
2600
        mov     [BgrDataHeight], edx
2497
;    mov   [bgrchanged],1
2601
;    mov   [bgrchanged],1
Line 2500... Line 2604...
2500
; return memory for old background
2604
; return memory for old background
2501
        mov     eax, [img_background]
2605
        mov     eax, [img_background]
2502
        cmp     eax, static_background_data
2606
        cmp     eax, static_background_data
2503
        jz      @f
2607
        jz      @f
2504
        stdcall kernel_free, eax
2608
        stdcall kernel_free, eax
-
 
2609
;--------------------------------------
-
 
2610
align 4
2505
@@:
2611
@@:
2506
; calculate RAW size
2612
; calculate RAW size
2507
        xor     eax, eax
2613
        xor     eax, eax
2508
        inc     eax
2614
        inc     eax
2509
        cmp     [BgrDataWidth], eax
2615
        cmp     [BgrDataWidth], eax
2510
        jae     @f
2616
        jae     @f
2511
        mov     [BgrDataWidth], eax
2617
        mov     [BgrDataWidth], eax
-
 
2618
;--------------------------------------
-
 
2619
align 4
2512
@@:
2620
@@:
2513
        cmp     [BgrDataHeight], eax
2621
        cmp     [BgrDataHeight], eax
2514
        jae     @f
2622
        jae     @f
2515
        mov     [BgrDataHeight], eax
2623
        mov     [BgrDataHeight], eax
-
 
2624
;--------------------------------------
-
 
2625
align 4
2516
@@:
2626
@@:
2517
        mov     eax, [BgrDataWidth]
2627
        mov     eax, [BgrDataWidth]
2518
        imul    eax, [BgrDataHeight]
2628
        imul    eax, [BgrDataHeight]
2519
        lea     eax, [eax*3]
2629
        lea     eax, [eax*3]
2520
; it is reserved with aligned to the boundary of 4 KB pages,
2630
; it is reserved with aligned to the boundary of 4 KB pages,
Line 2528... Line 2638...
2528
        stdcall kernel_alloc, eax
2638
        stdcall kernel_alloc, eax
2529
        test    eax, eax
2639
        test    eax, eax
2530
        jz      .memfailed
2640
        jz      .memfailed
2531
        mov     [img_background], eax
2641
        mov     [img_background], eax
2532
        jmp     .exit
2642
        jmp     .exit
-
 
2643
;--------------------------------------
-
 
2644
align 4
2533
.memfailed:
2645
.memfailed:
2534
; revert to static monotone data
2646
; revert to static monotone data
2535
        mov     [img_background], static_background_data
2647
        mov     [img_background], static_background_data
2536
        xor     eax, eax
2648
        xor     eax, eax
2537
        inc     eax
2649
        inc     eax
2538
        mov     [BgrDataWidth], eax
2650
        mov     [BgrDataWidth], eax
2539
        mov     [BgrDataHeight], eax
2651
        mov     [BgrDataHeight], eax
2540
        mov     [mem_BACKGROUND], 4
2652
        mov     [mem_BACKGROUND], 4
-
 
2653
;--------------------------------------
-
 
2654
align 4
2541
.exit:
2655
.exit:
2542
        popad
2656
        popad
2543
        mov     [bgrlock], 0
2657
        mov     [bgrlock], 0
-
 
2658
;--------------------------------------
2544
 
2659
align 4
2545
  sbgrr:
2660
sbgrr:
2546
        ret
2661
        ret
-
 
2662
;------------------------------------------------------------------------------
2547
 
2663
align 4
2548
nosb1:
2664
nosb1:
2549
 
-
 
2550
        cmp     ebx, 2                     ; SET PIXEL
2665
        cmp     ebx, 2                     ; SET PIXEL
2551
        jnz     nosb2
2666
        jnz     nosb2
Line 2552... Line 2667...
2552
 
2667
 
2553
        mov     eax, [img_background]
2668
        mov     eax, [img_background]
2554
        test    ecx, ecx
2669
        test    ecx, ecx
2555
        jz      @f
2670
        jz      @f
2556
        cmp     eax, static_background_data
2671
        cmp     eax, static_background_data
-
 
2672
        jz      .ret
-
 
2673
;--------------------------------------
2557
        jz      .ret
2674
align 4
2558
@@:
2675
@@:
2559
        mov     ebx, [mem_BACKGROUND]
2676
        mov     ebx, [mem_BACKGROUND]
2560
        add     ebx, 4095
2677
        add     ebx, 4095
2561
        and     ebx, -4096
2678
        and     ebx, -4096
Line 2566... Line 2683...
2566
        mov     ebx, [eax+ecx]
2683
        mov     ebx, [eax+ecx]
2567
        and     ebx, 0xFF000000;255*256*256*256
2684
        and     ebx, 0xFF000000;255*256*256*256
2568
        and     edx, 0x00FFFFFF;255*256*256+255*256+255
2685
        and     edx, 0x00FFFFFF;255*256*256+255*256+255
2569
        add     edx, ebx
2686
        add     edx, ebx
2570
        mov     [eax+ecx], edx
2687
        mov     [eax+ecx], edx
-
 
2688
;--------------------------------------
-
 
2689
align 4
2571
.ret:
2690
.ret:
2572
        ret
2691
        ret
-
 
2692
;------------------------------------------------------------------------------
-
 
2693
align 4
2573
nosb2:
2694
nosb2:
2574
 
-
 
2575
        cmp     ebx, 3                     ; DRAW BACKGROUND
2695
        cmp     ebx, 3                     ; DRAW BACKGROUND
2576
        jnz     nosb3
2696
        jnz     nosb3
-
 
2697
;--------------------------------------
-
 
2698
align 4
2577
draw_background_temp:
2699
draw_background_temp:
2578
;    cmp   [bgrchanged],1 ;0
-
 
2579
;    je    nosb31
-
 
2580
;draw_background_temp:
-
 
2581
;    mov   [bgrchanged],1 ;0
-
 
2582
        mov     [background_defined], 1
2700
        mov     [background_defined], 1
2583
        mov     byte[BACKGROUND_CHANGED], 1
-
 
2584
        call    force_redraw_background
2701
        call    force_redraw_background
-
 
2702
;--------------------------------------
-
 
2703
align 4
2585
   nosb31:
2704
nosb31:
2586
        ret
2705
        ret
-
 
2706
;------------------------------------------------------------------------------
-
 
2707
align 4
2587
  nosb3:
2708
nosb3:
2588
 
-
 
2589
        cmp     ebx, 4                     ; TILED / STRETCHED
2709
        cmp     ebx, 4                     ; TILED / STRETCHED
2590
        jnz     nosb4
2710
        jnz     nosb4
2591
        cmp     ecx, [BgrDrawMode]
2711
        cmp     ecx, [BgrDrawMode]
2592
        je      nosb41
2712
        je      nosb41
2593
        mov     [BgrDrawMode], ecx
2713
        mov     [BgrDrawMode], ecx
2594
;    mov   [bgrchanged],1
2714
;--------------------------------------
-
 
2715
align 4
2595
   nosb41:
2716
nosb41:
2596
        ret
2717
        ret
-
 
2718
;------------------------------------------------------------------------------
-
 
2719
align 4
2597
  nosb4:
2720
nosb4:
2598
 
-
 
2599
        cmp     ebx, 5                     ; BLOCK MOVE TO BGR
2721
        cmp     ebx, 5                     ; BLOCK MOVE TO BGR
2600
        jnz     nosb5
2722
        jnz     nosb5
2601
        cmp     [img_background], static_background_data
2723
        cmp     [img_background], static_background_data
2602
        jnz     @f
2724
        jnz     @f
2603
        test    edx, edx
2725
        test    edx, edx
2604
        jnz     .fin
2726
        jnz     .fin
2605
        cmp     esi, 4
2727
        cmp     esi, 4
2606
        ja      .fin
2728
        ja      .fin
-
 
2729
;--------------------------------------
-
 
2730
align 4
2607
  @@:
2731
@@:
2608
  ; bughere
2732
  ; bughere
2609
        mov     eax, ecx
2733
        mov     eax, ecx
2610
        mov     ebx, edx
2734
        mov     ebx, edx
2611
        add     ebx, [img_background];IMG_BACKGROUND
2735
        add     ebx, [img_background];IMG_BACKGROUND
2612
        mov     ecx, esi
2736
        mov     ecx, esi
2613
        call    memmove
2737
        call    memmove
-
 
2738
;--------------------------------------
-
 
2739
align 4
2614
  .fin:
2740
.fin:
2615
        ret
2741
        ret
-
 
2742
;------------------------------------------------------------------------------
-
 
2743
align 4
2616
  nosb5:
2744
nosb5:
2617
 
-
 
2618
        cmp     ebx, 6
2745
        cmp     ebx, 6
2619
        jnz     nosb6
2746
        jnz     nosb6
-
 
2747
;--------------------------------------
-
 
2748
align 4
2620
;;Maxis use atomic bts for mutex 4.4.2009
2749
;;Maxis use atomic bts for mutex 4.4.2009
2621
@@:
2750
@@:
2622
        bts     dword [bgrlock], 0
2751
        bts     dword [bgrlock], 0
2623
        jnc     @f
2752
        jnc     @f
2624
        call    change_task
2753
        call    change_task
2625
        jmp     @b
2754
        jmp     @b
-
 
2755
;--------------------------------------
-
 
2756
align 4
2626
@@:
2757
@@:
2627
        mov     eax, [CURRENT_TASK]
2758
        mov     eax, [CURRENT_TASK]
2628
        mov     [bgrlockpid], eax
2759
        mov     [bgrlockpid], eax
2629
        cmp     [img_background], static_background_data
2760
        cmp     [img_background], static_background_data
2630
        jz      .nomem
2761
        jz      .nomem
Line 2638... Line 2769...
2638
        mov     esi, [img_background]
2769
        mov     esi, [img_background]
2639
        shr     esi, 12
2770
        shr     esi, 12
2640
        mov     ecx, [mem_BACKGROUND]
2771
        mov     ecx, [mem_BACKGROUND]
2641
        add     ecx, 0xFFF
2772
        add     ecx, 0xFFF
2642
        shr     ecx, 12
2773
        shr     ecx, 12
-
 
2774
;--------------------------------------
-
 
2775
align 4
2643
.z:
2776
.z:
2644
        mov     eax, [page_tabs+ebx*4]
2777
        mov     eax, [page_tabs+ebx*4]
2645
        test    al, 1
2778
        test    al, 1
2646
        jz      @f
2779
        jz      @f
2647
        call    free_page
2780
        call    free_page
-
 
2781
;--------------------------------------
-
 
2782
align 4
2648
@@:
2783
@@:
2649
        mov     eax, [page_tabs+esi*4]
2784
        mov     eax, [page_tabs+esi*4]
2650
        or      al, PG_UW
2785
        or      al, PG_UW
2651
        mov     [page_tabs+ebx*4], eax
2786
        mov     [page_tabs+ebx*4], eax
2652
        mov     eax, ebx
2787
        mov     eax, ebx
Line 2654... Line 2789...
2654
        invlpg  [eax]
2789
        invlpg  [eax]
2655
        inc     ebx
2790
        inc     ebx
2656
        inc     esi
2791
        inc     esi
2657
        loop    .z
2792
        loop    .z
2658
        ret
2793
        ret
-
 
2794
;--------------------------------------
-
 
2795
align 4
2659
.nomem:
2796
.nomem:
2660
        and     [bgrlockpid], 0
2797
        and     [bgrlockpid], 0
2661
        mov     [bgrlock], 0
2798
        mov     [bgrlock], 0
-
 
2799
;------------------------------------------------------------------------------
-
 
2800
align 4
2662
nosb6:
2801
nosb6:
2663
        cmp     ebx, 7
2802
        cmp     ebx, 7
2664
        jnz     nosb7
2803
        jnz     nosb7
2665
        cmp     [bgrlock], 0
2804
        cmp     [bgrlock], 0
2666
        jz      .err
2805
        jz      .err
Line 2675... Line 2814...
2675
        jz      .err
2814
        jz      .err
2676
        jnp     .err
2815
        jnp     .err
2677
        push    eax
2816
        push    eax
2678
        shr     ecx, 12
2817
        shr     ecx, 12
2679
        dec     ecx
2818
        dec     ecx
-
 
2819
;--------------------------------------
-
 
2820
align 4
2680
@@:
2821
@@:
2681
        and     dword [page_tabs+eax*4], 0
2822
        and     dword [page_tabs+eax*4], 0
2682
        mov     edx, eax
2823
        mov     edx, eax
2683
        shl     edx, 12
2824
        shl     edx, 12
2684
        push    eax
2825
        push    eax
Line 2691... Line 2832...
2691
        stdcall user_free, ebx
2832
        stdcall user_free, ebx
2692
        mov     [esp+32], eax
2833
        mov     [esp+32], eax
2693
        and     [bgrlockpid], 0
2834
        and     [bgrlockpid], 0
2694
        mov     [bgrlock], 0
2835
        mov     [bgrlock], 0
2695
        ret
2836
        ret
-
 
2837
;--------------------------------------
-
 
2838
align 4
2696
.err:
2839
.err:
2697
        and     dword [esp+32], 0
2840
        and     dword [esp+32], 0
2698
        ret
2841
        ret
-
 
2842
;------------------------------------------------------------------------------
2699
 
2843
align 4
2700
nosb7:
2844
nosb7:
-
 
2845
        cmp     ebx, 8
-
 
2846
        jnz     nosb8
-
 
2847
 
-
 
2848
        mov     eax, [BG_Rect_X_left_right]
-
 
2849
        mov     [esp + 32], eax ; eax = [left]*65536 + [right]
-
 
2850
        mov     eax, [BG_Rect_Y_top_bottom]
-
 
2851
        mov     [esp + 20], eax ; ebx = [top]*65536 + [bottom]
2701
        ret
2852
        ret
-
 
2853
;------------------------------------------------------------------------------
-
 
2854
align 4
-
 
2855
nosb8:
-
 
2856
        cmp     ebx, 9
-
 
2857
        jnz     nosb9
-
 
2858
; ecx = [left]*65536 + [right]
-
 
2859
; edx = [top]*65536 + [bottom]
-
 
2860
        mov     eax, [Screen_Max_X]
-
 
2861
        mov     ebx, [Screen_Max_Y]
-
 
2862
; check [right]
-
 
2863
        cmp     cx, ax
-
 
2864
        ja      .exit
-
 
2865
; check [left]
-
 
2866
        ror     ecx, 16
-
 
2867
        cmp     cx, ax
-
 
2868
        ja      .exit
-
 
2869
; check [bottom]
-
 
2870
        cmp     dx, bx
-
 
2871
        ja      .exit
-
 
2872
; check [top]
-
 
2873
        ror     edx, 16
-
 
2874
        cmp     dx, bx
-
 
2875
        ja      .exit
-
 
2876
 
-
 
2877
        movzx   eax, cx  ; [left]
-
 
2878
        movzx   ebx, dx  ; [top]
-
 
2879
 
-
 
2880
        shr     ecx, 16 ; [right]
-
 
2881
        shr     edx, 16 ; [bottom]
-
 
2882
 
-
 
2883
        mov     [background_defined], 1
-
 
2884
 
-
 
2885
        mov     [draw_data+32 + RECT.left], eax
-
 
2886
        mov     [draw_data+32 + RECT.top], ebx
Line -... Line 2887...
-
 
2887
 
-
 
2888
        mov     [draw_data+32 + RECT.right], ecx
-
 
2889
        mov     [draw_data+32 + RECT.bottom], edx
-
 
2890
 
-
 
2891
        inc     byte[REDRAW_BACKGROUND]
-
 
2892
;--------------------------------------
-
 
2893
align 4
-
 
2894
.exit:
-
 
2895
        ret
-
 
2896
;------------------------------------------------------------------------------
-
 
2897
align 4
-
 
2898
nosb9:
-
 
2899
        ret
-
 
2900
;------------------------------------------------------------------------------
-
 
2901
align 4
-
 
2902
uglobal
-
 
2903
  BG_Rect_X_left_right  dd   0x0
-
 
2904
  BG_Rect_Y_top_bottom  dd   0x0
-
 
2905
endg
-
 
2906
;------------------------------------------------------------------------------
2702
 
2907
align 4
2703
force_redraw_background:
2908
force_redraw_background:
2704
        and     [draw_data+32 + RECT.left], 0
2909
        and     [draw_data+32 + RECT.left], 0
2705
        and     [draw_data+32 + RECT.top], 0
2910
        and     [draw_data+32 + RECT.top], 0
2706
        push    eax ebx
2911
        push    eax ebx
Line 2709... Line 2914...
2709
        mov     [draw_data+32 + RECT.right], eax
2914
        mov     [draw_data+32 + RECT.right], eax
2710
        mov     [draw_data+32 + RECT.bottom], ebx
2915
        mov     [draw_data+32 + RECT.bottom], ebx
2711
        pop     ebx eax
2916
        pop     ebx eax
2712
        inc     byte[REDRAW_BACKGROUND]
2917
        inc     byte[REDRAW_BACKGROUND]
2713
        ret
2918
        ret
2714
 
-
 
-
 
2919
;------------------------------------------------------------------------------
2715
align 4
2920
align 4
2716
 
-
 
2717
sys_getbackground:
2921
sys_getbackground:
2718
;    cmp   eax,1                                  ; SIZE
2922
;    cmp   eax,1                                  ; SIZE
2719
        dec     ebx
2923
        dec     ebx
2720
        jnz     nogb1
2924
        jnz     nogb1
2721
        mov     eax, [BgrDataWidth]
2925
        mov     eax, [BgrDataWidth]
2722
        shl     eax, 16
2926
        shl     eax, 16
2723
        mov     ax, [BgrDataHeight]
2927
        mov     ax, [BgrDataHeight]
2724
        mov     [esp+32], eax
2928
        mov     [esp+32], eax
2725
        ret
2929
        ret
-
 
2930
;------------------------------------------------------------------------------
2726
 
2931
align 4
2727
nogb1:
2932
nogb1:
2728
;    cmp   eax,2                                  ; PIXEL
2933
;    cmp   eax,2                                  ; PIXEL
2729
        dec     ebx
2934
        dec     ebx
2730
        jnz     nogb2
2935
        jnz     nogb2
Line 2731... Line 2936...
2731
 
2936
 
2732
        mov     eax, [img_background]
2937
        mov     eax, [img_background]
2733
        test    ecx, ecx
2938
        test    ecx, ecx
2734
        jz      @f
2939
        jz      @f
2735
        cmp     eax, static_background_data
2940
        cmp     eax, static_background_data
-
 
2941
        jz      .ret
-
 
2942
;--------------------------------------
2736
        jz      .ret
2943
align 4
2737
@@:
2944
@@:
2738
        mov     ebx, [mem_BACKGROUND]
2945
        mov     ebx, [mem_BACKGROUND]
2739
        add     ebx, 4095
2946
        add     ebx, 4095
2740
        and     ebx, -4096
2947
        and     ebx, -4096
Line 2744... Line 2951...
2744
 
2951
 
Line 2745... Line 2952...
2745
        mov     eax, [ecx+eax]
2952
        mov     eax, [ecx+eax]
2746
 
2953
 
-
 
2954
        and     eax, 0xFFFFFF
-
 
2955
        mov     [esp+32], eax
2747
        and     eax, 0xFFFFFF
2956
;--------------------------------------
2748
        mov     [esp+32], eax
2957
align 4
-
 
2958
.ret:
-
 
2959
        ret
2749
.ret:
2960
;------------------------------------------------------------------------------
Line 2750... Line 2961...
2750
        ret
2961
align 4
2751
  nogb2:
2962
nogb2:
2752
 
2963
 
2753
;    cmp   eax,4                                  ; TILED / STRETCHED
2964
;    cmp   eax,4                                  ; TILED / STRETCHED
2754
        dec     ebx
2965
        dec     ebx
-
 
2966
        dec     ebx
-
 
2967
        jnz     nogb4
2755
        dec     ebx
2968
        mov     eax, [BgrDrawMode]
2756
        jnz     nogb4
2969
;--------------------------------------
2757
        mov     eax, [BgrDrawMode]
2970
align 4
2758
  nogb4:
-
 
-
 
2971
nogb4:
2759
        mov     [esp+32], eax
2972
        mov     [esp+32], eax
2760
        ret
-
 
2761
 
2973
        ret
2762
align 4
2974
;------------------------------------------------------------------------------
2763
 
2975
align 4
2764
sys_getkey:
2976
sys_getkey:
2765
        mov     [esp + 32], dword 1
2977
        mov     [esp + 32], dword 1
Line 2780... Line 2992...
2780
        add     ecx, 2
2992
        add     ecx, 2
2781
        mov     eax, KEY_BUFF + 1
2993
        mov     eax, KEY_BUFF + 1
2782
        mov     ebx, KEY_BUFF
2994
        mov     ebx, KEY_BUFF
2783
        call    memmove
2995
        call    memmove
2784
        pop     eax
2996
        pop     eax
-
 
2997
;--------------------------------------
-
 
2998
align 4
2785
.ret_eax:
2999
.ret_eax:
2786
        mov     [esp + 32], eax
3000
        mov     [esp + 32], eax
2787
        ret
3001
        ret
-
 
3002
;--------------------------------------
-
 
3003
align 4
2788
.finish:
3004
.finish:
2789
; test hotkeys buffer
3005
; test hotkeys buffer
2790
        mov     ecx, hotkey_buffer
3006
        mov     ecx, hotkey_buffer
-
 
3007
;--------------------------------------
-
 
3008
align 4
2791
@@:
3009
@@:
2792
        cmp     [ecx], ebx
3010
        cmp     [ecx], ebx
2793
        jz      .found
3011
        jz      .found
2794
        add     ecx, 8
3012
        add     ecx, 8
2795
        cmp     ecx, hotkey_buffer + 120 * 8
3013
        cmp     ecx, hotkey_buffer + 120 * 8
2796
        jb      @b
3014
        jb      @b
2797
        ret
3015
        ret
-
 
3016
;--------------------------------------
-
 
3017
align 4
2798
.found:
3018
.found:
2799
        mov     ax, [ecx + 6]
3019
        mov     ax, [ecx + 6]
2800
        shl     eax, 16
3020
        shl     eax, 16
2801
        mov     ah, [ecx + 4]
3021
        mov     ah, [ecx + 4]
2802
        mov     al, 2
3022
        mov     al, 2
2803
        and     dword [ecx + 4], 0
3023
        and     dword [ecx + 4], 0
2804
        and     dword [ecx], 0
3024
        and     dword [ecx], 0
2805
        jmp     .ret_eax
3025
        jmp     .ret_eax
2806
 
-
 
-
 
3026
;------------------------------------------------------------------------------
2807
align 4
3027
align 4
2808
 
-
 
2809
sys_getbutton:
3028
sys_getbutton:
2810
 
-
 
2811
        mov     ebx, [CURRENT_TASK]                         ; TOP OF WINDOW STACK
3029
        mov     ebx, [CURRENT_TASK]                         ; TOP OF WINDOW STACK
2812
        mov     [esp + 32], dword 1
3030
        mov     [esp + 32], dword 1
2813
        movzx   ecx, word [WIN_STACK + ebx * 2]
3031
        movzx   ecx, word [WIN_STACK + ebx * 2]
2814
        mov     edx, [TASK_COUNT] ; less than 256 processes
3032
        mov     edx, [TASK_COUNT] ; less than 256 processes
2815
        cmp     ecx, edx
3033
        cmp     ecx, edx
Line 2819... Line 3037...
2819
        jz      .exit
3037
        jz      .exit
2820
        mov     eax, [BTN_BUFF]
3038
        mov     eax, [BTN_BUFF]
2821
        and     al, 0xFE                                    ; delete left button bit
3039
        and     al, 0xFE                                    ; delete left button bit
2822
        mov     [BTN_COUNT], byte 0
3040
        mov     [BTN_COUNT], byte 0
2823
        mov     [esp + 32], eax
3041
        mov     [esp + 32], eax
-
 
3042
;--------------------------------------
-
 
3043
align 4
2824
.exit:
3044
.exit:
2825
        ret
3045
        ret
2826
 
-
 
2827
 
-
 
-
 
3046
;------------------------------------------------------------------------------
2828
align 4
3047
align 4
2829
 
-
 
2830
sys_cpuusage:
3048
sys_cpuusage:
Line 2831... Line 3049...
2831
 
3049
 
2832
;  RETURN:
3050
;  RETURN:
2833
;
3051
;
Line 3201... Line 3419...
3201
endg
3419
endg
Line 3202... Line 3420...
3202
 
3420
 
3203
uglobal
3421
uglobal
3204
background_defined    db    0    ; diamond, 11.04.2006
3422
background_defined    db    0    ; diamond, 11.04.2006
3205
endg
-
 
-
 
3423
endg
3206
 
3424
;-----------------------------------------------------------------------------
3207
align 4
-
 
3208
; check misc
-
 
3209
 
3425
align 4
3210
checkmisc:
-
 
3211
 
3426
checkmisc:
3212
        cmp     [ctrl_alt_del], 1
3427
        cmp     [ctrl_alt_del], 1
Line 3213... Line 3428...
3213
        jne     nocpustart
3428
        jne     nocpustart
3214
 
3429
 
Line 3215... Line 3430...
3215
        mov     ebp, cpustring
3430
        mov     ebp, cpustring
-
 
3431
        call    fs_execute_from_sysdir
3216
        call    fs_execute_from_sysdir
3432
 
3217
 
3433
        mov     [ctrl_alt_del], 0
3218
        mov     [ctrl_alt_del], 0
3434
;--------------------------------------
3219
 
3435
align 4
3220
nocpustart:
3436
nocpustart:
Line 3230... Line 3446...
3230
        shl     eax, 8
3446
        shl     eax, 8
3231
        push    eax
3447
        push    eax
Line 3232... Line 3448...
3232
 
3448
 
3233
        movzx   eax, word [MOUSE_X]
3449
        movzx   eax, word [MOUSE_X]
3234
        movzx   edx, word [MOUSE_Y]
-
 
-
 
3450
        movzx   edx, word [MOUSE_Y]
3235
 
3451
;--------------------------------------
3236
align 4
3452
align 4
3237
.set_mouse_event:
3453
.set_mouse_event:
3238
        add     edi, 256
3454
        add     edi, 256
3239
        add     ebx, 32
3455
        add     ebx, 32
3240
        test    [ebx+TASKDATA.event_mask], 0x80000000
3456
        test    [ebx+TASKDATA.event_mask], 0x80000000
Line 3241... Line 3457...
3241
        jz      .pos_filter
3457
        jz      .pos_filter
3242
 
3458
 
-
 
3459
        cmp     edi, [esp]                      ; skip if filtration active
3243
        cmp     edi, [esp]                      ; skip if filtration active
3460
        jne     .skip
3244
        jne     .skip
3461
;--------------------------------------
3245
 
3462
align 4
3246
.pos_filter:
3463
.pos_filter:
Line 3247... Line 3464...
3247
        test    [ebx+TASKDATA.event_mask], 0x40000000
3464
        test    [ebx+TASKDATA.event_mask], 0x40000000
Line 3258... Line 3475...
3258
        cmp     edx, esi
3475
        cmp     edx, esi
3259
        jb      .skip
3476
        jb      .skip
3260
        add     esi, [ebx-twdw+WDATA.box.height]
3477
        add     esi, [ebx-twdw+WDATA.box.height]
3261
        cmp     edx, esi
3478
        cmp     edx, esi
3262
        ja      .skip
3479
        ja      .skip
-
 
3480
;--------------------------------------
-
 
3481
align 4
3263
.set:
3482
.set:
3264
        or      [edi+SLOT_BASE+APPDATA.event_mask], 100000b
3483
        or      [edi+SLOT_BASE+APPDATA.event_mask], 100000b  ; set event 6
-
 
3484
;--------------------------------------
-
 
3485
align 4
3265
.skip:
3486
.skip:
3266
        loop    .set_mouse_event
3487
        loop    .set_mouse_event
Line 3267... Line 3488...
3267
 
3488
 
-
 
3489
        pop     eax
3268
        pop     eax
3490
;--------------------------------------
3269
 
3491
align 4
3270
mouse_not_active:
-
 
3271
        cmp     byte[BACKGROUND_CHANGED], 0
-
 
3272
        jz      no_set_bgr_event
-
 
3273
        xor     edi, edi
-
 
3274
        mov     ecx, [TASK_COUNT]
-
 
3275
set_bgr_event:
-
 
3276
        add     edi, 256
-
 
3277
        or      [edi+SLOT_BASE+APPDATA.event_mask], 16
-
 
3278
        loop    set_bgr_event
-
 
3279
        mov     byte[BACKGROUND_CHANGED], 0
-
 
3280
no_set_bgr_event:
3492
mouse_not_active:
3281
        cmp     byte[REDRAW_BACKGROUND], 0         ; background update ?
3493
        cmp     byte[REDRAW_BACKGROUND], 0         ; background update ?
-
 
3494
        jz      nobackgr
3282
        jz      nobackgr
3495
 
3283
        cmp     [background_defined], 0
3496
        cmp     [background_defined], 0
3284
        jz      nobackgr
-
 
3285
;    mov   [draw_data+32 + RECT.left],dword 0
3497
        jz      nobackgr
3286
;    mov   [draw_data+32 + RECT.top],dword 0
3498
;--------------------------------------
3287
;    mov   eax,[Screen_Max_X]
-
 
3288
;    mov   ebx,[Screen_Max_Y]
-
 
3289
;    mov   [draw_data+32 + RECT.right],eax
-
 
3290
;    mov   [draw_data+32 + RECT.bottom],ebx
3499
align 4
-
 
3500
@@:
-
 
3501
        push    eax
-
 
3502
        mov     eax, [draw_data+32 + RECT.left]
-
 
3503
        shl     eax, 16
-
 
3504
        add     eax, [draw_data+32 + RECT.right]
-
 
3505
        mov     [BG_Rect_X_left_right], eax ; [left]*65536 + [right]
-
 
3506
 
-
 
3507
        mov     eax, [draw_data+32 + RECT.top]
-
 
3508
        shl     eax, 16
-
 
3509
        add     eax, [draw_data+32 + RECT.bottom]
-
 
3510
        mov     [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom]
-
 
3511
        pop     eax
3291
@@:
3512
 
-
 
3513
        call    drawbackground
-
 
3514
;        DEBUGF  1, "K : drawbackground\n"
-
 
3515
;        DEBUGF  1, "K : backg x %x\n",[BG_Rect_X_left_right]
-
 
3516
;        DEBUGF  1, "K : backg y %x\n",[BG_Rect_Y_top_bottom]
-
 
3517
;--------- set event 5 start ----------
3292
        call    drawbackground
3518
        push    ecx edi
3293
        xor     eax, eax
3519
        xor     edi, edi
-
 
3520
        mov     ecx, [TASK_COUNT]
-
 
3521
;--------------------------------------
-
 
3522
align 4
-
 
3523
set_bgr_event:
-
 
3524
        add     edi, 256
-
 
3525
        or      [edi+SLOT_BASE+APPDATA.event_mask], 10000b  ; set event 5
-
 
3526
        loop    set_bgr_event
-
 
3527
        pop     edi ecx
-
 
3528
; call change_task - because the application must have time to call f.15.8
-
 
3529
        call    change_task
3294
        xchg    al, [REDRAW_BACKGROUND]
3530
;--------- set event 5 stop -----------
3295
        test    al, al                             ; got new update request?
3531
        dec     byte[REDRAW_BACKGROUND]    ; got new update request?
-
 
3532
        jnz     @b
3296
        jnz     @b
3533
 
3297
        mov     [draw_data+32 + RECT.left], eax
3534
        mov     [draw_data+32 + RECT.left], eax
3298
        mov     [draw_data+32 + RECT.top], eax
3535
        mov     [draw_data+32 + RECT.top], eax
3299
        mov     [draw_data+32 + RECT.right], eax
3536
        mov     [draw_data+32 + RECT.right], eax
3300
        mov     [draw_data+32 + RECT.bottom], eax
3537
        mov     [draw_data+32 + RECT.bottom], eax
-
 
3538
        mov     [MOUSE_BACKGROUND], byte 0
3301
        mov     [MOUSE_BACKGROUND], byte 0
3539
;--------------------------------------
3302
 
3540
align 4
3303
nobackgr:
-
 
3304
 
3541
nobackgr:
3305
    ; system shutdown request
-
 
3306
 
3542
; system shutdown request
3307
        cmp     [SYS_SHUTDOWN], byte 0
3543
        cmp     [SYS_SHUTDOWN], byte 0
Line 3308... Line 3544...
3308
        je      noshutdown
3544
        je      noshutdown
Line 3313... Line 3549...
3313
        jne     no_mark_system_shutdown
3549
        jne     no_mark_system_shutdown
Line 3314... Line 3550...
3314
 
3550
 
3315
        lea     ecx, [edx-1]
3551
        lea     ecx, [edx-1]
3316
        mov     edx, OS_BASE+0x3040
3552
        mov     edx, OS_BASE+0x3040
-
 
3553
        jecxz   @f
-
 
3554
;--------------------------------------
3317
        jecxz   @f
3555
align 4
3318
markz:
3556
markz:
3319
        mov     [edx+TASKDATA.state], byte 3
3557
        mov     [edx+TASKDATA.state], byte 3
3320
        add     edx, 0x20
3558
        add     edx, 0x20
-
 
3559
        loop    markz
-
 
3560
;--------------------------------------
3321
        loop    markz
3561
align 4
3322
@@:
-
 
3323
 
3562
@@:
3324
  no_mark_system_shutdown:
-
 
3325
 
3563
no_mark_system_shutdown:
3326
        dec     byte [SYS_SHUTDOWN]
3564
        dec     byte [SYS_SHUTDOWN]
-
 
3565
        je      system_shutdown
3327
        je      system_shutdown
3566
;--------------------------------------
3328
 
3567
align 4
3329
noshutdown:
-
 
3330
 
-
 
3331
 
3568
noshutdown:
3332
        mov     eax, [TASK_COUNT]           ; termination
3569
        mov     eax, [TASK_COUNT]           ; termination
3333
        mov     ebx, TASK_DATA+TASKDATA.state
3570
        mov     ebx, TASK_DATA+TASKDATA.state
-
 
3571
        mov     esi, 1
3334
        mov     esi, 1
3572
;--------------------------------------
3335
 
3573
align 4
3336
newct:
3574
newct:
3337
        mov     cl, [ebx]
3575
        mov     cl, [ebx]
3338
        cmp     cl, byte 3
3576
        cmp     cl, byte 3
-
 
3577
        jz      terminate
3339
        jz      terminate
3578
 
3340
        cmp     cl, byte 4
3579
        cmp     cl, byte 4
Line 3341... Line 3580...
3341
        jz      terminate
3580
        jz      terminate
3342
 
3581
 
3343
        add     ebx, 0x20
3582
        add     ebx, 0x20
3344
        inc     esi
3583
        inc     esi
3345
        dec     eax
3584
        dec     eax
3346
        jnz     newct
-
 
-
 
3585
        jnz     newct
3347
        ret
3586
        ret
3348
 
-
 
3349
; redraw screen
3587
;-----------------------------------------------------------------------------
3350
 
-
 
3351
redrawscreen:
3588
align 4
Line 3352... Line 3589...
3352
 
3589
redrawscreen:
3353
; eax , if process window_data base is eax, do not set flag/limits
3590
; eax , if process window_data base is eax, do not set flag/limits
Line 3354... Line 3591...
3354
 
3591
 
3355
        pushad
3592
        pushad
Line 3356... Line 3593...
3356
        push    eax
3593
        push    eax
3357
 
3594
 
-
 
3595
;;;         mov   ebx,2
-
 
3596
;;;         call  delay_hs
3358
;;;         mov   ebx,2
3597
 
3359
;;;         call  delay_hs
-
 
3360
 
3598
         ;mov   ecx,0               ; redraw flags for apps
3361
         ;mov   ecx,0               ; redraw flags for apps
3599
        xor     ecx, ecx
Line 3362... Line 3600...
3362
        xor     ecx, ecx
3600
;--------------------------------------
3363
       newdw2:
3601
align 4
Line 3404... Line 3642...
3404
        jb      ricino
3642
        jb      ricino
Line 3405... Line 3643...
3405
 
3643
 
3406
        mov     eax, [draw_limits.left]  ; eax = area x start     ecx = window x end
3644
        mov     eax, [draw_limits.left]  ; eax = area x start     ecx = window x end
3407
        cmp     ecx, eax
3645
        cmp     ecx, eax
-
 
3646
        jb      ricino
3408
        jb      ricino
3647
;--------------------------------------
3409
 
3648
align 4
3410
        bgli:
-
 
3411
 
3649
bgli:
3412
        cmp     dword[esp], 1
3650
        cmp     dword[esp], 1
3413
        jnz     .az
-
 
3414
;         cmp   byte[BACKGROUND_CHANGED], 0
-
 
-
 
3651
        jnz     .az
3415
;         jnz   newdw8
3652
 
3416
        cmp     byte[REDRAW_BACKGROUND], 0
3653
        cmp     byte[REDRAW_BACKGROUND], 0
-
 
3654
        jz      .az
3417
        jz      .az
3655
 
3418
        mov     dl, 0
3656
        mov     dl, 0
3419
        lea     eax, [edi+draw_data-window_data]
3657
        lea     eax, [edi+draw_data-window_data]
3420
        mov     ebx, [draw_limits.left]
3658
        mov     ebx, [draw_limits.left]
3421
        cmp     ebx, [eax+RECT.left]
3659
        cmp     ebx, [eax+RECT.left]
-
 
3660
        jae     @f
3422
        jae     @f
3661
 
3423
        mov     [eax+RECT.left], ebx
3662
        mov     [eax+RECT.left], ebx
-
 
3663
        mov     dl, 1
-
 
3664
;--------------------------------------
3424
        mov     dl, 1
3665
align 4
3425
        @@:
3666
@@:
3426
        mov     ebx, [draw_limits.top]
3667
        mov     ebx, [draw_limits.top]
3427
        cmp     ebx, [eax+RECT.top]
3668
        cmp     ebx, [eax+RECT.top]
-
 
3669
        jae     @f
3428
        jae     @f
3670
 
3429
        mov     [eax+RECT.top], ebx
3671
        mov     [eax+RECT.top], ebx
-
 
3672
        mov     dl, 1
-
 
3673
;--------------------------------------
3430
        mov     dl, 1
3674
align 4
3431
        @@:
3675
@@:
3432
        mov     ebx, [draw_limits.right]
3676
        mov     ebx, [draw_limits.right]
3433
        cmp     ebx, [eax+RECT.right]
3677
        cmp     ebx, [eax+RECT.right]
-
 
3678
        jbe     @f
3434
        jbe     @f
3679
 
3435
        mov     [eax+RECT.right], ebx
3680
        mov     [eax+RECT.right], ebx
-
 
3681
        mov     dl, 1
-
 
3682
;--------------------------------------
3436
        mov     dl, 1
3683
align 4
3437
        @@:
3684
@@:
3438
        mov     ebx, [draw_limits.bottom]
3685
        mov     ebx, [draw_limits.bottom]
3439
        cmp     ebx, [eax+RECT.bottom]
3686
        cmp     ebx, [eax+RECT.bottom]
-
 
3687
        jbe     @f
3440
        jbe     @f
3688
 
3441
        mov     [eax+RECT.bottom], ebx
3689
        mov     [eax+RECT.bottom], ebx
-
 
3690
        mov     dl, 1
-
 
3691
;--------------------------------------
3442
        mov     dl, 1
3692
align 4
3443
        @@:
3693
@@:
3444
        add     byte[REDRAW_BACKGROUND], dl
3694
        add     byte[REDRAW_BACKGROUND], dl
-
 
3695
        jmp     newdw8
-
 
3696
;--------------------------------------
3445
        jmp     newdw8
3697
align 4
3446
        .az:
-
 
3447
 
3698
.az:
3448
        mov     eax, edi
3699
        mov     eax, edi
Line 3449... Line 3700...
3449
        add     eax, draw_data-window_data
3700
        add     eax, draw_data-window_data
3450
 
3701
 
Line 3460... Line 3711...
3460
        sub     eax, draw_data-window_data
3711
        sub     eax, draw_data-window_data
Line 3461... Line 3712...
3461
 
3712
 
3462
        cmp     dword [esp], 1
3713
        cmp     dword [esp], 1
3463
        jne     nobgrd
3714
        jne     nobgrd
-
 
3715
        inc     byte[REDRAW_BACKGROUND]
3464
        inc     byte[REDRAW_BACKGROUND]
3716
;--------------------------------------
3465
 
3717
align 4
3466
       newdw8:
3718
newdw8:
Line 3467... Line 3719...
3467
       nobgrd:
3719
nobgrd:
-
 
3720
 
3468
 
3721
        mov     [eax + WDATA.fl_redraw], byte 1  ; mark as redraw
3469
        mov     [eax + WDATA.fl_redraw], byte 1  ; mark as redraw
3722
;--------------------------------------
3470
 
-
 
3471
       ricino:
3723
align 4
3472
 
-
 
3473
       not_this_task:
3724
ricino:
Line 3474... Line 3725...
3474
 
3725
not_this_task:
3475
        pop     ecx
3726
        pop     ecx
Line 3476... Line 3727...
3476
 
3727
 
3477
        cmp     ecx, [TASK_COUNT]
3728
        cmp     ecx, [TASK_COUNT]
3478
        jle     newdw2
-
 
3479
 
3729
        jle     newdw2
-
 
3730
 
3480
        pop     eax
3731
        pop     eax
3481
        popad
3732
        popad
3482
 
-
 
3483
        ret
3733
        ret
3484
 
3734
;-----------------------------------------------------------------------------
3485
calculatebackground:   ; background
3735
align 4
3486
 
3736
calculatebackground:   ; background
3487
        mov     edi, [_WinMapAddress]              ; set os to use all pixels
3737
        mov     edi, [_WinMapAddress]              ; set os to use all pixels
Line 3488... Line 3738...
3488
        mov     eax, 0x01010101
3738
        mov     eax, 0x01010101
3489
        mov     ecx, [_WinMapSize]
-
 
3490
        shr     ecx, 2
-
 
3491
        rep stosd
3739
        mov     ecx, [_WinMapSize]
3492
 
-
 
-
 
3740
        shr     ecx, 2
3493
        mov     byte[REDRAW_BACKGROUND], 0            ; do not draw background!
3741
        rep stosd
3494
        mov     byte[BACKGROUND_CHANGED], 0
3742
 
3495
 
3743
        mov     byte[REDRAW_BACKGROUND], 0            ; do not draw background!
3496
        ret
-
 
3497
 
-
 
-
 
3744
        ret
3498
uglobal
3745
;-----------------------------------------------------------------------------
3499
  imax    dd 0x0
3746
uglobal
3500
endg
-
 
3501
 
-
 
3502
 
3747
  imax    dd 0x0
3503
 
3748
endg
Line 3504... Line 3749...
3504
delay_ms:     ; delay in 1/1000 sec
3749
;-----------------------------------------------------------------------------
3505
 
3750
align 4
Line 3515... Line 3760...
3515
 
3760
 
3516
        in      al, 0x61
3761
        in      al, 0x61
3517
        and     al, 0x10
3762
        and     al, 0x10
3518
        mov     ah, al
3763
        mov     ah, al
-
 
3764
        cld
3519
        cld
3765
;--------------------------------------
3520
 
3766
align 4
3521
 cnt1:
3767
cnt1:
3522
        in      al, 0x61
3768
        in      al, 0x61
3523
        and     al, 0x10
3769
        and     al, 0x10
3524
        cmp     al, ah
3770
        cmp     al, ah
Line 3527... Line 3773...
3527
        mov     ah, al
3773
        mov     ah, al
3528
        loop    cnt1
3774
        loop    cnt1
Line 3529... Line 3775...
3529
 
3775
 
3530
        pop     ecx
3776
        pop     ecx
3531
        pop     eax
-
 
3532
 
3777
        pop     eax
3533
        ret
-
 
-
 
3778
        ret
3534
 
3779
;-----------------------------------------------------------------------------
3535
align 4
3780
align 4
3536
set_app_param:
3781
set_app_param:
3537
        mov     edi, [TASK_BASE]
3782
        mov     edi, [TASK_BASE]
3538
        mov     eax, ebx
3783
        mov     eax, ebx
3539
        btr     eax, 3                           ; move MOUSE_FILTRATION
3784
        btr     eax, 3                           ; move MOUSE_FILTRATION
3540
        mov     ebx, [current_slot]              ; bit into event_filter
3785
        mov     ebx, [current_slot]              ; bit into event_filter
3541
        setc    byte [ebx+APPDATA.event_filter]
3786
        setc    byte [ebx+APPDATA.event_filter]
3542
        xchg    eax, [edi + TASKDATA.event_mask] ; set new event mask
3787
        xchg    eax, [edi + TASKDATA.event_mask] ; set new event mask
3543
        mov     [esp+32], eax                    ; return old mask value
3788
        mov     [esp+32], eax                    ; return old mask value
3544
        ret
-
 
3545
 
-
 
-
 
3789
        ret
3546
 
3790
;-----------------------------------------------------------------------------
3547
 
3791
align 4
3548
delay_hs:     ; delay in 1/100 secs
3792
delay_hs:     ; delay in 1/100 secs
3549
; ebx = delay time
3793
; ebx = delay time
3550
        push    ecx
3794
        push    ecx
Line 3551... Line 3795...
3551
        push    edx
3795
        push    edx
-
 
3796
 
3552
 
3797
        mov     edx, [timer_ticks]
3553
        mov     edx, [timer_ticks]
3798
;--------------------------------------
3554
 
3799
align 4
3555
      newtic:
3800
newtic:
3556
        mov     ecx, [timer_ticks]
3801
        mov     ecx, [timer_ticks]
3557
        sub     ecx, edx
3802
        sub     ecx, edx
Line 3558... Line 3803...
3558
        cmp     ecx, ebx
3803
        cmp     ecx, ebx
Line 3559... Line 3804...
3559
        jae     zerodelay
3804
        jae     zerodelay
-
 
3805
 
3560
 
3806
        call    change_task
3561
        call    change_task
3807
 
3562
 
3808
        jmp     newtic
3563
        jmp     newtic
3809
;--------------------------------------
3564
 
-
 
3565
      zerodelay:
3810
align 4
3566
        pop     edx
-
 
-
 
3811
zerodelay:
3567
        pop     ecx
3812
        pop     edx
3568
 
3813
        pop     ecx
3569
        ret
-
 
3570
 
3814
        ret
3571
align 16        ;very often call this subrutine
3815
;-----------------------------------------------------------------------------
3572
memmove:       ; memory move in bytes
3816
align 16        ;very often call this subrutine
3573
 
3817
memmove:       ; memory move in bytes
3574
; eax = from
3818
; eax = from
Line 3589... Line 3833...
3589
        shr     ecx, 2
3833
        shr     ecx, 2
3590
        rep movsd
3834
        rep movsd
3591
        pop     ecx
3835
        pop     ecx
3592
        and     ecx, 11b
3836
        and     ecx, 11b
3593
        jz      .finish
3837
        jz      .finish
-
 
3838
;--------------------------------------
-
 
3839
align 4
3594
  @@:
3840
@@:
3595
        rep movsb
3841
        rep movsb
-
 
3842
;--------------------------------------
3596
 
3843
align 4
3597
  .finish:
3844
.finish:
3598
        pop     ecx edi esi
3845
        pop     ecx edi esi
-
 
3846
;--------------------------------------
-
 
3847
align 4
3599
  .ret:
3848
.ret:
3600
        ret
3849
        ret
3601
 
-
 
3602
 
-
 
-
 
3850
;-----------------------------------------------------------------------------
3603
;  Sysfunction 34, read_floppy_file, is obsolete. Use 58 or 70 function instead.
3851
;  Sysfunction 34, read_floppy_file, is obsolete. Use 58 or 70 function instead.
3604
;align 4
3852
;align 4
3605
;
3853
;
3606
;read_floppy_file:
3854
;read_floppy_file:
3607
;
3855
;
Line 3936... Line 4184...
3936
        mov     esi, putimage_init8bpp
4184
        mov     esi, putimage_init8bpp
3937
        jmp     sys_putimage_bpp
4185
        jmp     sys_putimage_bpp
3938
;--------------------------------------
4186
;--------------------------------------
3939
align 4
4187
align 4
3940
@@:
4188
@@:
-
 
4189
        cmp     esi, 9
-
 
4190
        jnz     @f
-
 
4191
        mov     ebp, putimage_get9bpp
-
 
4192
        mov     esi, putimage_init9bpp
-
 
4193
        jmp     sys_putimage_bpp
-
 
4194
;--------------------------------------
-
 
4195
align 4
-
 
4196
@@:
3941
        cmp     esi, 15
4197
        cmp     esi, 15
3942
        jnz     @f
4198
        jnz     @f
3943
        mov     ebp, putimage_get15bpp
4199
        mov     ebp, putimage_get15bpp
3944
        mov     esi, putimage_init15bpp
4200
        mov     esi, putimage_init15bpp
3945
        jmp     sys_putimage_bpp
4201
        jmp     sys_putimage_bpp
Line 3996... Line 4252...
3996
;-----------------------------------------------------------------------------
4252
;-----------------------------------------------------------------------------
3997
align 4
4253
align 4
3998
putimage_init24bpp:
4254
putimage_init24bpp:
3999
        lea     eax, [eax*3]
4255
        lea     eax, [eax*3]
4000
putimage_init8bpp:
4256
putimage_init8bpp:
-
 
4257
putimage_init9bpp:
4001
        ret
4258
        ret
4002
;-----------------------------------------------------------------------------
4259
;-----------------------------------------------------------------------------
4003
align 16
4260
align 16
4004
putimage_get24bpp:
4261
putimage_get24bpp:
4005
        movzx   eax, byte [esi+2]
4262
        movzx   eax, byte [esi+2]
Line 4016... Line 4273...
4016
        mov     eax, [edx+eax*4]
4273
        mov     eax, [edx+eax*4]
4017
        pop     edx
4274
        pop     edx
4018
        inc     esi
4275
        inc     esi
4019
        ret     4
4276
        ret     4
4020
;-----------------------------------------------------------------------------
4277
;-----------------------------------------------------------------------------
-
 
4278
align 16
-
 
4279
putimage_get9bpp:
-
 
4280
        lodsb
-
 
4281
        mov     ah, al
-
 
4282
        shl     eax, 8
-
 
4283
        mov     al, ah
-
 
4284
        ret     4
-
 
4285
;-----------------------------------------------------------------------------
4021
align 4
4286
align 4
4022
putimage_init1bpp:
4287
putimage_init1bpp:
4023
        add     eax, ecx
4288
        add     eax, ecx
4024
        push    ecx
4289
        push    ecx
4025
        add     eax, 7
4290
        add     eax, 7
Line 4442... Line 4707...
4442
align 4
4707
align 4
4443
f66call:
4708
f66call:
4444
           dd sys_process_def.1   ; 1 = set keyboard mode
4709
           dd sys_process_def.1   ; 1 = set keyboard mode
4445
           dd sys_process_def.2   ; 2 = get keyboard mode
4710
           dd sys_process_def.2   ; 2 = get keyboard mode
4446
           dd sys_process_def.3   ; 3 = get keyboard ctrl, alt, shift
4711
           dd sys_process_def.3   ; 3 = get keyboard ctrl, alt, shift
4447
           dd sys_process_def.4
4712
           dd sys_process_def.4   ; 4 = set system-wide hotkey
4448
           dd sys_process_def.5
4713
           dd sys_process_def.5   ; 5 = delete installed hotkey
-
 
4714
           dd sys_process_def.6   ; 6 = disable input, work only hotkeys
-
 
4715
           dd sys_process_def.7   ; 7 = enable input, opposition to f.66.6
4449
endg
4716
endg
4450
 
-
 
4451
 
-
 
4452
 
-
 
-
 
4717
;-----------------------------------------------------------------------------
4453
 
4718
align 4
4454
sys_process_def:
4719
sys_process_def:
4455
        dec     ebx
4720
        dec     ebx
4456
        cmp     ebx, 5
4721
        cmp     ebx, 7
4457
        jae     .not_support    ;if >=6 then or eax,-1
4722
        jae     .not_support    ;if >=8 then or eax,-1
Line 4458... Line 4723...
4458
 
4723
 
4459
        mov     edi, [CURRENT_TASK]
4724
        mov     edi, [CURRENT_TASK]
Line 4460... Line 4725...
4460
        jmp     dword [f66call+ebx*4]
4725
        jmp     dword [f66call+ebx*4]
4461
 
4726
 
4462
.not_support:
4727
.not_support:
-
 
4728
        or      eax, -1
4463
        or      eax, -1
4729
        ret
4464
        ret
4730
;-----------------------------------------------------------------------------
4465
 
4731
align 4
4466
.1:
4732
.1:
Line 4467... Line 4733...
4467
        shl     edi, 8
4733
        shl     edi, 8
-
 
4734
        mov     [edi+SLOT_BASE + APPDATA.keyboard_mode], cl
4468
        mov     [edi+SLOT_BASE + APPDATA.keyboard_mode], cl
4735
 
4469
 
4736
        ret
4470
        ret
4737
;-----------------------------------------------------------------------------
4471
 
4738
align 4
4472
.2:                             ; 2 = get keyboard mode
4739
.2:                             ; 2 = get keyboard mode
4473
        shl     edi, 8
4740
        shl     edi, 8
4474
        movzx   eax, byte [SLOT_BASE+edi + APPDATA.keyboard_mode]
-
 
4475
        mov     [esp+32], eax
4741
        movzx   eax, byte [SLOT_BASE+edi + APPDATA.keyboard_mode]
4476
        ret
-
 
4477
;     xor   eax,eax
-
 
4478
;     movzx eax,byte [shift]
4742
        mov     [esp+32], eax
4479
;     movzx ebx,byte [ctrl]
-
 
4480
;     shl   ebx,2
-
 
4481
;     add   eax,ebx
-
 
4482
;     movzx ebx,byte [alt]
4743
        ret
4483
;     shl   ebx,3
-
 
4484
;     add   eax,ebx
4744
;-----------------------------------------------------------------------------
4485
.3:                             ;3 = get keyboard ctrl, alt, shift
-
 
4486
 ;// mike.dld [
4745
align 4
4487
        mov     eax, [kb_state]
4746
.3:                             ;3 = get keyboard ctrl, alt, shift
-
 
4747
        mov     eax, [kb_state]
4488
 ;// mike.dld ]
4748
        mov     [esp+32], eax
4489
        mov     [esp+32], eax
4749
        ret
4490
        ret
4750
;-----------------------------------------------------------------------------
4491
 
4751
align 4
4492
.4:
4752
.4:
4493
        mov     eax, hotkey_list
4753
        mov     eax, hotkey_list
Line 4511... Line 4771...
4511
        jecxz   @f
4771
        jecxz   @f
4512
        mov     [edx+12], eax
4772
        mov     [edx+12], eax
4513
@@:
4773
@@:
4514
        and     dword [esp+32], 0
4774
        and     dword [esp+32], 0
4515
        ret
4775
        ret
-
 
4776
;-----------------------------------------------------------------------------
4516
 
4777
align 4
4517
.5:
4778
.5:
4518
        movzx   ebx, cl
4779
        movzx   ebx, cl
4519
        lea     ebx, [hotkey_scancodes+ebx*4]
4780
        lea     ebx, [hotkey_scancodes+ebx*4]
4520
        mov     eax, [ebx]
4781
        mov     eax, [ebx]
4521
.scan:
4782
.scan:
Line 4545... Line 4806...
4545
        mov     [eax+8], edx
4806
        mov     [eax+8], edx
4546
        mov     [eax+12], edx
4807
        mov     [eax+12], edx
4547
        mov     [eax], edx
4808
        mov     [eax], edx
4548
        mov     [esp+32], edx
4809
        mov     [esp+32], edx
4549
        ret
4810
        ret
-
 
4811
;-----------------------------------------------------------------------------
-
 
4812
align 4
-
 
4813
.6:
-
 
4814
        pushfd
-
 
4815
        cli
-
 
4816
        mov     eax, [PID_lock_input]
-
 
4817
        test    eax, eax
-
 
4818
        jnz     @f
-
 
4819
; get current PID
-
 
4820
        mov     eax, [CURRENT_TASK]
-
 
4821
        shl     eax, 5
-
 
4822
        mov     eax, [eax+CURRENT_TASK+TASKDATA.pid]
-
 
4823
; set current PID for lock input
-
 
4824
        mov     [PID_lock_input], eax
-
 
4825
@@:
-
 
4826
        popfd
-
 
4827
        ret
-
 
4828
;-----------------------------------------------------------------------------
-
 
4829
align 4
-
 
4830
.7:
-
 
4831
        mov     eax, [PID_lock_input]
-
 
4832
        test    eax, eax
-
 
4833
        jz      @f
-
 
4834
; get current PID
-
 
4835
        mov     ebx, [CURRENT_TASK]
-
 
4836
        shl     ebx, 5
-
 
4837
        mov     ebx, [ebx+CURRENT_TASK+TASKDATA.pid]
-
 
4838
; compare current lock input with current PID
-
 
4839
        cmp     ebx, eax
-
 
4840
        jne     @f
Line -... Line 4841...
-
 
4841
 
-
 
4842
        xor     eax, eax
4550
 
4843
        mov     [PID_lock_input], eax
-
 
4844
@@:
-
 
4845
        ret
-
 
4846
;-----------------------------------------------------------------------------
-
 
4847
uglobal
-
 
4848
  PID_lock_input dd 0x0
4551
 
4849
endg
4552
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4850
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4553
;; 61 sys function.                                                ;;
4851
;; 61 sys function.                                                ;;
4554
;; in eax=61,ebx in [1..3]                                         ;;
4852
;; in eax=61,ebx in [1..3]                                         ;;
4555
;; out eax                                                         ;;
4853
;; out eax                                                         ;;
Line 4622... Line 4920...
4622
        add     ebp, [eax-twdw+WDATA.box.top]
4920
        add     ebp, [eax-twdw+WDATA.box.top]
4623
        add     bp, word[esi+APPDATA.wnd_clientbox.top]
4921
        add     bp, word[esi+APPDATA.wnd_clientbox.top]
4624
        pop     esi
4922
        pop     esi
4625
        add     ebx, ebp
4923
        add     ebx, ebp
4626
        mov     eax, edi
4924
        mov     eax, edi
-
 
4925
        test    ecx, 0x08000000  ; redirect the output to the user area
-
 
4926
        jnz     dtext
4627
        xor     edi, edi
4927
        xor     edi, edi
4628
        jmp     dtext
4928
        jmp     dtext
Line 4629... Line 4929...
4629
 
4929
 
Line 4734... Line 5034...
4734
        ret
5034
        ret
4735
.err:
5035
.err:
4736
        call    .free
5036
        call    .free
4737
;        pop     eax
5037
;        pop     eax
4738
        ret
5038
        ret
-
 
5039
;-----------------------------------------------------------------------------
-
 
5040
align 4
-
 
5041
syscall_getpixel_WinMap:                       ; GetPixel WinMap
-
 
5042
        cmp     ebx, [Screen_Max_X]
-
 
5043
        jbe     @f
-
 
5044
        cmp     ecx, [Screen_Max_Y]
-
 
5045
        jbe     @f
-
 
5046
        xor     eax, eax
-
 
5047
        jmp     .store
-
 
5048
;--------------------------------------
-
 
5049
align 4
4739
 
5050
@@:
-
 
5051
        mov     eax, [d_width_calc_area + ecx*4]
-
 
5052
        add     eax, [_WinMapAddress]
-
 
5053
        movzx   eax, byte[eax+ebx]        ; get value for current point
-
 
5054
;--------------------------------------
-
 
5055
align 4
-
 
5056
.store:
-
 
5057
        mov     [esp + 32], eax
-
 
5058
        ret
-
 
5059
;-----------------------------------------------------------------------------
4740
align 4
5060
align 4
4741
 
-
 
4742
syscall_getpixel:                       ; GetPixel
5061
syscall_getpixel:                       ; GetPixel
4743
        mov     ecx, [Screen_Max_X]
5062
        mov     ecx, [Screen_Max_X]
4744
        inc     ecx
5063
        inc     ecx
4745
        xor     edx, edx
5064
        xor     edx, edx
4746
        mov     eax, ebx
5065
        mov     eax, ebx
Line 4749... Line 5068...
4749
        xchg    eax, ebx
5068
        xchg    eax, ebx
4750
        and     ecx, 0xFBFFFFFF  ;negate 0x04000000 use mouseunder area
5069
        and     ecx, 0xFBFFFFFF  ;negate 0x04000000 use mouseunder area
4751
        call    dword [GETPIXEL]; eax - x, ebx - y
5070
        call    dword [GETPIXEL]; eax - x, ebx - y
4752
        mov     [esp + 32], ecx
5071
        mov     [esp + 32], ecx
4753
        ret
5072
        ret
4754
 
-
 
-
 
5073
;-----------------------------------------------------------------------------
4755
align 4
5074
align 4
4756
 
-
 
4757
syscall_getarea:
5075
syscall_getarea:
4758
;eax = 36
5076
;eax = 36
4759
;ebx = pointer to bufer for img BBGGRRBBGGRR...
5077
;ebx = pointer to bufer for img BBGGRRBBGGRR...
4760
;ecx = [size x]*65536 + [size y]
5078
;ecx = [size x]*65536 + [size y]
4761
;edx = [start x]*65536 + [start y]
5079
;edx = [start x]*65536 + [start y]
Line 4787... Line 5105...
4787
 
5105
 
4788
        add     ebp, esi
5106
        add     ebp, esi
Line 4789... Line 5107...
4789
        add     ebp, edi
5107
        add     ebp, edi
-
 
5108
 
4790
 
5109
        add     ebx, edx
4791
        add     ebx, edx
5110
;--------------------------------------
4792
 
5111
align 4
-
 
5112
.start_y:
-
 
5113
        push    ecx edx
4793
.start_y:
5114
;--------------------------------------
4794
        push    ecx edx
5115
align 4
4795
.start_x:
5116
.start_x:
Line 4796... Line 5117...
4796
        push    eax ebx ecx
5117
        push    eax ebx ecx
Line 4811... Line 5132...
4811
        dec     ebx
5132
        dec     ebx
4812
        dec     edx
5133
        dec     edx
4813
        jnz     .start_y
5134
        jnz     .start_y
4814
        popad
5135
        popad
4815
        ret
5136
        ret
-
 
5137
;-----------------------------------------------------------------------------
-
 
5138
align 4
-
 
5139
syscall_putarea_backgr:
-
 
5140
;eax = 25
-
 
5141
;ebx = pointer to bufer for img BBGGRRBBGGRR...
-
 
5142
;ecx = [size x]*65536 + [size y]
-
 
5143
;edx = [start x]*65536 + [start y]
-
 
5144
        pushad
-
 
5145
        mov     edi, ebx
-
 
5146
        mov     eax, edx
-
 
5147
        shr     eax, 16
-
 
5148
        mov     ebx, edx
-
 
5149
        and     ebx, 0xffff
-
 
5150
        dec     eax
-
 
5151
        dec     ebx
-
 
5152
; eax - x, ebx - y
-
 
5153
        mov     edx, ecx
-
 
5154
        shr     ecx, 16
-
 
5155
        and     edx, 0xffff
-
 
5156
        mov     esi, ecx
-
 
5157
; ecx - size x, edx - size y
-
 
5158
        mov     ebp, edx
-
 
5159
        dec     ebp
-
 
5160
        shl     ebp, 2
Line -... Line 5161...
-
 
5161
 
-
 
5162
        imul    ebp, esi
-
 
5163
 
-
 
5164
        mov     esi, ecx
-
 
5165
        dec     esi
-
 
5166
        shl     esi, 2
-
 
5167
 
-
 
5168
        add     ebp, esi
-
 
5169
        add     ebp, edi
-
 
5170
 
-
 
5171
        add     ebx, edx
-
 
5172
;--------------------------------------
-
 
5173
align 4
-
 
5174
.start_y:
-
 
5175
        push    ecx edx
4816
 
5176
;--------------------------------------
-
 
5177
align 4
-
 
5178
.start_x:
-
 
5179
        push    eax ecx
-
 
5180
        add     eax, ecx
-
 
5181
 
-
 
5182
        mov     ecx, [ebp]
-
 
5183
        rol     ecx, 8
-
 
5184
        test    cl, cl        ; transparensy = 0
-
 
5185
        jz      .no_put
-
 
5186
 
-
 
5187
        xor     cl, cl
-
 
5188
        ror     ecx, 8
-
 
5189
 
-
 
5190
        pushad
-
 
5191
        mov     edx, [d_width_calc_area + ebx*4]
-
 
5192
        add     edx, [_WinMapAddress]
-
 
5193
        movzx   edx, byte [eax+edx]
-
 
5194
        cmp     dl, byte 1
-
 
5195
        jne     @f
-
 
5196
 
-
 
5197
        call    dword [PUTPIXEL]; eax - x, ebx - y
-
 
5198
;--------------------------------------
-
 
5199
align 4
-
 
5200
@@:
-
 
5201
        popad
-
 
5202
;--------------------------------------
-
 
5203
align 4
-
 
5204
.no_put:
-
 
5205
        pop     ecx eax
-
 
5206
 
-
 
5207
        sub     ebp, 4
-
 
5208
        dec     ecx
-
 
5209
        jnz     .start_x
-
 
5210
 
-
 
5211
        pop     edx ecx
-
 
5212
        dec     ebx
-
 
5213
        dec     edx
Line -... Line 5214...
-
 
5214
        jnz     .start_y
-
 
5215
 
-
 
5216
        popad
-
 
5217
        ret
4817
align 4
5218
;-----------------------------------------------------------------------------
Line 4818... Line 5219...
4818
 
5219
align 4
4819
syscall_drawline:                       ; DrawLine
5220
syscall_drawline:                       ; DrawLine
4820
 
5221
 
Line 4883... Line 5284...
4883
 
5284
 
4884
        mov     [esp+36], eax
5285
        mov     [esp+36], eax
4885
        mov     [esp+24], ebx
5286
        mov     [esp+24], ebx
Line 4886... Line -...
4886
        ret
-
 
4887
 
-
 
4888
align 4
-
 
4889
 
-
 
4890
read_from_hd:                           ; Read from hd - fn not in use
-
 
4891
 
-
 
4892
        mov     edi, [TASK_BASE]
-
 
4893
        add     edi, TASKDATA.mem_start
-
 
4894
        add     eax, [edi]
-
 
4895
        add     ecx, [edi]
-
 
4896
        add     edx, [edi]
-
 
4897
        call    file_read
-
 
4898
 
-
 
4899
        mov     [esp+36], eax
-
 
4900
        mov     [esp+24], ebx
-
 
4901
 
-
 
4902
        ret
5287
        ret
4903
 
5288
 
4904
paleholder:
5289
paleholder:
4905
        ret
5290
        ret
4906
;------------------------------------------------------------------------------
5291
;------------------------------------------------------------------------------
Line 4918... Line 5303...
4918
        dec     ecx
5303
        dec     ecx
4919
        jnz     @r
5304
        jnz     @r
4920
        ret
5305
        ret
4921
;------------------------------------------------------------------------------
5306
;------------------------------------------------------------------------------
4922
align 4
5307
align 4
-
 
5308
calculate_fast_getting_offset_for_LFB:
-
 
5309
; calculate data area for fast getting offset to LFB
-
 
5310
        xor     eax, eax
-
 
5311
        mov     ecx, [_display.height]
-
 
5312
        inc     ecx
-
 
5313
        mov     edi, BPSLine_calc_area
-
 
5314
        cld
-
 
5315
@@:
-
 
5316
        stosd
-
 
5317
        add     eax, [BytesPerScanLine]
-
 
5318
        dec     ecx
-
 
5319
        jnz     @r
-
 
5320
        ret
-
 
5321
;------------------------------------------------------------------------------
-
 
5322
align 4
4923
set_screen:
5323
set_screen:
-
 
5324
; in:
-
 
5325
; eax - new Screen_Max_X
-
 
5326
; ecx - new BytesPerScanLine
-
 
5327
; edx - new Screen_Max_Y
4924
        cmp     eax, [Screen_Max_X]
5328
        cmp     eax, [Screen_Max_X]
4925
        jne     .set
5329
        jne     .set
Line 4926... Line 5330...
4926
 
5330
 
4927
        cmp     edx, [Screen_Max_Y]
5331
        cmp     edx, [Screen_Max_Y]
Line 4942... Line 5346...
4942
        push    esi
5346
        push    esi
4943
        push    edi
5347
        push    edi
Line 4944... Line 5348...
4944
 
5348
 
Line -... Line 5349...
-
 
5349
        pushad
-
 
5350
 
-
 
5351
        cmp     [do_not_touch_winmap], 1
4945
        pushad
5352
        je      @f
Line 4946... Line 5353...
4946
 
5353
 
4947
        stdcall kernel_free, [_WinMapAddress]
5354
        stdcall kernel_free, [_WinMapAddress]
4948
 
5355
 
Line 4949... Line 5356...
4949
        mov     eax, [_display.width]
5356
        mov     eax, [_display.width]
4950
        mul     [_display.height]
5357
        mul     [_display.height]
4951
        mov     [_WinMapSize], eax
5358
        mov     [_WinMapSize], eax
4952
 
5359
 
-
 
5360
        stdcall kernel_alloc, eax
-
 
5361
        mov     [_WinMapAddress], eax
-
 
5362
        test    eax, eax
Line -... Line 5363...
-
 
5363
        jz      .epic_fail
-
 
5364
; store for f.18.24
-
 
5365
        mov     eax, [_display.width]
4953
        stdcall kernel_alloc, eax
5366
        mov     [display_width_standard], eax
4954
        mov     [_WinMapAddress], eax
-
 
-
 
5367
 
-
 
5368
        mov     eax, [_display.height]
-
 
5369
        mov     [display_height_standard], eax
-
 
5370
@@:
4955
        test    eax, eax
5371
        call    calculate_fast_getting_offset_for_WinMapAddress
Line 4956... Line 5372...
4956
        jz      .epic_fail
5372
; for Qemu or non standart video cards
4957
 
5373
; Unfortunately [BytesPerScanLine] does not always
4958
        call    calculate_fast_getting_offset_for_WinMapAddress
5374
;                             equal to [_display.width] * [ScreenBPP] / 8