Subversion Repositories Kolibri OS

Rev

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

Rev 5908 Rev 5913
Line 141... Line 141...
141
 
141
 
142
  last_x dd -1
142
  last_x dd -1
Line 143... Line 143...
143
  last_y dd -1
143
  last_y dd -1
144
 
144
 
145
if DEBUG eq 1
145
if DEBUG eq 1
Line 146... Line 146...
146
    std_param db "/sys/example.asm", 0
146
    std_param db "~/sys/example.asm", 0
147
end if
147
end if
148
 
148
 
Line 427... Line 427...
427
    imul    ebx, eax, 32
427
    imul    ebx, eax, 32
428
    add     ebx, list
428
    add     ebx, list
Line 429... Line 429...
429
 
429
 
Line -... Line 430...
-
 
430
    pop     eax
-
 
431
 
-
 
432
    mov     edi, 0
-
 
433
    mov     esi, [list.size]
-
 
434
 .search:
430
    pop     eax
435
    shl     esi, 5
431
 
436
    add     esi, list
Line 432... Line 437...
432
  @@:
437
 @@:
433
    cmpe    byte [ebx], 0, @f
438
    cmpe    ebx, esi, @f
434
 
439
 
435
    movzx   edx, byte [ebx]
440
    movzx   edx, byte [ebx]
Line 442... Line 447...
442
 .next:
447
 .next:
443
    inc     ecx
448
    inc     ecx
444
    add     ebx, 32
449
    add     ebx, 32
445
    jmp     @b
450
    jmp     @b
446
  @@:
451
  @@:
-
 
452
    cmpe    edi, 1, update
-
 
453
    mov     ebx, list
-
 
454
    mov     ecx, 0
-
 
455
    mov     edi, 1
-
 
456
    push    eax
-
 
457
    stdcall get_index
-
 
458
    mov     esi, eax
-
 
459
    pop     eax
447
    jmp     update
460
    jmp     .search
Line 448... Line 461...
448
 
461
 
449
 .toggle_cb:
462
 .toggle_cb:
450
    mov     eax, [cb_always.flags]
463
    mov     eax, [cb_always.flags]
451
    mov     ebx, eax
464
    mov     ebx, eax
Line 481... Line 494...
481
 
494
 
482
;; [X, Y] -> INDEX
495
;; [X, Y] -> INDEX
Line 483... Line 496...
483
    stdcall get_index
496
    stdcall get_index
-
 
497
 
-
 
498
;; CHANGE INDEX
-
 
499
 .check_p2:
-
 
500
    cmpne   esi, 2, .check_m2
-
 
501
    mov     ebx, [list.size]
-
 
502
    dec     ebx
-
 
503
    sub     ebx, eax
-
 
504
    cmpg    ebx, 1, .add
-
 
505
    jmp     .check
-
 
506
 
-
 
507
 .check_m2:
-
 
508
    cmpne   esi, -2, .add
-
 
509
    cmpg    eax, 1, .add
-
 
510
    jmp     .check
484
 
511
 
Line -... Line 512...
-
 
512
 .add:
485
;; CHANGE INDEX
513
    add     eax, esi
486
    add     eax, esi
514
 
487
 
515
 .check:
488
    cmpl    eax, [list.size], @f
516
    cmpl    eax, [list.size], @f
Line 869... Line 897...
869
    mov     [last_y], eax
897
    mov     [last_y], eax
Line 870... Line 898...
870
 
898
 
Line 871... Line 899...
871
    mov     eax, 0
899
    mov     eax, 0
-
 
900
 
-
 
901
    cmpl    [last_y], 0xFFFF, @f
-
 
902
    mov     ebx, 0xFFFFFFFF shr 1
872
 
903
    sub     ebx, [last_y]
873
    cmpl    [last_y], 0xFFFF, @f
904
    inc     ebx
-
 
905
    mov     [last_y], 0
874
    mov     [last_y], 0
906
    ;dec     [sb_apps.position]
875
    dec     [sb_apps.position]
907
    sub     [sb_apps.position], ebx
876
    mov     eax, 1
908
    mov     eax, 1
Line 877... Line 909...
877
    jmp     .exit
909
    jmp     .exit
Line 903... Line 935...
903
    cmpe    ebx, -1, .exit
935
    cmpe    ebx, -1, .exit
Line 904... Line 936...
904
 
936
 
905
    mov     ebx, [list.size]
937
    mov     ebx, [list.size]
906
    shl     ebx, 5
938
    shl     ebx, 5
907
    add     ebx, list
939
    add     ebx, list
908
    stdcall string.compare, [_sec], assoc_ini.sec
940
    stdcall string.cmp, [_sec], assoc_ini.sec
909
    cmpe    eax, 1, @f
941
    cmpe    eax, 0, @f
910
    stdcall string.copy, [_sec], ebx
942
    stdcall string.copy, [_sec], ebx
911
    invoke  libini.get_num, [_file], [_sec], assoc_ini.icon, 0
943
    invoke  libini.get_num, [_file], [_sec], assoc_ini.icon, 0
912
    mov     ecx, [list.size]
944
    mov     ecx, [list.size]
913
    shl     ecx, 2
945
    shl     ecx, 2
Line 921... Line 953...
921
 endp
953
 endp
Line 922... Line 954...
922
 
954
 
Line 923... Line 955...
923
 ;----------------------
955
 ;----------------------
-
 
956
 
-
 
957
 proc sort_list
-
 
958
    mov     eax, list
-
 
959
    mov     ebx, list.lowercased
-
 
960
  @@:
-
 
961
    stdcall string.copy, eax, ebx
-
 
962
    stdcall string.to_lower_case, ebx
-
 
963
    add     eax, 32
-
 
964
    add     ebx, 32
924
 
965
    cmpne   byte [eax], 0, @b
925
 proc sort_list
966
 
926
    mov     edi, 0
967
    mov     edi, 0
927
    mov     ebx, list		 ;; i = 0
968
    mov     ebx, list.lowercased ;; i = 0
928
    imul    ecx, [list.size], 32 ;; i < n - 1
969
    imul    ecx, [list.size], 32 ;; i < n - 1
Line 929... Line 970...
929
    sub     ecx, 32
970
    sub     ecx, 32
930
    add     ecx, list
971
    add     ecx, list.lowercased
931
 
972
 
932
 .loop1:
973
 .loop1:
933
    mov     edx, list		 ;; j = 0
974
    mov     edx, list.lowercased ;; j = 0
934
    mov     esi, [list.size]	 ;; j < n - i - 1
975
    mov     esi, [list.size]	 ;; j < n - i - 1
935
    sub     esi, edi
976
    sub     esi, edi
936
    dec     esi
977
    dec     esi
937
    imul    esi, 32
978
    imul    esi, 32
938
    add     esi, list
979
    add     esi, list.lowercased
939
 .loop2:
980
 .loop2:
940
    mov     eax, edx
981
    mov     eax, edx
941
    add     eax, 32
982
    add     eax, 32
942
    stdcall string.cmp, edx, eax, 32
983
    stdcall string.cmp, edx, eax, 32
943
    cmpne   eax, 1, .next2
984
    cmpne   eax, 1, .next2
944
;; swap names
985
;; swap names lw
945
    mov     eax, edx
986
    mov     eax, edx
946
    add     eax, 32
987
    add     eax, 32
-
 
988
    stdcall string.copy, edx, buffer7
-
 
989
    stdcall string.copy, eax, edx
-
 
990
    stdcall string.copy, buffer7, eax
-
 
991
;; swap names
-
 
992
    mov     eax, edx
-
 
993
    sub     eax, 256 * 32 - 32
-
 
994
    sub     edx, 256 * 32
-
 
995
    stdcall string.copy, edx, buffer7
947
    stdcall string.copy, edx, buffer7
996
    stdcall string.copy, eax, edx
948
    stdcall string.copy, eax, edx
997
    stdcall string.copy, buffer7, eax
949
    stdcall string.copy, buffer7, eax
998
    add     edx, 256 * 32
950
;; swap icons
999
;; swap icons
951
    mov     eax, edx
1000
    mov     eax, edx
952
    sub     eax, list
1001
    sub     eax, list.lowercased
953
    shr     eax, 3
1002
    shr     eax, 3
954
    add     eax, list.icon
1003
    add     eax, list.icon
Line 975... Line 1024...
975
 
1024
 
Line 976... Line 1025...
976
 ;===============================
1025
 ;===============================
977
 
1026
 
-
 
1027
 skin system_colors
978
 skin system_colors
1028
 list rb 32 * 256
979
 list rb 32 * 256
1029
  .lowercased rd 32 * 256
980
  .icon rd 256
1030
  .icon rd 256
981
  .size rd 1
1031
  .size rd 1
982
 img  rd 1
1032
 img  rd 1