Fresh IDE . Check-in [bb87024e2e]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed small bug in uconfig.asm; The procedure _BlendPixel has been moved to the OS independent graphics/images.asm; The graphics/draw.asm procedure now is fully OS independent;
Timelines: family | ancestors | descendants | both | FreshLibDev
Files: files | file ages | folders
SHA1:bb87024e2ef2b8c4b3c5a06f40971e2b3d77c04c
User & Date: johnfound 2017-04-13 15:19:28
Context
2017-04-13
15:20
Work on TAsmEdit; check-in: 4012ccb660 user: johnfound tags: FreshLibDev
15:19
Fixed small bug in uconfig.asm; The procedure _BlendPixel has been moved to the OS independent graphics/images.asm; The graphics/draw.asm procedure now is fully OS independent; check-in: bb87024e2e user: johnfound tags: FreshLibDev
15:15
Added SocketShutDown function in network.asm; Implemented for Win32 and Linux; FileExists function has been implemented as OS dependent for Linux and Win32 in order to make it much faster. Now it uses sys_newstat and GetFileAttributes insead of open attempt; check-in: f98c983f15 user: johnfound tags: FreshLibDev
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to freshlib/data/uconfig.asm.

282
283
284
285
286
287
288

289
290
291
292
293
294
295

.finish:
        pop     edx ecx ebx
        return

.error:
        DebugMsg "CfgGetStr open file error!"

        jmp      .finish

endp



;___________________________________________________________________







>







282
283
284
285
286
287
288
289
290
291
292
293
294
295
296

.finish:
        pop     edx ecx ebx
        return

.error:
        DebugMsg "CfgGetStr open file error!"
        stc
        jmp      .finish

endp



;___________________________________________________________________

Changes to freshlib/graphics/Linux/text.asm.

889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961

.bpp_const db 0, 1, 8, 2, 4, 24, 8, 32

endp



; the colors must be pre-multiplied ARGB.

proc _BlendPixel, .dstColor, .srcColor
begin
        pushad

        movzx   ecx, byte [.srcColor+3]      ; As
        mov     ebx, $ff
        mov     esi, ebx

        sub     ebx, ecx                     ; 1 - As

        movzx   eax, byte [.dstColor+3]      ; Ad
        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX+3], al


        movzx   eax, byte [.dstColor]       ; Bd
        movzx   ecx, byte [.srcColor]       ; Bs

        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX], al



        movzx   eax, byte [.dstColor+1]       ; Gd
        movzx   ecx, byte [.srcColor+1]       ; Gs

        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX+1], al



        movzx   eax, byte [.dstColor+2]       ; Rd
        movzx   ecx, byte [.srcColor+2]       ; Rs

        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX+2], al


        popad
        return
endp










<

<
<
<

<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
889
890
891
892
893
894
895

896



897



898

























































.bpp_const db 0, 1, 8, 2, 4, 24, 8, 32

endp





































































Changes to freshlib/graphics/draw.asm.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
;
;  Dependencies:
;
;  Notes: This file contains OS independent part and includes OS dependent files.
;_________________________________________________________________________________________
module "Draw library"


;include "%TargetOS%/draw.asm"



proc DrawSolidRect, .pDstImage, .x, .y, .width, .height, .color
.drect RECT
.rect  RECT
begin
        pushad







<
<
<







9
10
11
12
13
14
15



16
17
18
19
20
21
22
;
;  Dependencies:
;
;  Notes: This file contains OS independent part and includes OS dependent files.
;_________________________________________________________________________________________
module "Draw library"






proc DrawSolidRect, .pDstImage, .x, .y, .width, .height, .color
.drect RECT
.rect  RECT
begin
        pushad

Changes to freshlib/graphics/images.asm.

474
475
476
477
478
479
480
481

482



483



484


























































485
486
487
;
;.finish:
;        emms
;        popad
;        return
;endp






































































include '%TargetOS%/images.asm'

endmodule








>

>
>
>

>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
;
;.finish:
;        emms
;        popad
;        return
;endp


; the colors must be pre-multiplied ARGB.

proc _BlendPixel, .dstColor, .srcColor
begin
        pushad

        movzx   ecx, byte [.srcColor+3]      ; As
        mov     ebx, $ff
        mov     esi, ebx

        sub     ebx, ecx                     ; 1 - As

        movzx   eax, byte [.dstColor+3]      ; Ad
        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX+3], al


        movzx   eax, byte [.dstColor]       ; Bd
        movzx   ecx, byte [.srcColor]       ; Bs

        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX], al



        movzx   eax, byte [.dstColor+1]       ; Gd
        movzx   ecx, byte [.srcColor+1]       ; Gs

        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX+1], al



        movzx   eax, byte [.dstColor+2]       ; Rd
        movzx   ecx, byte [.srcColor+2]       ; Rs

        imul    ecx, esi
        mul     ebx
        add     eax, ecx
        adc     edx, 0
        div     esi

        mov     byte [esp+4*regEAX+2], al


        popad
        return
endp





include '%TargetOS%/images.asm'

endmodule