Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 6... Line 6...
6
;;
6
;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
version equ '0.1'
8
version equ '0.1'
9
 
9
 
Line 10... Line 10...
10
include "lang.inc"
10
include "lang.inc"
11
include "macros.inc"
11
include "..\..\..\macros.inc"
Line 12... Line 12...
12
 
12
 
Line 85... Line 85...
85
    pusha
85
    pusha
Line 86... Line 86...
86
 
86
 
87
    mov  eax,53
87
    mov  eax,53
88
    mov  ebx,6
88
    mov  ebx,6
89
    mov  ecx,[socket]
89
    mov  ecx,[socket]
Line 90... Line 90...
90
    int  0x40
90
    mcall
91
 
91
 
Line 92... Line 92...
92
    cmp  eax,[prev_state]
92
    cmp  eax,[prev_state]
Line 93... Line 93...
93
    je   no_cos
93
    je   no_cos
94
 
94
 
95
    mov  [prev_state],eax
95
    mov  [prev_state],eax
96
 
96
 
97
    mov  eax,13
97
    mov  eax,13
Line 98... Line 98...
98
    mov  ebx,435*65536+12*6
98
    mov  ebx,435*65536+12*6
99
    mov  ecx,42*65536+10
99
    mov  ecx,42*65536+10
Line 100... Line 100...
100
    mov  edx,0xffffff
100
    mov  edx,0xffffff
Line 121... Line 121...
121
 
121
 
122
    mov  eax,4
122
    mov  eax,4
123
    mov  ebx,435*65536+42
123
    mov  ebx,435*65536+42
124
    mov  ecx,0x000000
124
    mov  ecx,0x000000
125
    mov  esi,12
125
    mov  esi,12
Line 126... Line 126...
126
    int  0x40
126
    mcall
Line 127... Line 127...
127
 
127
 
Line 148... Line 148...
148
 
148
 
149
    mov  [edi],byte ' '
149
    mov  [edi],byte ' '
Line 150... Line 150...
150
    call draw_entries
150
    call draw_entries
151
 
151
 
Line 152... Line 152...
152
    mov  eax,10
152
    mov  eax,10
153
    int  0x40
153
    mcall
Line 154... Line 154...
154
 
154
 
155
    cmp  eax,2
155
    cmp  eax,2
Line 156... Line 156...
156
    jne  no_more_text
156
    jne  no_more_text
157
 
157
 
158
    mov  eax,2
158
    mov  eax,2
159
    int  0x40
159
    mcall
Line 223... Line 223...
223
    mov  eax,53
223
    mov  eax,53
224
    mov  ebx,7
224
    mov  ebx,7
225
    mov  ecx,[socket]
225
    mov  ecx,[socket]
226
    mov  edx,[grouplen]
226
    mov  edx,[grouplen]
227
    mov  esi,group
227
    mov  esi,group
228
    int  0x40
228
    mcall
229
    mov  [status],3
229
    mov  [status],3
230
    call clear_text
230
    call clear_text
231
    call save_coordinates
231
    call save_coordinates
Line 232... Line 232...
232
 
232
 
Line 318... Line 318...
318
    mov  eax,53
318
    mov  eax,53
319
    mov  ebx,7
319
    mov  ebx,7
320
    mov  ecx,[socket]
320
    mov  ecx,[socket]
321
    mov  edx,[statlen] ; -stat
321
    mov  edx,[statlen] ; -stat
322
    mov  esi,stat
322
    mov  esi,stat
323
    int  0x40
323
    mcall
324
    mov  [status],5
324
    mov  [status],5
325
    call save_coordinates
325
    call save_coordinates
326
    ret
326
    ret
327
  no_4:
327
  no_4:
Line 331... Line 331...
331
    mov  eax,53
331
    mov  eax,53
332
    mov  ebx,7
332
    mov  ebx,7
333
    mov  ecx,[socket]
333
    mov  ecx,[socket]
334
    mov  edx,articlelen-article
334
    mov  edx,articlelen-article
335
    mov  esi,article
335
    mov  esi,article
336
    int  0x40
336
    mcall
337
    mov  [status],7
337
    mov  [status],7
338
    call save_coordinates
338
    call save_coordinates
339
    ret
339
    ret
340
  no_6:
340
  no_6:
Line 483... Line 483...
483
 
483
 
Line 484... Line 484...
484
    inc  [status]
484
    inc  [status]
485
 
485
 
486
    mov  eax,5
486
    mov  eax,5
Line 487... Line 487...
487
    mov  ebx,10
487
    mov  ebx,10
Line 488... Line 488...
488
    int  0x40
488
    mcall
Line 497... Line 497...
497
 
