Subversion Repositories Kolibri OS

Rev

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

Rev 551 Rev 556
Line 7... Line 7...
7
;;                                                   ;;
7
;;                                                   ;;
8
;;    Compile with FASM for Menuet                   ;;
8
;;    Compile with FASM for Menuet                   ;;
9
;;                                                   ;;
9
;;                                                   ;;
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 11... Line 11...
11
 
11
 
Line 12... Line 12...
12
version equ '0.5'
12
version equ '0.51'
13
 
13
 
Line 30... Line 30...
30
include "..\..\..\macros.inc"
30
include "..\..\..\macros.inc"
31
;include "fdo.inc"
31
;include "fdo.inc"
32
include "eth.inc"
32
include "eth.inc"
33
;include "lang.inc"
33
;include "lang.inc"
Line 34... Line 34...
34
 
34
 
Line 35... Line 35...
35
irc_server_ip	db	83,149,74,246		  ;server: kolibrios.org
35
irc_server_name db      'kolibrios.org',0                 ; default server name
36
 
36
 
Line 37... Line 37...
37
user_nick	dd	12				        ; length
37
user_nick	dd	12				  ; length
Line 57... Line 57...
57
    imul eax,11
57
    imul eax,11
58
    mov  [pos],eax
58
    mov  [pos],eax
Line 59... Line 59...
59
 
59
 
60
    mov  ebp,0
60
    mov  ebp,0
-
 
61
    mov  edx,I_END
-
 
62
 
61
    mov  edx,I_END
63
redraw: 			; redraw
Line 62... Line 64...
62
    call draw_window		; at first, draw the window
64
    call draw_window		; at first, draw the window
Line 63... Line 65...
63
 
65
 
Line 99... Line 101...
99
    call print_channel_list
101
    call print_channel_list
100
  nopri:
102
  nopri:
Line 101... Line 103...
101
 
103
 
Line 102... Line -...
102
    jmp  still
-
 
103
 
-
 
104
 
-
 
105
redraw: 			; redraw
-
 
106
 
-
 
107
    call draw_window
-
 
108
    jmp  still
-
 
109
 
104
    jmp  still
Line 110... Line 105...
110
 
105
 
111
button: 			; button
106
button: 			; button
Line 112... Line 107...
112
 
107
 
113
    mov  eax,17 		; get id
108
    mov  eax,17 		; get id
114
    mcall
109
    mcall
115
 
110
 
116
    cmp  ah,1			; close program
111
    cmp  ah,1			; close program
Line 117... Line 112...
117
    jne  noclose
112
    jne  noclose
Line 170... Line 165...
170
    cmp  ah,22	     ; open socket
165
    cmp  ah,22	     ; open socket
171
    jnz  tst3
166
    jnz  tst3
172
    mov  eax,3
167
    mov  eax,3
173
    mcall
168
    mcall
174
    mov  ecx,eax
169
    mov  ecx,eax
-
 
170
 
-
 
171
pusha
-
 
172
    mov     eax,irc_server_name
-
 
173
    resolve irc_server_name,dword[irc_server_ip]
-
 
174
    ;DEBUGF 1,'%u.%u.%u.%u\n',1[irc_server_ip],1[irc_server_ip+1],1[irc_server_ip+2],1[irc_server_ip+3]
-
 
175
popa
-
 
176
 
175
    mov  eax,53
177
    mov  eax,53
176
    mov  ebx,5
178
    mov  ebx,5
177
    mov  edx,6667
179
    mov  edx,6667
178
    mov  esi,dword [irc_server_ip]
180
    mov  esi,dword [irc_server_ip]
179
    mov  edi,1
181
    mov  edi,1
Line 606... Line 608...
606
  no_set_real_name:
608
  no_set_real_name:
Line 607... Line 609...
607
 
609
 
608
    cmp  [send_string+1],dword 'aser'
610
    cmp  [send_string+1],dword 'aser'
Line 609... Line -...
609
    jne  no_set_server
-
 
610
 
-
 
611
;    pusha
-
 
612
;    mov   edi,irc_server_ip
-
 
613
;    mov   esi,send_string+7
-
 
614
;    mov   eax,0
-
 
615
;    mov   edx,[xpos]
-
 
616
;    add   edx,send_string-1
-
 
617
;  newsip:
-
 
618
;    cmp   [esi],byte '.'
-
 
619
;    je    sipn
-
 
