Subversion Repositories Kolibri OS

Rev

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

Rev 473 Rev 527
Line 1... Line 1...
1
$Revision: 473 $
1
$Revision: 527 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;                                                              ;;
6
;;                                                              ;;
Line 767... Line 767...
767
;        popa
767
;        popa
768
;        stc
768
;        stc
769
;        ret
769
;        ret
Line 770... Line -...
770
 
-
 
771
 
-
 
772
 
-
 
773
 
-
 
774
 
-
 
775
 
770
 
776
;--------------vbe voodoo ------------------------------------------------
771
 
777
vesa20_drawbackground_tiled:
-
 
778
     call [disable_mouse]
-
 
779
     push ebp
-
 
780
     push eax
-
 
781
     push ebx
772
vesa20_drawbackground_tiled:
782
     push ecx
-
 
783
     push edx
773
        call    [disable_mouse]
784
     mov edx,dword [WinMapAddress-8] ; B
774
        pushad
785
     add edx,dword [WinMapAddress-8] ; +B
775
; External loop for all y from start to end
786
     add edx,dword [WinMapAddress-8] ; +B
776
        mov     ebx, [draw_data+32+RECT.top]    ; y start
-
 
777
dp2:
787
     push edx
778
        mov     ebp, [draw_data+32+RECT.left]   ; x start
788
     mov ebp,[draw_data+32+RECT.left] ; x start:=(x+Xwin)
779
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
789
     mov ebx,[draw_data+32+RECT.top] ; y start:=(y+Ywin)
780
;                       and LFB data (output for our function) [edi]
790
     mov eax,[BytesPerScanLine]
781
        mov     eax, [BytesPerScanLine]
791
     mul ebx
782
        mul     ebx
792
     xchg ebp, eax  ; BytesPerScanLine*(Ywin+y)
783
        xchg    ebp, eax
793
     add ebp, eax   ; +X
784
        add     ebp, eax
794
     add ebp, eax   ; +X
785
        add     ebp, eax
795
     add ebp, eax   ; +X
786
        add     ebp, eax
796
     cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
787
        cmp     [ScreenBPP], byte 24    ; 24 or 32 bpp ? - x size
797
     jz @f
788
        jz      @f
798
     add ebp,eax ; +X
789
        add     ebp, eax
799
@@:
790
@@:
800
     add ebp,[LFBAddress]  ; +LFB
791
        add     ebp, [LFBAddress]
801
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
-
 
802
     call calculate_edi
-
 
803
dp3:                             ; MAIN LOOP
-
 
804
     cmp [edi+WinMapAddress],byte 1 ; ptrBuffer^<>byte(1)
-
 
805
     jne nbgp
-
 
806
     push eax
-
 
807
     push ebx
-
 
808
     mov ecx,dword [WinMapAddress-8]    ; B
-
 
809
     xor edx,edx                   ; edx:=0
-
 
810
     div ecx                       ; Xstart/B
-
 
811
; eax=Int(qn) edx:=Rem
-
 
812
     lea esi,[edx+edx*2]           ; esi:=edx*3
-
 
813
     mov ecx,dword [WinMapAddress-4]    ; ecx:=H
-
 
814
     mov eax,[esp+0]               ; eax:=Ystart
-
 
815
     xor edx,edx                   ;
-
 
816
     div ecx                       ; Ystart/H
-
 
817
     mov eax,edx                   ; eax:=Rem
-
 
818
     xor edx,edx                   ;
-
 
819
     mov ebx,[esp+8]               ; ebx:=B*3
-
 
820
     mul ebx                       ;
-
 
821
     add esi,eax                   ;
-
 
822
;     mov eax,[esi+IMG_BACKGROUND]
-
 
823
     mov  eax,[img_background]
-
 
824
     mov  eax,[esi+eax]
792
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
-
 
793
        call    calculate_edi
-
 
794
        xchg    edi, ebp
825
     and eax,0xffffff
795
; Now eax=x, ebx=y, edi->output, ebp=offset in WinMapAddress
826
     xchg edi, ebp
796
; 2) Calculate offset in background memory block
827
     stosw
797
        push    eax
828
     shr eax,16
798
        xor     edx, edx
829
     stosb
799
        mov     eax, ebx
-
 
800
        mov     ecx, [BgrDataHeight]
830
     xchg ebp, edi                 ; ebp+=3
801
        div     ecx             ; edx := y mod BgrDataHeight
831
     cmp [ScreenBPP],byte 24       ; 24 or 32 bpp ? - x size
802
        sub     ecx, edx        ; ecx := BgrDataHeight - (y mod BgrDataHeight)
832
     jz @f
803
        pop     eax
-
 
804
        push    eax
833
     inc ebp ; +1
805
        mov     esi, edx
-
 
806
        imul    esi, [BgrDataWidth]             ; esi := (y mod BgrDataHeight) * BgrDataWidth
-
 
807
        xor     edx, edx
834
@@:
808
        div     dword [BgrDataWidth]            ; edx := x mod BgrDataWidth
-
 
809
        add     esi, edx        ; esi := (y mod BgrDataHeight)*BgrDataWidth + (x mod BgrDataWidth)
-
 
810
        pop     eax
-
 
811
        lea     esi, [esi*3]
-
 
812
        add     esi, [img_background]
-
 
813
        xor     edx, edx
-
 
814
        inc     edx
-
 
815
; 3) Loop through redraw rectangle and copy background data
-
 
816
; Registers meaning:
-
 
817
; eax = x, ebx = y (screen coordinates)
-
 
818
; ecx = deltax - number of pixels left in current tile block
-
 
819
; edx = 1
-
 
820
; esi -> bgr memory, edi -> output
-
 
821
; ebp = offset in WinMapAddress
-
 
822
dp3:
-
 
823
        cmp     [ebp+WinMapAddress], dl
835
     pop ebx
824
        jnz     nbgp
-
 
825
        movsb
-
 
826
        movsb
836
     pop eax
827
        movsb
837
     jmp hook1
828
        jmp     @f
838
nbgp:
-
 
839
     add ebp,3                     ; +3
-
 
840
     cmp [ScreenBPP],byte 24       ; 24 or 32 bpp ? - x size
829
nbgp:
841
     jz  @f
830
        add     esi, 3
842
     inc ebp ; +1
-
 
843
@@:
831
        add     edi, 3
844
hook1:
832
@@:
-
 
833
        cmp     [ScreenBPP], byte 25    ; 24 or 32 bpp?
-
 
834
        sbb     edi, -1         ; +1 for 32 bpp
845
     inc edi                       ; ptrBuffer++
835
; I do not use 'inc eax' because this is slightly slower then 'add eax,1'
846
     add esi,3                     ; ptrImage+=3
836
        add     ebp, edx
-
 
837
        add     eax, edx
-
 
838
        cmp     eax, [draw_data+32+RECT.right]
847
     inc eax
839
        ja      dp4
-
 
840
        sub     ecx, edx
848
     cmp eax,[draw_data+32+RECT.right]         ; X > xend?
841
        jnz     dp3
-
 
842
; next tile block on x-axis
-
 
843
        mov     ecx, [BgrDataWidth]
-
 
844
        sub     esi, ecx
-
 
845
        sub     esi, ecx
-
 
846
        sub     esi, ecx
-
 
847
        jmp     dp3
849
     jle dp3
848
dp4:
850
     mov ebp,[draw_data+32+RECT.left]
-
 
851
     inc ebx
-
 
852
     mov  eax,[BytesPerScanLine]
-
 
853
     mul  ebx
-
 
854
     xchg ebp, eax                 ; BytesPerScanLine*(Ywin+y)
-
 
855
     add  ebp, eax                 ; +X
-
 
856
     add  ebp, eax                 ; +X=X*2
-
 
857
     add  ebp, eax                 ; +X=X*3
-
 
858
     cmp  [ScreenBPP],byte 24      ; 24 or 32 bpp ? - x size
-
 
859
     jz   @f
-
 
860
     add  ebp,eax                  ; +X=X*4
-
 
861
@@:
-
 
862
     add ebp,[LFBAddress]          ; +LFB
-
 
863
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
849
; next scan line
864
     call calculate_edi
850
        inc     ebx
865
     cmp ebx,[draw_data+32+RECT.bottom]
-
 
866
     jle dp3
851
        cmp     ebx, [draw_data+32+RECT.bottom]
867
     add esp,4
-
 
868
     pop edx
-
 
869
     pop ecx
-
 
870
     pop ebx
-
 
871
     pop eax
852
        jbe     dp2
872
     pop ebp
853
        popad
873
     mov     [EGA_counter],1
854
        mov     [EGA_counter], 1
Line 874... Line 855...
874
     call  VGA_drawbackground
855
        call    VGA_drawbackground
Line 875... Line 856...
875
     ret
856
        ret
876
 
857
 
877
; ----------
858
; ----------
-
 
859
 
-
 
860
 
-
 
861
vesa20_drawbackground_stretch:
-
 
862
        call    [disable_mouse]
-
 
863
        pushad
-
 
864
; Helper variables
-
 
865
        mov     eax, [BgrDataWidth]
-
 
866
        xor     edx, edx
-
 
867
        mov     ecx, [ScreenWidth]
-
 
868
        inc     ecx
-
 
869
        div     ecx
-
 
870
        push    eax     ; quo
-
 
871
        push    edx     ; rem
878
 
872
        mov     eax, [BgrDataHeight]
879
 
-
 
880
vesa20_drawbackground_stretch:
-
 
881
     call  [disable_mouse]
873
        xor     edx, edx
882
     push ebp
874
        mov     ecx, [ScreenHeight]
883
     push eax
875
        inc     ecx
884
     push ebx
876
        div     ecx
885
     push ecx
-
 
886
     push edx
877
        push    eax
887
     mov edx,dword [WinMapAddress-8] ; B
878
        push    edx
888
     add edx,dword [WinMapAddress-8] ; +B
879
; External loop for all y from start to end
889
     add edx,dword [WinMapAddress-8] ; +B
880
        mov     ebx, [draw_data+32+RECT.top]    ; y start
890
     push edx
881
        mov     ebp, [draw_data+32+RECT.left]   ; x start
891
     mov ebp,[draw_data+32+RECT.left] ; x start:=(x+Xwin)
882
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
892
     mov ebx,[draw_data+32+RECT.top] ; y start:=(y+Ywin)
883
;                       and LFB data (output for our function) [edi]
893
     mov eax,[BytesPerScanLine]
884
        mov     eax, [BytesPerScanLine]
894
     mul ebx
885
        mul     ebx
895
     xchg ebp, eax  ; BytesPerScanLine*(Ywin+y)
886
        xchg    ebp, eax
896
     add ebp, eax   ; +X
887
        add     ebp, eax
897
     add ebp, eax   ; +X
888
        add     ebp, eax
898
     add ebp, eax   ; +X
889
        add     ebp, eax
899
     cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
890
        cmp     [ScreenBPP], byte 24    ; 24 or 32 bpp ? - x size
900
     jz  @f
891
        jz      @f
901
     add ebp,eax ; +X
-
 
902
@@:
892
        add     ebp, eax
903
     add ebp,[LFBAddress] ; +LFB
893
@@:
904
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
-
 
905
     call calculate_edi
-
 
906
 
894
        add     ebp, [LFBAddress]
907
sdp3: ; MAIN LOOP
-
 
908
     cmp [edi+WinMapAddress],byte 1 ; ptrBuffer^<>byte(1)
-
 
909
     jne snbgp
-
 
910
     push eax
-
 
911
     push ebx
-
 
912
     mov eax,dword [WinMapAddress-8]
-
 
913
     imul eax, [esp+4] ;4
-
 
914
     xor edx,edx
-
 
915
     mov ebx,[ScreenWidth]
-
 
916
     div ebx
-
 
917
     mov cx,dx
-
 
918
     lea esi,[eax+eax*2]
-
 
919
     mov eax,dword [WinMapAddress-4]
-
 
920
     imul eax, [esp+0] ;0
-
 
921
     xor edx,edx
-
 
922
     mov ebx,[ScreenHeight]
-
 
923
     div ebx
-
 
924
     shl ecx,16
-
 
925
     mov cx,dx
-
 
926
     imul eax, [esp+8] ;8
-
 
927
     add esi,eax
-
 
928
;     mov eax,[esi+IMG_BACKGROUND]
-
 
929
     mov  eax,[img_background]
-
 
930
 
-
 
931
     push eax
-
 
932
     mov  eax,[display_data-4]
-
 
933
     imul eax,[display_data-8]
-
 
934
     imul eax,3
-
 
935
     sub  eax,3
-
 
936
     cmp  eax,esi
-
 
937
     pop  eax
-
 
938
     jbe  @f
-
 
939
 
-
 
940
     mov  eax,[esi+eax]
-
 
941
@@:
-
 
942
     push eax
-
 
943
     ror ecx,16
-
 
944
     xor eax,eax
-
 
945
     mov ax,cx
-
 
946
     shl eax,1 ; óìíîæåíèå íà 2
-
 
947
     lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
-
 
948
     xor edx,edx
-
 
949
     mov ebx,[ScreenWidth]
-
 
950
     div ebx
895
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
951
     cmp eax,5
-
 
952
     pop eax
-
 
953
     jb @f
-
 
954
;     mov ebx,[esi+IMG_BACKGROUND+3]
-
 
955
     mov  ebx,[img_background]
-
 
956
 
-
 
957
     push eax
-
 
958
     mov  eax,[display_data-4]
-
 
959
     imul eax,[display_data-8]
-
 
960
     imul eax,3
-
 
961
     sub  eax,3
-
 
962
     cmp  eax,esi
-
 
963
     pop  eax
-
 
964
     jbe  @f
-
 
965
 
896
        call    calculate_edi
966
     mov  ebx,[esi+ebx+3]
-
 
967
 
897
        xchg    edi, ebp
968
     call overlapping_of_points
-
 
969
@@:
898
; Now eax=x, ebx=y, edi->output, ebp=offset in WinMapAddress
970
     push eax
899
        push    ebx
971
     ror ecx,16
900
; 2) Calculate offset in background memory block
972
     xor eax,eax
901
        push    eax
973
     mov ax,cx
902
        mov     eax, ebx
974
     shl eax,1 ; óìíîæåíèå íà 2
903
        mul     dword [BgrDataHeight]
975
     lea eax,[eax+eax*4] ; óìíîæåíèå íà
904
        mov     ecx, [ScreenHeight]
976
     xor edx,edx
-
 
977
     mov ebx,[ScreenHeight]
-
 
978
     div ebx
-
 
979
     cmp eax,5
905
        inc     ecx
980
     pop eax
906
        div     ecx             ; eax := y * BgrDataHeight / ScreenHeight
981
     jb @f
-
 
982
     mov ebx,[display_data-8]
907
                                ; edx := (y * BgrDataHeight) mod ScreenHeight
983
     shl ebx,1
908
        mov     esi, eax
984
     add ebx,[display_data-8]
909
        pop     eax
985
     add ebx,[img_background]   ;IMG_BACKGROUND
910
        push    edx             ; dword [esp] = (y * BgrDataHeight) mod ScreenHeight
986
 
911
                                ; dword [esp+4] = y * BgrDataHeight / ScreenHeight
987
     push eax
912
        push    eax
-
 
913
        mov     ecx, [BgrDataWidth]
988
     mov  eax,[display_data-4]
914
        mul     ecx
-
 
915
        imul    esi, ecx
-
 
916
        dec     ecx
-
 
917
        push    ecx
-
 
918
        mov     ecx, [ScreenWidth]
-
 
919
        inc     ecx
-
 
920
        div     ecx             ; eax := x * BgrDataWidth / ScreenWidth
-
 
921
                                ; edx := (x * BgrDataWidth) mod ScreenWidth
-
 
922
        add     esi, eax
-
 
923
        lea     esi, [esi*3]
-
 
924
        add     esi, [img_background]
-
 
925
        push    ecx edx esi
-
 
926
; 3) Loop through redraw rectangle and copy background data
-
 
927
; Registers meaning:
-
 
928
; ecx = (x * BgrDataWidth) / ScreenWidth
-
 
929
; edx = (x * BgrDataWidth) mod ScreenWidth (used to fast recalculating of ecx,esi)
-
 
930
; esi -> bgr memory, edi -> output
-
 
931
; ebp = offset in WinMapAddress
-
 
932
; dword [esp] = saved esi
-
 
933
; dword [esp+4] = saved edx
-
 
934
; dword [esp+8] = saved ecx
-
 
935
; dword [esp+12] = limit for overlapping of points
-
 
936
; dword [esp+16] = x
-
 
937
; dword [esp+20] = (y * BgrDataHeight) mod ScreenHeight (used to fast recalculating of esi)
-
 
938
; dword [esp+24] = y
989
     imul eax,[display_data-8]
939
; precalculated constants:
-
 
940
; dword [esp+28] = BgrDataHeight mod ScreenHeight
-
 
941
; dword [esp+32] = BgrDataHeight div ScreenHeight
-
 
942
; dword [esp+36] = BgrDataWidth mod ScreenWidth
-
 
943
; dword [esp+40] = BgrDataWidth div ScreenWidth
990
     imul eax,3
944
sdp3:
-
 
945
        cmp     [ebp+WinMapAddress], byte 1
-
 
946
        jnz     snbgp
991
     cmp  eax,esi
947
        mov     al, [esi+2]
-
 
948
        shl     eax, 16
992
     pop  eax
949
        mov     ax, [esi]
993
     jbe  @f
950
        cmp     ecx, [esp+12]
994
 
-
 
995
     add ebx,esi
951
        jae     @f
996
     mov ebx,[ebx]
-
 
997
     call overlapping_of_points
952
        mov     ebx, [esi+2]
-
 
953
        shr     ebx, 8
-
 
954
        call    overlapping_of_points
-
 
955
@@:
-
 
956
        mov     [edi], ax
-
 
957
        shr     eax, 16
-
 
958
        mov     [edi+2], al
-
 
959
snbgp:
-
 
960
        cmp     [ScreenBPP], byte 25
-
 
961
        sbb     edi, -4
-
 
962
        add     ebp, 1
-
 
963
        mov     eax, [esp+16]
-
 
964
        add     eax, 1
-
 
965
        mov     [esp+16], eax
-
 
966
        cmp     eax, [draw_data+32+RECT.right]
-
 
967
        ja      sdp4
-
 
968
        mov     eax, [esp+40]
-
 
969
        add     ecx, eax
-
 
970
        lea     eax, [eax*3]
-
 
971
        add     esi, eax
-
 
972
        add     edx, [esp+36]
-
 
973
        cmp     edx, [ScreenWidth]
-
 
974
        jbe     sdp3
-
 
975
        sub     edx, [ScreenWidth]
998
@@:
976
        add     ecx, 1
-
 
977
        add     esi, 3
-
 
978
        sub     edx, 1
-
 
979
        jmp     sdp3
-
 
980
sdp4:
-
 
981
; next y
-
 
982
        mov     ebx, [esp+24]
-
 
983
        add     ebx, 1
-
 
984
        mov     [esp+24], ebx
-
 
985
        cmp     ebx, [draw_data+32+RECT.bottom]
999
     and eax,0xffffff
986
        ja      sdpdone
-
 
987
; advance edi, ebp to next scan line
-
 
988
        sub     eax, [draw_data+32+RECT.left]
-
 
989
        sub     ebp, eax
1000
     xchg edi, ebp
990
        add     ebp, [ScreenWidth]
1001
     stosw
991
        add     ebp, 1
1002
     shr eax,16
992
        sub     edi, eax
1003
     stosb
993
        sub     edi, eax
-
 
994
        sub     edi, eax
-
 
995
        cmp     [ScreenBPP], byte 24
-
 
996
        jz      @f
-
 
997
        sub     edi, eax
-
 
998
@@:
-
 
999
        add     edi, [BytesPerScanLine]
-
 
1000
; restore ecx,edx; advance esi to next background line
-
 
1001
        pop     esi edx ecx
-
 
1002
        push    ecx edx
-
 
1003
        xor     ebx, ebx
-
 
1004
        mov     eax, [esp+20-4]
-
 
1005
        add     eax, [esp+28-4]
-
 
1006
        cmp     eax, [ScreenHeight]
-
 
1007
        jbe     @f
-
 
1008
        sub     eax, [ScreenHeight]
-
 
1009
        mov     ebx, 1
-
 
1010
        sub     eax, ebx
-
 
1011
@@:
1004
     xchg ebp, edi ; ebp+=3
1012
        mov     [esp+20-4], eax
-
 
1013
        add     ebx, [esp+32-4]
-
 
1014
        lea     ebx, [ebx*3]
-
 
1015
        imul    ebx, [BgrDataWidth]
-
 
1016
        add     esi, ebx
-
 
1017
        push    esi
1005
     cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
1018
        mov     eax, [draw_data+32+RECT.left]
-
 
1019
        mov     [esp+16], eax
-
 
1020
        jmp     sdp3
1006
     jz @f