497
 
Line 498... Line 498...
498
START:                          ; start of execution
498
START:                          ; start of execution
499
 
499
 
500
     mov  eax,40
500
     mov  eax,40
Line 501... Line 501...
501
     mov  ebx,10000111b
501
     mov  ebx,10000111b
Line 502... Line 502...
502
     int  0x40
502
     mcall
Line 510... Line 510...
510
    call state_machine_write
510
    call state_machine_write
511
    call state_machine_read
511
    call state_machine_read
Line 512... Line 512...
512
 
512
 
513
    mov  eax,23                 ; wait here for event
513
    mov  eax,23                 ; wait here for event
514
    mov  ebx,5
514
    mov  ebx,5
Line 515... Line 515...
515
    int  0x40
515
    mcall
516
 
516
 
517
    cmp  eax,1                  ; redraw request ?
517
    cmp  eax,1                  ; redraw request ?
518
    je   red
518
    je   red
Line 531... Line 531...
531
    call draw_window
531
    call draw_window
532
    jmp  still
532
    jmp  still
Line 533... Line 533...
533
 
533
 
534
  key:                          ; key
534
  key:                          ; key
535
    mov  eax,2                  ; just read it and ignore
535
    mov  eax,2                  ; just read it and ignore
Line 536... Line 536...
536
    int  0x40
536
    mcall
537
 
537
 
538
    cmp  ah,' '
538
    cmp  ah,' '
539
    jne  no_space
539
    jne  no_space
Line 579... Line 579...
579
    jmp  still
579
    jmp  still
Line 580... Line 580...
580
 
580
 
581
 
581
 
582
  button:                       ; button
582
  button:                       ; button
Line 583... Line 583...
583
    mov  eax,17                 ; get id
583
    mov  eax,17                 ; get id
Line 584... Line 584...
584
    int  0x40
584
    mcall
585
 
585
 
Line 626... Line 626...
626
 
626
 
627
    cmp  eax,14
627
    cmp  eax,14
628
    jne  no_start
628
    jne  no_start
629
    call clear_text
629
    call clear_text
630
    mov  eax,3
630
    mov  eax,3
631
    int  0x40
631
    mcall
632
    mov  ecx,eax
632
    mov  ecx,eax
633
    mov  eax,53
633
    mov  eax,53
634
    mov  ebx,5
634
    mov  ebx,5
635
    mov  edx,119
635
    mov  edx,119
636
    mov  esi,dword [server_ip]
636
    mov  esi,dword [server_ip]
637
    mov  edi,1
637
    mov  edi,1
638
    int  0x40
638
    mcall
639
    mov  [socket],eax
639
    mov  [socket],eax
640
    mov  [status],1
640
    mov  [status],1
641
    jmp  still
641
    jmp  still
Line 646... Line 646...
646
    mov  eax,53
646
    mov  eax,53
647
    mov  ebx,7
647
    mov  ebx,7
648
    mov  ecx,[socket]
648
    mov  ecx,[socket]
649
    mov  edx,quitlen-quit
649
    mov  edx,quitlen-quit
650
    mov  esi,quit
650
    mov  esi,quit
651
    int  0x40
651
    mcall
652
    mov  eax,5
652
    mov  eax,5
653
    mov  ebx,10
653
    mov  ebx,10
654
    int  0x40
654
    mcall
655
    call check_for_incoming_data
655
    call check_for_incoming_data
656
    mov  eax,53
656
    mov  eax,53
657
    mov  ebx,8
657
    mov  ebx,8
658
    mov  ecx,[socket]
658
    mov  ecx,[socket]
659
    int  0x40
659
    mcall
660
    mov  eax,5
660
    mov  eax,5
661
    mov  ebx,5
661
    mov  ebx,5
662
    int  0x40
662
    mcall
663
    mov  eax,53
663
    mov  eax,53
664
    mov  ebx,8
664
    mov  ebx,8
665
    mov  ecx,[socket]
665
    mov  ecx,[socket]
666
    int  0x40
666
    mcall
667
    mov  [status],0
667
    mov  [status],0
668
    jmp  still
668
    jmp  still
669
  no_end:
669
  no_end:
Line 670... Line 670...
670
 
670
 
671
    cmp  eax,1                   ; button id=1 ?
671
    cmp  eax,1                   ; button id=1 ?
672
    jne  noclose
672
    jne  noclose
673
    mov  eax,-1                 ; close this program
673
    mov  eax,-1                 ; close this program
674
    int  0x40
674
    mcall
Line 675... Line 675...
675
  noclose:
675
  noclose:
Line 685... Line 685...
685
  go_on:
685
  go_on:
Line 686... Line 686...
686
 
686
 
687
    mov  eax,53
687
    mov  eax,53
688
    mov  ebx,2
688
    mov  ebx,2
689
    mov  ecx,[socket]
689
    mov  ecx,[socket]
Line 690... Line 690...
690
    int  0x40
690
    mcall
691
 
691
 
Line 692... Line 692...
692
    cmp  eax,0
692
    cmp  eax,0
693
    je   ch_ret
693
    je   ch_ret
694
 
694
 
695
    mov  eax,53
695
    mov  eax,53
Line 696... Line 696...
696
    mov  ebx,3
696
    mov  ebx,3
Line 697... Line 697...
697
    mov  ecx,[socket]
697
    mov  ecx,[socket]
698
    int  0x40
698
    mcall
Line 726... Line 726...
726
  no_print:
726
  no_print:
Line 727... Line 727...
727
 
727
 
728
    mov  eax,53
728
    mov  eax,53
729
    mov  ebx,2
729
    mov  ebx,2
730
    mov  ecx,[socket]
730
    mov  ecx,[socket]
Line 731... Line 731...
731
    int  0x40
731
    mcall
732
 
732
 
Line 733... Line 733...
733
    cmp  eax,0
733
    cmp  eax,0
Line 752... Line 752...
752
 
752
 
Line 753... Line 753...
753
    mov  [prev_state],-1
753
    mov  [prev_state],-1
754
 
754
 
755
    mov  eax,12                    ; function 12:tell os about windowdraw
755
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 756... Line 756...
756
    mov  ebx,1                     ; 1, start of draw
756
    mov  ebx,1                     ; 1, start of draw
757
    int  0x40
757
    mcall
758
 
758
 
759
                                   ; DRAW WINDOW
759
                                   ; DRAW WINDOW
760
    mov  eax,0                     ; function 0 : define and draw window
760
    mov  eax,0                     ; function 0 : define and draw window
761
    mov  ebx,100*65536+520         ; [x start] *65536 + [x size]
-
 
762
    mov  ecx,5*65536+470           ; [y start] *65536 + [y size]
761
    mov  ebx,100*65536+520         ; [x start] *65536 + [x size]
763
    mov  edx,0x03ffffff            ; color of work area RRGGBB,8->color gl
762
    mov  ecx,5*65536+470           ; [y start] *65536 + [y size]
Line 764... Line 763...
764
    mov  esi,0x805080d0            ; color of grab bar  RRGGBB,8->color gl
763
    mov  edx,0x13ffffff            ; color of work area RRGGBB,8->color gl
765
    mov  edi,0x005080d0            ; color of frames    RRGGBB
764
    mov  edi,title                 ; WINDOW LABEL
766
    int  0x40
765
    mcall
767
 
766
 
768
    mov  eax,38
-
 
769
    mov  ebx,5*65536+515
767
    mov  eax,38
770
    mov  ecx,101*65536+101
-
 
771
    mov  edx,0x99bbff
768
    mov  ebx,5*65536+515
772
    int  0x40
769
    mov  ecx,101*65536+101
773
    mov  eax,38
770
    mov  edx,0x99bbff
Line 774... Line -...
774
    mov  ebx,5*65536+515
-
 
775
    mov  ecx,102*65536+102
-
 
776
    mov  edx,0x3366aa
-
 
777
    int  0x40
-
 
778
 
-
 
779
                                   ; WINDOW LABEL
-
 
780
    mov  eax,4                     ; function 4 : write text to window
-
 
Line 781... Line 771...
781
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
771
    mcall
782
    mov  ecx,0x10ddeeff            ; font 1 & color ( 0xF0RRGGBB )
772
    mov  ecx,102*65536+102
783
    mov  edx,labelt                ; pointer to text beginning
773
    mov  edx,0x3366aa
784
    mov  esi,labellen-labelt       ; text length
774
    mcall
785
    int  0x40
775
 
786
 
-
 
787
    mov  eax,8
776
 
788
    mov  ebx,238*65536+8
-
 
789
    mov  ecx,30*65536+8
777
    mov  eax,8
790
    mov  edx,11
778
    mov  ebx,238*65536+8
791
    mov  esi,0x88aadd
-
 
792
    int  0x40
779
    mov  ecx,30*65536+8
793
    mov  eax,8
-
 
794
    mov  ebx,238*65536+8
780
    mov  edx,11
795
    mov  ecx,41*65536+8
781
    mov  esi,0x88aadd
796
    mov  edx,12
782
    mcall
Line 797... Line -...
797
    int  0x40
-
 
798
    mov  eax,8
783
    mov  ecx,41*65536+8
799
    mov  ebx,238*65536+8