620
;    cmp   esi,edx
-
 
621
;    jg    sipn
-
 
622
;    movzx ebx,byte [esi]
-
 
623
;    inc   esi
-
 
624
;    imul  eax,10
-
 
625
;    sub   ebx,48
-
 
626
;    add   eax,ebx
-
 
627
;    jmp   newsip
-
 
628
;  sipn:
-
 
629
;    mov   [edi],al
-
 
630
;    xor   eax,eax
-
 
631
;    inc   esi
-
 
632
;    cmp   esi,send_string+30
-
 
633
;    jg    sipnn
-
 
634
;    inc   edi
-
 
635
;    cmp   edi,irc_server_ip+3
-
 
636
;    jbe   newsip
-
 
637
;  sipnn:
-
 
638
;    popa
611
    jne  no_set_server
639
 
612
 
640
pusha
613
pusha
641
    mov     eax,send_string
614
    mov     eax,send_string
642
    add     eax,[xpos]
615
    add     eax,[xpos]
Line 1660... Line 1633...
1660
    ret
1633
    ret
Line 1661... Line 1634...
1661
 
1634
 
1662
 
1635
 
1663
cp1251_table:
1636
cp1251_table:
1664
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; 8
1637
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; 8
1665
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; 9
1638
  db '?','?','?','?','?',$F9,'?','?' , '?','?','?','?','?','?','?','?' ; 9
1666
  db '?','?','?','?','?','?','?','?' , $F0,'?','?','?','?','?','?','?' ; A
1639
  db '?',$F6,$F7,'?',$FD,'?','?','?' , $F0,'?',$F2,'?','?','?','?',$F4 ; A
1667
  db '?','?','?','?','?','?','?','?' , $F1,'?','?','?','?','?','?','?' ; B
1640
  db $F8,'?','?','?','?','?','?',$FA , $F1,$FC,$F3,'?','?','?','?',$F5 ; B
1668
  db $80,$81,$82,$83,$84,$85,$86,$87 , $88,$89,$8A,$8B,$8C,$8D,$8E,$8F ; C
1641
  db $80,$81,$82,$83,$84,$85,$86,$87 , $88,$89,$8A,$8B,$8C,$8D,$8E,$8F ; C
1669
  db $90,$91,$92,$93,$94,$95,$96,$97 , $98,$99,$9A,$9B,$9C,$9D,$9E,$9F ; D
1642
  db $90,$91,$92,$93,$94,$95,$96,$97 , $98,$99,$9A,$9B,$9C,$9D,$9E,$9F ; D
-
 
1643
  db $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF ; E
1670
  db $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF ; E
1644
  db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; F
Line 1671... Line 1645...
1671
  db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; F
1645
 
1672
;    0   1   2   3   4   5   6   7     8   9   A   B   C   D   E   F
1646
;    0   1   2   3   4   5   6   7     8   9   A   B   C   D   E   F
1673
 
1647
 
1674
cp866_table:
1648
cp866_table:
1675
  db $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 , $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF ; 8
1649
  db $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 , $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF ; 8
1676
  db $D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7 , $D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF ; 9
1650
  db $D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7 , $D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF ; 9
1677
  db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; A
1651
  db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; A
1678
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; B
1652
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; B
1679
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; C
1653
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; C
-
 
1654
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; D
1680
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; D
1655
  db $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF ; E
Line 1681... Line 1656...
1681
  db $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF ; E
1656
  db $A8,$B8,$AA,$BA,$AF,$BF,$A1,$A2 , $B0,$95,$B7,'?',$B9,$A4,'?','?' ; F
Line 1682... Line 1657...
1682
  db $A8,$B8,'?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; F
1657
 
Line 1776... Line 1751...
1776
draw_data:
1751
draw_data:
Line 1777... Line 1752...
1777
 
1752
 
Line 1778... Line 1753...
1778
    pusha
1753
    pusha
1779
 
-
 
1780
    and  ebx,0xff
-
 
1781
 
-
 
1782
    cmp  bl,0xe4   ; finnish a
-
 
1783
    jne  noe4
-
 
1784
    mov  bl,0xc1
-
 
1785
  noe4:
-
 
1786
    cmp  bl,0xc4   ; ?
-
 
1787
    jne  noc4
-
 
1788
    mov  bl,0xc9
-
 
1789
  noc4:
-
 
1790
 
-
 
1791
    cmp  ebx,229   ; swedish a