1021
sdpdone:
Line 1007... Line 1022...
1007
     inc ebp ; +1
1022
        add     esp, 44
1008
@@:
1023
        popad
1009
     pop ebx
1024
        mov     [EGA_counter],1
1010
     pop eax
1025
        call    VGA_drawbackground
1011
     jmp shook1
-
 
1012
 
1026
        ret
1013
overlapping_of_points:
-
 
1014
     push ecx edi
1027
 
1015
     mov ecx,eax
1028
overlapping_of_points:
1016
     mov edx,ebx
1029
        push    ecx edx edi
1017
     xor eax,eax
-
 
1018
     mov al,cl
1030
        mov     ecx, eax
1019
     xor ebx,ebx
-
 
1020
     mov bl,dl
1031
        mov     edx, ebx
1021
     add eax,ebx
-
 
1022
     rcr eax,1
1032
        movzx   eax, cl
1023
     xor edi,edi
1033
        movzx   ebx, dl
1024
     mov di,ax
1034
        add     eax, ebx
1025
     xor eax,eax
1035
        rcr     eax, 1
1026
     mov al,ch
1036
        movzx   edi, ax
1027
     xor ebx,ebx
1037
        movzx   eax, ch
1028
     mov bl,dh
1038
        movzx   ebx, dh
1029
     add eax,ebx
-
 
1030
     rcr eax,1
1039
        add     eax, ebx
1031
     ror edi,8
-
 
1032
     add edi,eax
1040
        rcr     eax, 1
1033
     ror ecx,8
1041
        ror     edi, 8
1034
     ror edx,8
1042
        add     edi, eax
1035
     xor eax,eax
1043
        shr     ecx, 8
1036
     mov al,ch
1044
        shr     edx, 8
1037
     xor ebx,ebx
1045
        movzx   eax, ch
1038
     mov bl,dh
1046
        movzx   ebx, dh
1039
     add eax,ebx
-
 
1040
     rcr eax,1
-
 
1041
     ror edi,8
-
 
1042
     add eax,edi
-
 
1043
     ror eax,16
-
 
1044
     pop edi ecx
-
 
1045
     ret
-
 
1046
 
-
 
1047
snbgp:
-
 
1048
     add  ebp,3                     ; +3
-
 
1049
     cmp [ScreenBPP],byte 24        ; 24 or 32 bpp ? - x size
-
 
1050
     jz  @f
-
 
1051
     inc ebp ; +1
-
 
1052
@@:
-
 
1053
 
-
 
1054
shook1:
-
 
1055
     inc edi                       ; ptrBuffer++
-
 
1056
     add esi,3                     ; ptrImage+=3
-
 
1057
     inc eax
-
 
1058
     cmp eax,[draw_data+32+RECT.right]         ; X > xend?
-
 
1059
     jle sdp3
-
 
1060
;     jbe sdp3
-
 
1061
 
-
 
1062
     mov ebp,[draw_data+32+RECT.left]
-
 
1063
 
-
 
1064
     inc ebx
-
 
1065
 
-
 
1066
     mov  eax,[BytesPerScanLine]
-
 
1067
     mul  ebx
-
 
1068
     xchg ebp, eax                 ; BytesPerScanLine*(Ywin+y)
-
 
1069
     add  ebp, eax                 ; +X
-
 
1070
     add  ebp, eax                 ; +X=X*2
-
 
1071
     add  ebp, eax                 ; +X=X*3
-
 
1072
     cmp  [ScreenBPP],byte 24      ; 24 or 32 bpp ? - x size
-
 
1073
     jz   @f
-
 
1074
     add  ebp,eax                  ; +X=X*4
-
 
1075
@@:
-
 
1076
     add ebp,[LFBAddress]          ; +LFB
-
 
1077
 
-
 
1078
     ; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
-
 
1079
 
-
 
1080
     call calculate_edi
-
 
1081
 
-
 
1082
;     cmp ebx,[ScreenHeight]
-
 
1083
;     ja  @f
-
 
1084
 
-
 
1085
     cmp ebx,[draw_data+32+RECT.bottom]
-
 
1086
     jle sdp3
-
 
1087
;     jbe sdp3
-
 
1088
@@:
-
 
1089
     add esp,4
-
 
1090
 
-
 
1091
     pop edx
-
 
1092
     pop ecx
1047
        add     eax, ebx