784
    mov  edx,12
800
    mov  ecx,52*65536+8
785
    mcall
801
    mov  edx,13
-
 
802
    int  0x40
786
    mov  ecx,52*65536+8
803
 
787
    mov  edx,13
804
    mov  eax,8
-
 
805
    mov  ebx,265*65536+75
788
    mcall
806
    mov  ecx,39*65536+13
789
 
Line 807... Line 790...
807
    mov  edx,14
790
    mov  ebx,265*65536+75
Line 808... Line 791...
808
    int  0x40
791
    mov  ecx,39*65536+13
Line 809... Line 792...
809
    mov  eax,8
792
    mov  edx,14
810
    mov  ebx,351*65536+75
793
    mcall
811
    mov  ecx,39*65536+13
794
    mov  ebx,351*65536+75
Line 812... Line 795...
812
    mov  edx,15
795
    mov  edx,15
Line 813... Line 796...
813
    int  0x40
796
    mcall
Line 831... Line 814...
831
 
814
 
832
    mov  eax,13
815
    mov  eax,13
833
    mov  ebx,30*65536+200
816
    mov  ebx,30*65536+200
834
    mov  ecx,30*65536+44
817
    mov  ecx,30*65536+44
835
    mov  edx,0xffffff
818
    mov  edx,0xffffff
Line -... Line 819...
-
 
819
    mcall
836
    int  0x40
820
 
837
 
821
    mov  eax,4
838
    mov  ebx,30*65536+31           ; draw info text with function 4
822
    mov  ebx,30*65536+31           ; draw info text with function 4
839
    mov  ecx,0x000000
823
    mov  ecx,0x000000
840
    mov  edx,text
824
    mov  edx,text
841
    mov  esi,66
-
 
842
    mov  edi,6
825
    mov  esi,66
843
 
-
 
844
  newline2:
826
    mov  edi,6
845
 
-
 
846
    mov  eax,4
827
  newline2:
847
    int  0x40
828
    mcall
848
    add  ebx,11
829
    add  ebx,11
849
    add  edx,66
830
    add  edx,66
Line 860... Line 841...
860
    pusha
841
    pusha
Line 861... Line 842...
861
 
842
 
862
    mov  eax,9
843
    mov  eax,9
863
    mov  ebx,0x70000
844
    mov  ebx,0x70000
864
    mov  ecx,-1
845
    mov  ecx,-1
Line 865... Line 846...
865
    int  0x40
846
    mcall
866
 
847
 
867
    mov  eax,[0x70000+46]
848
    mov  eax,[0x70000+46]
Line 874... Line 855...
874
    div  ebx
855
    div  ebx
875
    mov  edi,eax
856
    mov  edi,eax
876
    dec  edi
857
    dec  edi
Line 877... Line 858...
877
 
858
 
878
    mov  [space],edi
859
    mov  [space],edi
879
 
860
    mov  eax,4
880
    mov  ebx,20*65536+111           ; draw info text with function 4
861
    mov  ebx,20*65536+111           ; draw info text with function 4
881
    mov  ecx,0x000000
862
    mov  ecx,0x000000
882
    mov  edx,[text_start]
863
    mov  edx,[text_start]
883
    imul edx,80
864
    imul edx,80
884
    add  edx,nntp_text
865
    add  edx,nntp_text
885
    mov  esi,80
-
 
Line -... Line 866...
-
 
866
    mov  esi,80
886
  newline:
867
  
887
 
868
 newline:
888
    pusha
869
    pusha
889
    mov  ecx,ebx
870
    mov  ecx,ebx
890
    shl  ecx,16
871
    shl  ecx,16
891
    mov  eax,13
872
    mov  eax,13
892
    mov  ebx,20*65536+80*6
873
    mov  ebx,20*65536+80*6
893
    mov  cx,10
874
    mov  cx,10
894
    mov  edx,0xffffff
875
    mov  edx,0xffffff
Line 895... Line 876...
895
    int  0x40
876
    mcall
896
    popa
-
 
897
 
877
    popa
898
    mov  eax,4
878
 
899
    int  0x40
879
    mcall
900
    add  ebx,10
880
    add  ebx,10
Line 920... Line 900...
920
 db 'Arrow left/rigth: fetch prev/next - Arrow up/down & space: scroll '
900
 db 'Arrow left/rigth: fetch prev/next - Arrow up/down & space: scroll '
Line 921... Line 901...
921
 
901
 
Line 922... Line -...
922
textl:
-
 
923
 
902
textl:
924
 
-
 
Line 925... Line 903...
925
labelt:
903
 
Line 926... Line 904...
926
     db   'NNTP client v',version
904