-
 
1792
    jne  no_swedish_a
-
 
1793
    mov  bl,192
-
 
1794
  no_swedish_a:
1754
 
1795
 
1755
    and  ebx,0xff
Line 1796... Line 1756...
1796
    add  eax,[text_start]
1756
    add  eax,[text_start]
1797
    mov  [eax],bl
1757
    mov  [eax],bl
Line 1915... Line 1875...
1915
 
1875
 
Line 1916... Line 1876...
1916
 
1876
 
1917
text:
1877
text:
1918
 
1878
 
1919
db '   Real name : KolibriOS User  - change with eg /areal Jill User      '
1879
db '   Real name : KolibriOS User  - change with eg /areal Jill User      '
1920
db '   Nick      : KolibriOS User  - change with eg /anick Jill           '
1880
db '   Nick      : kolibri_user    - change with eg /anick Jill           '
1921
db '   Server    : kolibrios.org   - change with eg /aserv irc.by         '
1881
db '   Server    : kolibrios.org   - change with eg /aserv irc.by         '
1922
db '                                                                      '
1882
db '                                                                      '
1923
db '        1) Open socket         2) Send userinfo       Close socket    '
1883
db '        1) Open socket         2) Send userinfo       Close socket    '
1924
db '                                                                      '
1884
db '                                                                      '
1925
db '   Commands after established connection:                             '
1885
db '   Commands after established connection:                             '
1926
db '                                                                      '
1886
db '                                                                      '
1927
db '   /join #ChannelName         - eg /join #general                     '
1887
db '   /join #ChannelName         - eg /join #general                     '
1928
db '   /part #ChannelName         - eg /part #windows                     '
-
 
1929
db '   /query Nickname            - eg /query Mary                        '
1888
db '   /part #ChannelName         - eg /part #windows                     '
Line 2213... Line 2172...
2213
    mov  ebx,1
2172
    mov  ebx,1
2214
    mcall
2173
    mcall
Line 2215... Line 2174...
2215
 
2174
 
2216
    mov  ebx,ebp		   ; draw window
2175
    mov  ebx,ebp		   ; draw window
2217
    shl  ebx,16+4
2176
    shl  ebx,16+4
2218
    mov  eax,0
2177
    xor  eax,eax
2219
    mov  ecx,ebx
2178
    mov  ecx,ebx
2220
    mov  bx,499
2179
    mov  bx,499
Line 2221... Line -...
2221
    mov  cx,170
-
 
2222
 
-
 
2223
;    mov  edx,ebp                   ; draw window
-
 
2224
;    imul edx,120*80
-
 
2225
;    add  edx,I_END+120*60+8
-
 
2226
;    movzx edx,byte [edx]
-
 
2227
;    imul edx,88
-
 
2228
;    sub  bx,dx
2180
    mov  cx,170
2229
 
2181
 
2230
    mov  edx,[wcolor]
2182
    mov  edx,[wcolor]
2231
    add  edx,0x03ffffff
2183
    add  edx,0x03ffffff
Line 2378... Line 2330...
2378
labelc	    db	'AIRC - WINDOW X: #xxx                 '
2330
labelc	    db	'AIRC - WINDOW X: #xxx                 '
2379
title	    db	'IRC client ',version,0
2331
title	    db	'IRC client ',version,0
Line 2380... Line 2332...
2380
 
2332
 
Line -... Line 2333...
-
 
2333
;include_debug_strings  ; ALWAYS present in data section
-
 
2334
 
2381
;include_debug_strings  ; ALWAYS present in data section
2335
irc_server_ip db ?  ; bufer for server_IP
Line 2382... Line 2336...
2382
 
2336
 
2383
dnsMsg:  rb 512     ; buffer used by DNS client
2337
dnsMsg:  rb 512     ; buffer used by DNS client
Line 2399... Line 2353...
2399
;;  120*61+255  ,  1        length of entry text
2353
;;  120*61+255  ,  1        length of entry text
2400
;;  120*69+248  ,  4        display names from n:th name
2354
;;  120*69+248  ,  4        display names from n:th name
2401
;;  120*69+252  ,  4        length of names string
2355
;;  120*69+252  ,  4        length of names string
2402
;;  120*70      ,  1200     names separated with space
2356
;;  120*70      ,  1200     names separated with space
2403
;;
2357
;;
2404
I_END: ;;
2358
I_END: