Subversion Repositories Kolibri OS

Rev

Rev 551 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 551 Rev 556
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                   ;;
2
;;                                                   ;;
3
;;    IRC CLIENT for MenuetOS                        ;;
3
;;    IRC CLIENT for MenuetOS                        ;;
4
;;                                                   ;;
4
;;                                                   ;;
5
;;    License: GPL / See file COPYING for details    ;;
5
;;    License: GPL / See file COPYING for details    ;;
6
;;    Copyright 2004 (c) Ville Turjanmaa             ;;
6
;;    Copyright 2004 (c) Ville Turjanmaa             ;;
7
;;                                                   ;;
7
;;                                                   ;;
8
;;    Compile with FASM for Menuet                   ;;
8
;;    Compile with FASM for Menuet                   ;;
9
;;                                                   ;;
9
;;                                                   ;;
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11
 
11
 
12
version equ '0.5'
12
version equ '0.51'
13
 
13
 
14
 
14
 
15
;__DEBUG__ equ 1
15
;__DEBUG__ equ 1
16
;__DEBUG_LEVEL__ equ 1
16
;__DEBUG_LEVEL__ equ 1
17
 
17
 
18
use32
18
use32
19
 
19
 
20
		org	0x0
20
		org	0x0
21
 
21
 
22
		db	'MENUET01'		; 8 byte id
22
		db	'MENUET01'		; 8 byte id
23
		dd	0x01			; required os
23
		dd	0x01			; required os
24
		dd	START			; program start
24
		dd	START			; program start
25
		dd	I_END			; program image size
25
		dd	I_END			; program image size
26
		dd	0x100000		; required amount of memory
26
		dd	0x100000		; required amount of memory
27
		dd	0x100000
27
		dd	0x100000
28
		dd	0,0
28
		dd	0,0
29
 
29
 
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"
34
 
34
 
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
 
37
user_nick	dd	12				        ; length
37
user_nick	dd	12				  ; length
38
		db	'kolibri_user           '	  ; string
38
		db	'kolibri_user           '	  ; string
39
 
39
 
40
user_real_name	dd	14				  ; length
40
user_real_name	dd	14				  ; length
41
		db	'KolibriOS User         '	  ; string
41
		db	'KolibriOS User         '	  ; string
42
 
42
 
43
 
43
 
44
START:				; start of execution
44
START:				; start of execution
45
 
45
 
46
    mov  eax,40
46
    mov  eax,40
47
    mov  ebx,10000111b
47
    mov  ebx,10000111b
48
    mcall
48
    mcall
49
 
49
 
50
    mov  edi,I_END
50
    mov  edi,I_END
51
    mov  ecx,60*120
51
    mov  ecx,60*120
52
    mov  eax,32
52
    mov  eax,32
53
    cld
53
    cld
54
    rep  stosb
54
    rep  stosb
55
 
55
 
56
    mov  eax,[rxs]
56
    mov  eax,[rxs]
57
    imul eax,11
57
    imul eax,11
58
    mov  [pos],eax
58
    mov  [pos],eax
59
 
59
 
60
    mov  ebp,0
60
    mov  ebp,0
61
    mov  edx,I_END
61
    mov  edx,I_END
-
 
62
 
-
 
63
redraw: 			; redraw
62
    call draw_window		; at first, draw the window
64
    call draw_window		; at first, draw the window
63
 
65
 
64
still:
66
still:
65
 
67
 
66
    inc  [cursor_on_off]
68
    inc  [cursor_on_off]
67
 
69
 
68
    mov  eax,5
70
    mov  eax,5
69
    mov  ebx,1
71
    mov  ebx,1
70
    mcall
72
    mcall
71
 
73
 
72
    mov  eax,11 		; wait here for event
74
    mov  eax,11 		; wait here for event
73
    mcall
75
    mcall
74
 
76
 
75
    call print_status
77
    call print_status
76
 
78
 
77
    cmp  eax,1			; redraw
79
    cmp  eax,1			; redraw
78
    je	 redraw
80
    je	 redraw
79
    cmp  eax,2			; key
81
    cmp  eax,2			; key
80
    je	 main_window_key
82
    je	 main_window_key
81
    cmp  eax,3			; button
83
    cmp  eax,3			; button
82
    je	 button
84
    je	 button
83
 
85
 
84
    cmp  [I_END+120*60],byte 1
86
    cmp  [I_END+120*60],byte 1
85
    jne  no_main_update
87
    jne  no_main_update
86
    mov  [I_END+120*60],byte 0
88
    mov  [I_END+120*60],byte 0
87
    mov  edx,I_END
89
    mov  edx,I_END
88
    call draw_channel_text
90
    call draw_channel_text
89
  no_main_update:
91
  no_main_update:
90
 
92
 
91
    call read_incoming_data
93
    call read_incoming_data
92
 
94
 
93
    call send_data_to_server
95
    call send_data_to_server
94
 
96
 
95
    test [cursor_on_off],0x3f
97
    test [cursor_on_off],0x3f
96
    jnz  nopri
98
    jnz  nopri
97
    inc  [blink]
99
    inc  [blink]
98
    call blink_cursor
100
    call blink_cursor
99
    call print_channel_list
101
    call print_channel_list
100
  nopri:
102
  nopri:
101
 
103
 
102
    jmp  still
104
    jmp  still
103
 
-
 
104
 
-
 
105
redraw: 			; redraw
-
 
106
 
-
 
107
    call draw_window
-
 
108
    jmp  still
-
 
109
 
-
 
110
 
105
 
111
button: 			; button
106
button: 			; button
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
117
    jne  noclose
112
    jne  noclose
118
    mov  eax,-1
113
    or   eax,-1
119
    mcall
114
    mcall
120
  noclose:
115
  noclose:
121
 
116
 
122
    call socket_commands
117
    call socket_commands
123
 
118
 
124
    jmp  still
119
    jmp  still
125
 
120
 
126
 
121
 
127
print_status:
122
print_status:
128
 
123
 
129
    pusha
124
    pusha
130
 
125
 
131
    mov  eax,53
126
    mov  eax,53
132
    mov  ebx,6
127
    mov  ebx,6
133
    mov  ecx,[socket]
128
    mov  ecx,[socket]
134
    mcall
129
    mcall
135
 
130
 
136
    mov  [status],eax
131
    mov  [status],eax
137
 
132
 
138
    cmp  [old_status],eax
133
    cmp  [old_status],eax
139
    je	 nopr
134
    je	 nopr
140
 
135
 
141
    mov  [old_status],eax
136
    mov  [old_status],eax
142
 
137
 
143
    push eax
138
    push eax
144
 
139
 
145
    mov  eax,13
140
    mov  eax,13
146
    mov  ebx,450*65536+30
141
    mov  ebx,450*65536+30
147
    mov  ecx,231*65536+10
142
    mov  ecx,231*65536+10
148
    mov  edx,0xffffff
143
    mov  edx,0xffffff
149
    mcall
144
    mcall
150
 
145
 
151
    pop  ecx
146
    pop  ecx
152
    mov  eax,47
147
    mov  eax,47
153
    mov  ebx,2*65536
148
    mov  ebx,2*65536
154
    mov  edx,450*65536+231
149
    mov  edx,450*65536+231
155
    mov  esi,0x000000
150
    mov  esi,0x000000
156
    mcall
151
    mcall
157
 
152
 
158
  nopr:
153
  nopr:
159
 
154
 
160
    popa
155
    popa
161
 
156
 
162
    ret
157
    ret
163
 
158
 
164
status dd 0
159
status dd 0
165
old_status dd 0
160
old_status dd 0
166
 
161
 
167
 
162
 
168
socket_commands:
163
socket_commands:
169
 
164
 
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
180
    mcall
182
    mcall
181
    mov  [socket], eax
183
    mov  [socket], eax
182
    ret
184
    ret
183
  tst3:
185
  tst3:
184
 
186
 
185
 
187
 
186
    cmp  ah,23	      ; write userinfo
188
    cmp  ah,23	      ; write userinfo
187
    jnz  tst4
189
    jnz  tst4
188
 
190
 
189
    mov  eax,53  ; user
191
    mov  eax,53  ; user
190
    mov  ebx,7
192
    mov  ebx,7
191
    mov  ecx,[socket]
193
    mov  ecx,[socket]
192
    mov  edx,string0l-string0
194
    mov  edx,string0l-string0
193
    mov  esi,string0
195
    mov  esi,string0
194
    mcall
196
    mcall
195
 
197
 
196
    mov  eax,53  ;
198
    mov  eax,53  ;
197
    mov  ebx,7
199
    mov  ebx,7
198
    mov  ecx,[socket]
200
    mov  ecx,[socket]
199
    mov  edx,[user_real_name]
201
    mov  edx,[user_real_name]
200
    mov  esi,user_real_name+4
202
    mov  esi,user_real_name+4
201
    mcall
203
    mcall
202
 
204
 
203
    mov  eax,53  ;
205
    mov  eax,53  ;
204
    mov  ebx,7
206
    mov  ebx,7
205
    mov  ecx,[socket]
207
    mov  ecx,[socket]
206
    mov  edx,2
208
    mov  edx,2
207
    mov  esi,line_feed
209
    mov  esi,line_feed
208
    mcall
210
    mcall
209
 
211
 
210
 
212
 
211
    mov  eax,5
213
    mov  eax,5
212
    mov  ebx,10
214
    mov  ebx,10
213
    mcall
215
    mcall
214
 
216
 
215
    mov  eax,53  ; nick
217
    mov  eax,53  ; nick
216
    mov  ebx,7
218
    mov  ebx,7
217
    mov  ecx,[socket]
219
    mov  ecx,[socket]
218
    mov  edx,string1l-string1
220
    mov  edx,string1l-string1
219
    mov  esi,string1
221
    mov  esi,string1
220
    mcall
222
    mcall
221
 
223
 
222
    mov  eax,53  ;
224
    mov  eax,53  ;
223
    mov  ebx,7
225
    mov  ebx,7
224
    mov  ecx,[socket]
226
    mov  ecx,[socket]
225
    mov  edx,[user_nick]
227
    mov  edx,[user_nick]
226
    mov  esi,user_nick+4
228
    mov  esi,user_nick+4
227
    mcall
229
    mcall
228
 
230
 
229
    mov  eax,53  ;
231
    mov  eax,53  ;
230
    mov  ebx,7
232
    mov  ebx,7
231
    mov  ecx,[socket]
233
    mov  ecx,[socket]
232
    mov  edx,2
234
    mov  edx,2
233
    mov  esi,line_feed
235
    mov  esi,line_feed
234
    mcall
236
    mcall
235
 
237
 
236
 
238
 
237
    ret
239
    ret
238
 
240
 
239
  line_feed:  db  13,10
241
  line_feed:  db  13,10
240
 
242
 
241
  tst4:
243
  tst4:
242
 
244
 
243
 
245
 
244
    cmp  ah,24	   ; close socket
246
    cmp  ah,24	   ; close socket
245
    jnz  no_24
247
    jnz  no_24
246
    mov  eax,53
248
    mov  eax,53
247
    mov  ebx,8
249
    mov  ebx,8
248
    mov  ecx,[socket]
250
    mov  ecx,[socket]
249
    mcall
251
    mcall
250
    ret
252
    ret
251
  no_24:
253
  no_24:
252
 
254
 
253
 
255
 
254
    ret
256
    ret
255
 
257
 
256
 
258
 
257
main_window_key:
259
main_window_key:
258
 
260
 
259
    mov  eax,2
261
    mov  eax,2
260
    mcall
262
    mcall
261
 
263
 
262
    shr  eax,8
264
    shr  eax,8
263
 
265
 
264
    cmp  eax,8
266
    cmp  eax,8
265
    jne  no_bks2
267
    jne  no_bks2
266
    cmp  [xpos],0
268
    cmp  [xpos],0
267
    je	 still
269
    je	 still
268
    dec  [xpos]
270
    dec  [xpos]
269
    call print_entry
271
    call print_entry
270
    jmp  still
272
    jmp  still
271
   no_bks2:
273
   no_bks2:
272
 
274
 
273
    cmp  eax,20
275
    cmp  eax,20
274
    jbe  no_character2
276
    jbe  no_character2
275
    mov  ebx,[xpos]
277
    mov  ebx,[xpos]
276
    mov  [send_string+ebx],al
278
    mov  [send_string+ebx],al
277
    inc  [xpos]
279
    inc  [xpos]
278
    cmp  [xpos],80
280
    cmp  [xpos],80
279
    jb	 noxposdec
281
    jb	 noxposdec
280
    mov  [xpos],79
282
    mov  [xpos],79
281
  noxposdec:
283
  noxposdec:
282
    call print_entry
284
    call print_entry
283
    jmp  still
285
    jmp  still
284
  no_character2:
286
  no_character2:
285
 
287
 
286
    cmp  eax,13
288
    cmp  eax,13
287
    jne  no_send
289
    jne  no_send
288
    cmp  [xpos],0
290
    cmp  [xpos],0
289
    je	 no_send2
291
    je	 no_send2
290
    cmp  [send_string],byte '/'   ; server command
292
    cmp  [send_string],byte '/'   ; server command
291
    jne  no_send2
293
    jne  no_send2
292
    mov  [send_to_server],1
294
    mov  [send_to_server],1
293
    jmp  still
295
    jmp  still
294
  no_send2:
296
  no_send2:
295
 
297
 
296
    jmp  still
298
    jmp  still
297
 
299
 
298
 
300
 
299
print_channel_list:
301
print_channel_list:
300
 
302
 
301
    pusha
303
    pusha
302
 
304
 
303
    mov  eax,13
305
    mov  eax,13
304
    mov  ebx,415*65536+6*13
306
    mov  ebx,415*65536+6*13
305
    mov  ecx,27*65536+12*10
307
    mov  ecx,27*65536+12*10
306
    mov  edx,0xffffff
308
    mov  edx,0xffffff
307
    mcall
309
    mcall
308
 
310
 
309
    mov  eax,4
311
    mov  eax,4
310
    mov  ebx,415*65536+27
312
    mov  ebx,415*65536+27
311
    mov  ecx,[index_list_1]
313
    mov  ecx,[index_list_1]
312
    mov  edx,channel_list+32
314
    mov  edx,channel_list+32
313
  newch:
315
  newch:
314
    movzx esi,byte [edx+31]
316
    movzx esi,byte [edx+31]
315
    and  esi,0x1f
317
    and  esi,0x1f
316
    mcall
318
    mcall
317
    add  edx,32
319
    add  edx,32
318
    add  ebx,12
320
    add  ebx,12
319
    cmp  edx,channel_list+32*10
321
    cmp  edx,channel_list+32*10
320
    jbe  newch
322
    jbe  newch
321
 
323
 
322
  no_channel_list:
324
  no_channel_list:
323
 
325
 
324
    popa
326
    popa
325
 
327
 
326
    ret
328
    ret
327
 
329
 
328
 
330
 
329
print_user_list:
331
print_user_list:
330
 
332
 
331
    pusha
333
    pusha
332
 
334
 
333
  newtry:
335
  newtry:
334
 
336
 
335
    mov  edx,ebp
337
    mov  edx,ebp
336
    imul edx,120*80
338
    imul edx,120*80
337
    add  edx,120*60+8+I_END
339
    add  edx,120*60+8+I_END
338
    cmp  [edx],byte 1
340
    cmp  [edx],byte 1
339
    je	 nonp
341
    je	 nonp
340
 
342
 
341
    mov  edx,ebp
343
    mov  edx,ebp
342
    imul edx,120*80
344
    imul edx,120*80
343
    add  edx,120*70+I_END
345
    add  edx,120*70+I_END
344
    mov  edi,edx
346
    mov  edi,edx
345
 
347
 
346
    mov  eax,[edx-8]
348
    mov  eax,[edx-8]
347
    mov  ebx,[edx-4]
349
    mov  ebx,[edx-4]
348
    add  ebx,edx
350
    add  ebx,edx
349
    sub  ebx,3
351
    sub  ebx,3
350
    inc  eax
352
    inc  eax
351
    dec  edx
353
    dec  edx
352
  newnss:
354
  newnss:
353
    inc  edx
355
    inc  edx
354
    dec  eax
356
    dec  eax
355
    jz	 startuu
357
    jz	 startuu
356
  asdf:
358
  asdf:
357
    cmp  [edx],word '  '
359
    cmp  [edx],word '  '
358
    jne  nodouble
360
    jne  nodouble
359
    inc  edx
361
    inc  edx
360
  nodouble:
362
  nodouble:
361
    cmp  [edx],byte ' '
363
    cmp  [edx],byte ' '
362
    je	 newnss
364
    je	 newnss
363
    inc  edx
365
    inc  edx
364
    cmp  edx,ebx
366
    cmp  edx,ebx
365
    jbe  asdf
367
    jbe  asdf
366
    dec  dword [edi-8]
368
    dec  dword [edi-8]
367
 
369
 
368
    popa
370
    popa
369
    ret
371
    ret
370
 
372
 
371
  startuu:
373
  startuu:
372
 
374
 
373
    cmp  [edx],byte ' '
375
    cmp  [edx],byte ' '
374
    jne  startpr
376
    jne  startpr
375
    inc  edx
377
    inc  edx
376
  startpr:
378
  startpr:
377
 
379
 
378
    pusha
380
    pusha
379
    mov  eax,13
381
    mov  eax,13
380
    mov  ebx,415*65536+6*13
382
    mov  ebx,415*65536+6*13
381
    mov  ecx,27*65536+12*10
383
    mov  ecx,27*65536+12*10
382
    mov  edx,0xffffff
384
    mov  edx,0xffffff
383
    mcall
385
    mcall
384
    popa
386
    popa
385
 
387
 
386
    mov  eax,4
388
    mov  eax,4
387
    mov  ebx,415*65536+27
389
    mov  ebx,415*65536+27
388
 
390
 
389
    mov  ebp,0
391
    mov  ebp,0
390
  newuser:
392
  newuser:
391
 
393
 
392
    mov  esi,0
394
    mov  esi,0
393
  newusers:
395
  newusers:
394
    cmp  [edx+esi],byte ' '
396
    cmp  [edx+esi],byte ' '
395
    je	 do_print
397
    je	 do_print
396
    inc  esi
398
    inc  esi
397
    cmp  esi,20
399
    cmp  esi,20
398
    jbe  newusers
400
    jbe  newusers
399
  do_print:
401
  do_print:
400
 
402
 
401
    mov  ecx,[index_list_1]
403
    mov  ecx,[index_list_1]
402
    cmp  [edx],byte '@'
404
    cmp  [edx],byte '@'
403
    jne  no_op
405
    jne  no_op
404
    mov  ecx,[index_list_2]
406
    mov  ecx,[index_list_2]
405
  no_op:
407
  no_op:
406
 
408
 
407
    mcall
409
    mcall
408
 
410
 
409
    inc  ebp
411
    inc  ebp
410
    cmp  ebp,10
412
    cmp  ebp,10
411
    je	 nonp
413
    je	 nonp
412
 
414
 
413
    add  ebx,12
415
    add  ebx,12
414
 
416
 
415
    add  edx,esi
417
    add  edx,esi
416
 
418
 
417
    inc  edx
419
    inc  edx
418
    cmp  [edx],byte ' '
420
    cmp  [edx],byte ' '
419
    jne  newuser
421
    jne  newuser
420
    inc  edx
422
    inc  edx
421
    jmp  newuser
423
    jmp  newuser
422
 
424
 
423
  nonp:
425
  nonp:
424
 
426
 
425
    popa
427
    popa
426
 
428
 
427
    ret
429
    ret
428
 
430
 
429
 
431
 
430
start_user_list_at dd 0x0
432
start_user_list_at dd 0x0
431
 
433
 
432
 
434
 
433
recode_to_cp1251:
435
recode_to_cp1251:
434
	push	esi edx
436
	push	esi edx
435
  .loop:
437
  .loop:
436
	lodsb
438
	lodsb
437
	cmp	al,0x80
439
	cmp	al,0x80
438
	jb	@f
440
	jb	@f
439
	and	eax,0x7F
441
	and	eax,0x7F
440
	mov	al,[cp866_table+eax]
442
	mov	al,[cp866_table+eax]
441
    @@: mov	[esi-1],al
443
    @@: mov	[esi-1],al
442
	dec	edx
444
	dec	edx
443
	jnz	.loop
445
	jnz	.loop
444
	pop	edx esi
446
	pop	edx esi
445
	ret
447
	ret
446
 
448
 
447
 
449
 
448
send_data_to_server:
450
send_data_to_server:
449
 
451
 
450
    pusha
452
    pusha
451
 
453
 
452
    cmp  [send_to_server],1
454
    cmp  [send_to_server],1
453
    jne  sdts_ret
455
    jne  sdts_ret
454
 
456
 
455
    mov  eax,[xpos]
457
    mov  eax,[xpos]
456
    mov  [send_string+eax+0],byte 13
458
    mov  [send_string+eax+0],byte 13
457
    mov  [send_string+eax+1],byte 10
459
    mov  [send_string+eax+1],byte 10
458
 
460
 
459
    mov  eax,[rxs]
461
    mov  eax,[rxs]
460
    imul eax,11
462
    imul eax,11
461
    mov  [pos],eax
463
    mov  [pos],eax
462
    mov  eax,[send_to_channel]
464
    mov  eax,[send_to_channel]
463
    imul eax,120*80
465
    imul eax,120*80
464
    add  eax,I_END
466
    add  eax,I_END
465
    mov  [text_start],eax
467
    mov  [text_start],eax
466
 
468
 
467
    cmp  [send_string],byte '/'   ; server command
469
    cmp  [send_string],byte '/'   ; server command
468
    je	 server_command
470
    je	 server_command
469
 
471
 
470
    mov  bl,13
472
    mov  bl,13
471
    call print_character
473
    call print_character
472
    mov  bl,10
474
    mov  bl,10
473
    call print_character
475
    call print_character
474
    mov  bl,'<'
476
    mov  bl,'<'
475
    call print_character
477
    call print_character
476
 
478
 
477
    mov  esi,user_nick+4
479
    mov  esi,user_nick+4
478
    mov  ecx,[user_nick]
480
    mov  ecx,[user_nick]
479
  newnp:
481
  newnp:
480
    mov  bl,[esi]
482
    mov  bl,[esi]
481
    call print_character
483
    call print_character
482
    inc  esi
484
    inc  esi
483
    loop newnp
485
    loop newnp
484
 
486
 
485
    mov  bl,'>'
487
    mov  bl,'>'
486
    call print_character
488
    call print_character
487
    mov  bl,' '
489
    mov  bl,' '
488
    call print_character
490
    call print_character
489
 
491
 
490
    mov  ecx,[xpos]
492
    mov  ecx,[xpos]
491
    mov  esi,send_string
493
    mov  esi,send_string
492
  newcw:
494
  newcw:
493
    mov  bl,[esi]
495
    mov  bl,[esi]
494
    call print_character
496
    call print_character
495
    inc  esi
497
    inc  esi
496
    loop newcw
498
    loop newcw
497
 
499
 
498
    mov  eax,dword [send_to_channel]
500
    mov  eax,dword [send_to_channel]
499
    shl  eax,5
501
    shl  eax,5
500
    add  eax,channel_list
502
    add  eax,channel_list
501
    mov  esi,eax
503
    mov  esi,eax
502
 
504
 
503
    mov  edi,send_string_header+8
505
    mov  edi,send_string_header+8
504
    movzx ecx,byte [eax+31]
506
    movzx ecx,byte [eax+31]
505
    cld
507
    cld
506
    rep  movsb
508
    rep  movsb
507
 
509
 
508
    mov  [edi],word ' :'
510
    mov  [edi],word ' :'
509
 
511
 
510
    mov   esi, send_string_header
512
    mov   esi, send_string_header
511
    mov   edx,10
513
    mov   edx,10
512
    movzx ebx,byte [eax+31]
514
    movzx ebx,byte [eax+31]
513
    add   edx,ebx
515
    add   edx,ebx
514
 
516
 
515
    mov  eax, 53      ; write channel
517
    mov  eax, 53      ; write channel
516
    mov  ebx, 7
518
    mov  ebx, 7
517
    mov  ecx, [socket]
519
    mov  ecx, [socket]
518
    mcall
520
    mcall
519
 
521
 
520
    mov  esi,send_string
522
    mov  esi,send_string
521
    mov  edx,[xpos]
523
    mov  edx,[xpos]
522
    inc  edx
524
    inc  edx
523
 
525
 
524
	call	recode_to_cp1251
526
	call	recode_to_cp1251
525
 
527
 
526
    mov  eax, 53      ; write message
528
    mov  eax, 53      ; write message
527
    mov  ebx, 7
529
    mov  ebx, 7
528
    mov  ecx, [socket]
530
    mov  ecx, [socket]
529
    mcall
531
    mcall
530
 
532
 
531
    jmp  send_done
533
    jmp  send_done
532
 
534
 
533
  server_command:
535
  server_command:
534
 
536
 
535
    cmp  [send_string+1],dword 'anic'
537
    cmp  [send_string+1],dword 'anic'
536
    jne  no_set_nick
538
    jne  no_set_nick
537
 
539
 
538
    mov  ecx,[xpos]
540
    mov  ecx,[xpos]
539
    sub  ecx,7
541
    sub  ecx,7
540
    mov  [user_nick],ecx
542
    mov  [user_nick],ecx
541
 
543
 
542
    mov  esi,send_string+7
544
    mov  esi,send_string+7
543
    mov  edi,user_nick+4
545
    mov  edi,user_nick+4
544
    cld
546
    cld
545
    rep  movsb
547
    rep  movsb
546
 
548
 
547
    pusha
549
    pusha
548
    mov  edi,text+70*1+15
550
    mov  edi,text+70*1+15
549
    mov  eax,32
551
    mov  eax,32
550
    mov  ecx,15
552
    mov  ecx,15
551
    cld
553
    cld
552
    rep  stosb
554
    rep  stosb
553
    popa
555
    popa
554
 
556
 
555
    mov  esi,user_nick+4
557
    mov  esi,user_nick+4
556
    mov  edi,text+70*1+15
558
    mov  edi,text+70*1+15
557
    mov  ecx,[user_nick]
559
    mov  ecx,[user_nick]
558
    cld
560
    cld
559
    rep  movsb
561
    rep  movsb
560
 
562
 
561
    call draw_window
563
    call draw_window
562
 
564
 
563
    mov  [xpos],0
565
    mov  [xpos],0
564
    mov  [send_to_server],0
566
    mov  [send_to_server],0
565
 
567
 
566
    popa
568
    popa
567
    ret
569
    ret
568
 
570
 
569
  no_set_nick:
571
  no_set_nick:
570
 
572
 
571
    cmp  [send_string+1],dword 'area'
573
    cmp  [send_string+1],dword 'area'
572
    jne  no_set_real_name
574
    jne  no_set_real_name
573
 
575
 
574
    mov  ecx,[xpos]
576
    mov  ecx,[xpos]
575
    sub  ecx,7
577
    sub  ecx,7
576
    mov  [user_real_name],ecx
578
    mov  [user_real_name],ecx
577
 
579
 
578
    mov  esi,send_string+7
580
    mov  esi,send_string+7
579
    mov  edi,user_real_name+4
581
    mov  edi,user_real_name+4
580
    cld
582
    cld
581
    rep  movsb
583
    rep  movsb
582
 
584
 
583
    pusha
585
    pusha
584
    mov  edi,text+70*0+15
586
    mov  edi,text+70*0+15
585
    mov  eax,32
587
    mov  eax,32
586
    mov  ecx,15
588
    mov  ecx,15
587
    cld
589
    cld
588
    rep  stosb
590
    rep  stosb
589
    popa
591
    popa
590
 
592
 
591
    mov  esi,user_real_name+4
593
    mov  esi,user_real_name+4
592
    mov  edi,text+70*0+15
594
    mov  edi,text+70*0+15
593
    mov  ecx,[xpos]
595
    mov  ecx,[xpos]
594
    sub  ecx,7
596
    sub  ecx,7
595
    cld
597
    cld
596
    rep  movsb
598
    rep  movsb
597
 
599
 
598
    call draw_window
600
    call draw_window
599
 
601
 
600
    mov  [xpos],0
602
    mov  [xpos],0
601
    mov  [send_to_server],0
603
    mov  [send_to_server],0
602
 
604
 
603
    popa
605
    popa
604
    ret
606
    ret
605
 
607
 
606
  no_set_real_name:
608
  no_set_real_name:
607
 
609
 
608
    cmp  [send_string+1],dword 'aser'
610
    cmp  [send_string+1],dword 'aser'
609
    jne  no_set_server
611
    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
-
 
639
 
612
 
640
pusha
613
pusha
641
    mov     eax,send_string
614
    mov     eax,send_string
642
    add     eax,[xpos]
615
    add     eax,[xpos]
643
    mov     dword[eax],0
616
    mov     dword[eax],0
644
    resolve send_string+7,dword[irc_server_ip]
617
    resolve send_string+7,dword[irc_server_ip]
645
    ;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]
618
    ;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]
646
popa
619
popa
647
 
620
 
648
    mov  ecx,[xpos]
621
    mov  ecx,[xpos]
649
    sub  ecx,7
622
    sub  ecx,7
650
 
623
 
651
    pusha
624
    pusha
652
    mov  edi,text+70*2+15
625
    mov  edi,text+70*2+15
653
    mov  eax,32
626
    mov  eax,32
654
    mov  ecx,15
627
    mov  ecx,15
655
    cld
628
    cld
656
    rep  stosb
629
    rep  stosb
657
    popa
630
    popa
658
 
631
 
659
    mov  esi,send_string+7
632
    mov  esi,send_string+7
660
    mov  edi,text+70*2+15
633
    mov  edi,text+70*2+15
661
    cld
634
    cld
662
    rep  movsb
635
    rep  movsb
663
 
636
 
664
    call draw_window
637
    call draw_window
665
 
638
 
666
    mov  [xpos],0
639
    mov  [xpos],0
667
    mov  [send_to_server],0
640
    mov  [send_to_server],0
668
 
641
 
669
    popa
642
    popa
670
    ret
643
    ret
671
 
644
 
672
   no_set_server:
645
   no_set_server:
673
 
646
 
674
 
647
 
675
 
648
 
676
 
649
 
677
    cmp  [send_string+1],dword 'quer'
650
    cmp  [send_string+1],dword 'quer'
678
    jne  no_query_create
651
    jne  no_query_create
679
 
652
 
680
    mov  edi,I_END+120*80
653
    mov  edi,I_END+120*80
681
    mov  eax,1 ; create channel window - search for empty slot
654
    mov  eax,1 ; create channel window - search for empty slot
682
   newse2:
655
   newse2:
683
    mov  ebx,eax
656
    mov  ebx,eax
684
    shl  ebx,5
657
    shl  ebx,5
685
    cmp  dword [channel_list+ebx],dword '    '
658
    cmp  dword [channel_list+ebx],dword '    '
686
    je	 free_found2
659
    je	 free_found2
687
    add  edi,120*80
660
    add  edi,120*80
688
    inc  eax
661
    inc  eax
689
    cmp  eax,[max_windows]
662
    cmp  eax,[max_windows]
690
    jb	 newse2
663
    jb	 newse2
691
 
664
 
692
  free_found2:
665
  free_found2:
693
 
666
 
694
    mov  edx,send_string+7
667
    mov  edx,send_string+7
695
 
668
 
696
    mov  ecx,[xpos]
669
    mov  ecx,[xpos]
697
    sub  ecx,7
670
    sub  ecx,7
698
    mov  [channel_list+ebx+31],cl
671
    mov  [channel_list+ebx+31],cl
699
 
672
 
700
    call create_channel_name
673
    call create_channel_name
701
 
674
 
702
    push edi
675
    push edi
703
    push eax
676
    push eax
704
    mov  [edi+120*60+8],byte 1 ; query window
677
    mov  [edi+120*60+8],byte 1 ; query window
705
    mov  eax,32
678
    mov  eax,32
706
    mov  ecx,120*60
679
    mov  ecx,120*60
707
    cld
680
    cld
708
    rep  stosb
681
    rep  stosb
709
    pop  eax
682
    pop  eax
710
    pop  edi
683
    pop  edi
711
 
684
 
712
    ; eax has the free position
685
    ; eax has the free position
713
    mov  [thread_screen],edi
686
    mov  [thread_screen],edi
714
    call create_channel_window
687
    call create_channel_window
715
 
688
 
716
    mov  [xpos],0
689
    mov  [xpos],0
717
    mov  [send_to_server],0
690
    mov  [send_to_server],0
718
 
691
 
719
    popa
692
    popa
720
    ret
693
    ret
721
 
694
 
722
  no_query_create:
695
  no_query_create:
723
 
696
 
724
 
697
 
725
    mov  esi, send_string+1
698
    mov  esi, send_string+1
726
    mov  edx, [xpos]
699
    mov  edx, [xpos]
727
    add  edx,1
700
    add  edx,1
728
 
701
 
729
    mov  eax, 53      ; write server command
702
    mov  eax, 53      ; write server command
730
    mov  ebx, 7
703
    mov  ebx, 7
731
    mov  ecx, [socket]
704
    mov  ecx, [socket]
732
    mcall
705
    mcall
733
 
706
 
734
  send_done:
707
  send_done:
735
 
708
 
736
    mov  [xpos],0
709
    mov  [xpos],0
737
    mov  [send_to_server],0
710
    mov  [send_to_server],0
738
 
711
 
739
    cmp  [send_string+1],dword 'quit'
712
    cmp  [send_string+1],dword 'quit'
740
    jne  no_quit_server
713
    jne  no_quit_server
741
    mov  eax,5
714
    mov  eax,5
742
    mov  ebx,200
715
    mov  ebx,200
743
    mcall
716
    mcall
744
 
717
 
745
    mov  eax, 53      ; close socket
718
    mov  eax, 53      ; close socket
746
    mov  ebx, 8
719
    mov  ebx, 8
747
    mov  ecx, [socket]
720
    mov  ecx, [socket]
748
    mcall
721
    mcall
749
 
722
 
750
    mov  ecx,[max_windows]
723
    mov  ecx,[max_windows]
751
    mov  edi,I_END
724
    mov  edi,I_END
752
  newclose:
725
  newclose:
753
    mov  [edi+120*60+4],byte  1
726
    mov  [edi+120*60+4],byte  1
754
    add  edi,120*80
727
    add  edi,120*80
755
    loop newclose
728
    loop newclose
756
 
729
 
757
    popa
730
    popa
758
    ret
731
    ret
759
 
732
 
760
  no_quit_server:
733
  no_quit_server:
761
 
734
 
762
  sdts_ret:
735
  sdts_ret:
763
 
736
 
764
    popa
737
    popa
765
    ret
738
    ret
766
 
739
 
767
 
740
 
768
 
741
 
769
read_incoming_data:
742
read_incoming_data:
770
 
743
 
771
    pusha
744
    pusha
772
 
745
 
773
  read_new_byte:
746
  read_new_byte:
774
 
747
 
775
    call read_incoming_byte
748
    call read_incoming_byte
776
    cmp  ecx,-1
749
    cmp  ecx,-1
777
    je	 no_data_in_buffer
750
    je	 no_data_in_buffer
778
 
751
 
779
    cmp  bl,10
752
    cmp  bl,10
780
    jne  no_start_command
753
    jne  no_start_command
781
    mov  [cmd],1
754
    mov  [cmd],1
782
  no_start_command:
755
  no_start_command:
783
 
756
 
784
    cmp  bl,13
757
    cmp  bl,13
785
    jne  no_end_command
758
    jne  no_end_command
786
    mov  eax,[cmd]
759
    mov  eax,[cmd]
787
    mov  [eax+command-2],byte 0
760
    mov  [eax+command-2],byte 0
788
    call analyze_command
761
    call analyze_command
789
    mov  edi,command
762
    mov  edi,command
790
    mov  ecx,250
763
    mov  ecx,250
791
    mov  eax,0
764
    mov  eax,0
792
    cld
765
    cld
793
    rep  stosb
766
    rep  stosb
794
    mov  [cmd],0
767
    mov  [cmd],0
795
  no_end_command:
768
  no_end_command:
796
 
769
 
797
    mov  eax,[cmd]
770
    mov  eax,[cmd]
798
    cmp  eax,512
771
    cmp  eax,512
799
    jge  still
772
    jge  still
800
 
773
 
801
    mov  [eax+command-2],bl
774
    mov  [eax+command-2],bl
802
    inc  [cmd]
775
    inc  [cmd]
803
 
776
 
804
    jmp  read_new_byte
777
    jmp  read_new_byte
805
 
778
 
806
  no_data_in_buffer:
779
  no_data_in_buffer:
807
 
780
 
808
    popa
781
    popa
809
 
782
 
810
    ret
783
    ret
811
 
784
 
812
 
785
 
813
create_channel_name:
786
create_channel_name:
814
 
787
 
815
    pusha
788
    pusha
816
 
789
 
817
  search_first_letter:
790
  search_first_letter:
818
    cmp  [edx],byte ' '
791
    cmp  [edx],byte ' '
819
    jne  first_letter_found
792
    jne  first_letter_found
820
    inc  edx
793
    inc  edx
821
    jmp  search_first_letter
794
    jmp  search_first_letter
822
  first_letter_found:
795
  first_letter_found:
823
 
796
 
824
    mov  esi,edx
797
    mov  esi,edx
825
    mov  edi,channel_list
798
    mov  edi,channel_list
826
    add  edi,ebx
799
    add  edi,ebx
827
    mov  ecx,30
800
    mov  ecx,30
828
    xor  eax,eax
801
    xor  eax,eax
829
  newcase:
802
  newcase:
830
    mov  al,[esi]
803
    mov  al,[esi]
831
    cmp  eax,'a'
804
    cmp  eax,'a'
832
    jb	 nocdec
805
    jb	 nocdec
833
    cmp  eax,'z'
806
    cmp  eax,'z'
834
    jg	 nocdec
807
    jg	 nocdec
835
    sub  al,97-65
808
    sub  al,97-65
836
  nocdec:
809
  nocdec:
837
    mov  [edi],al
810
    mov  [edi],al
838
    inc  esi
811
    inc  esi
839
    inc  edi
812
    inc  edi
840
    loop newcase
813
    loop newcase
841
 
814
 
842
    popa
815
    popa
843
 
816
 
844
    ret
817
    ret
845
 
818
 
846
 
819
 
847
create_channel_window:
820
create_channel_window:
848
 
821
 
849
    pusha
822
    pusha
850
 
823
 
851
    mov  [cursor_on_off],0
824
    mov  [cursor_on_off],0
852
 
825
 
853
    mov  [thread_nro],eax
826
    mov  [thread_nro],eax
854
 
827
 
855
    mov  eax,51
828
    mov  eax,51
856
    mov  ebx,1
829
    mov  ebx,1
857
    mov  ecx,channel_thread
830
    mov  ecx,channel_thread
858
    mov  edx,[thread_stack]
831
    mov  edx,[thread_stack]
859
    mcall
832
    mcall
860
 
833
 
861
    mov  eax,5
834
    mov  eax,5
862
    mov  ebx,10
835
    mov  ebx,10
863
    mcall
836
    mcall
864
 
837
 
865
    add  [thread_stack],0x4000
838
    add  [thread_stack],0x4000
866
    add  [thread_screen],120*80
839
    add  [thread_screen],120*80
867
 
840
 
868
    popa
841
    popa
869
 
842
 
870
    ret
843
    ret
871
 
844
 
872
 
845
 
873
print_entry:
846
print_entry:
874
 
847
 
875
    pusha
848
    pusha
876
 
849
 
877
    mov  eax,13
850
    mov  eax,13
878
    mov  ebx,8*65536+6*80
851
    mov  ebx,8*65536+6*80
879
    mov  ecx,151*65536+13
852
    mov  ecx,151*65536+13
880
    mov  edx,0xffffff
853
    mov  edx,0xffffff
881
    mcall
854
    mcall
882
 
855
 
883
    mov  eax,4
856
    mov  eax,4
884
    mov  ebx,8*65536+154
857
    mov  ebx,8*65536+154
885
    mov  ecx,0x000000
858
    mov  ecx,0x000000
886
    mov  edx,send_string
859
    mov  edx,send_string
887
    mov  esi,[xpos]
860
    mov  esi,[xpos]
888
    mcall
861
    mcall
889
 
862
 
890
    popa
863
    popa
891
 
864
 
892
    ret
865
    ret
893
 
866
 
894
blink dd 0x0
867
blink dd 0x0
895
 
868
 
896
blink_cursor:
869
blink_cursor:
897
 
870
 
898
    pusha
871
    pusha
899
 
872
 
900
    mov  eax,9
873
    mov  eax,9
901
    mov  ebx,0xe0000
874
    mov  ebx,0xe0000
902
    mov  ecx,-1
875
    mov  ecx,-1
903
    mcall
876
    mcall
904
 
877
 
905
    mov  edx,[blink]
878
    mov  edx,[blink]
906
    and  edx,1
879
    and  edx,1
907
    sub  edx,1
880
    sub  edx,1
908
    and  edx,0xffffff
881
    and  edx,0xffffff
909
;    mov  edx,0
882
;    mov  edx,0
910
 
883
 
911
    cmp  ax,word [0xe0000+4]
884
    cmp  ax,word [0xe0000+4]
912
    jne  no_blink
885
    jne  no_blink
913
 
886
 
914
    call print_entry
887
    call print_entry
915
 
888
 
916
    mov  ebx,[xpos]
889
    mov  ebx,[xpos]
917
    imul ebx,6
890
    imul ebx,6
918
    add  ebx,8
891
    add  ebx,8
919
    mov  cx,bx
892
    mov  cx,bx
920
    shl  ebx,16
893
    shl  ebx,16
921
    mov  bx,cx
894
    mov  bx,cx
922
    mov  ecx,151*65536+163
895
    mov  ecx,151*65536+163
923
    mov  eax,38
896
    mov  eax,38
924
    mcall
897
    mcall
925
 
898
 
926
    popa
899
    popa
927
 
900
 
928
    ret
901
    ret
929
 
902
 
930
  no_blink:
903
  no_blink:
931
 
904
 
932
    mov  eax,13
905
    mov  eax,13
933
    mov  ebx,8*65536+6*60
906
    mov  ebx,8*65536+6*60
934
    mov  ecx,151*65536+13
907
    mov  ecx,151*65536+13
935
    mov  edx,0xffffff
908
    mov  edx,0xffffff
936
    mcall
909
    mcall
937
 
910
 
938
    popa
911
    popa
939
 
912
 
940
    ret
913
    ret
941
 
914
 
942
 
915
 
943
 
916
 
944
 
917
 
945
 
918
 
946
set_channel:
919
set_channel:
947
 
920
 
948
    pusha
921
    pusha
949
 
922
 
950
    ; UPPER / LOWER CASE CHECK
923
    ; UPPER / LOWER CASE CHECK
951
 
924
 
952
    mov  esi,eax
925
    mov  esi,eax
953
    mov  edi,channel_temp
926
    mov  edi,channel_temp
954
    mov  ecx,40
927
    mov  ecx,40
955
    xor  eax,eax
928
    xor  eax,eax
956
  newcase2:
929
  newcase2:
957
    mov  al,[esi]
930
    mov  al,[esi]
958
    cmp  eax,'#'
931
    cmp  eax,'#'
959
    jb	 newcase_over2
932
    jb	 newcase_over2
960
    cmp  eax,'a'
933
    cmp  eax,'a'
961
    jb	 nocdec2
934
    jb	 nocdec2
962
    cmp  eax,'z'
935
    cmp  eax,'z'
963
    jg	 nocdec2
936
    jg	 nocdec2
964
    sub  al,97-65
937
    sub  al,97-65
965
  nocdec2:
938
  nocdec2:
966
    mov  [edi],al
939
    mov  [edi],al
967
    inc  esi
940
    inc  esi
968
    inc  edi
941
    inc  edi
969
    loop newcase2
942
    loop newcase2
970
  newcase_over2:
943
  newcase_over2:
971
    sub  edi,channel_temp
944
    sub  edi,channel_temp
972
    mov  [channel_temp_length],edi
945
    mov  [channel_temp_length],edi
973
 
946
 
974
    mov  eax,channel_temp
947
    mov  eax,channel_temp
975
 
948
 
976
    mov  [text_start],I_END+120*80
949
    mov  [text_start],I_END+120*80
977
    mov  ebx,channel_list+32
950
    mov  ebx,channel_list+32
978
    mov  eax,[eax]
951
    mov  eax,[eax]
979
 
952
 
980
    mov  edx,[channel_temp_length]
953
    mov  edx,[channel_temp_length]
981
 
954
 
982
  stcl1:
955
  stcl1:
983
    cmp  dl,[ebx+31]
956
    cmp  dl,[ebx+31]
984
    jne  notfound
957
    jne  notfound
985
 
958
 
986
    pusha
959
    pusha
987
    xor  eax,eax
960
    xor  eax,eax
988
    xor  edx,edx
961
    xor  edx,edx
989
    mov  ecx,0
962
    mov  ecx,0
990
  stc4:
963
  stc4:
991
    mov  dl,[ebx+ecx]
964
    mov  dl,[ebx+ecx]
992
    mov  al,[channel_temp+ecx]
965
    mov  al,[channel_temp+ecx]
993
    cmp  eax,edx
966
    cmp  eax,edx
994
    jne  notfound2
967
    jne  notfound2
995
    inc  ecx
968
    inc  ecx
996
    cmp  ecx,[channel_temp_length]
969
    cmp  ecx,[channel_temp_length]
997
    jb	 stc4
970
    jb	 stc4
998
    popa
971
    popa
999
 
972
 
1000
    jmp  found
973
    jmp  found
1001
 
974
 
1002
  notfound2:
975
  notfound2:
1003
    popa
976
    popa
1004
 
977
 
1005
  notfound:
978
  notfound:
1006
    add  [text_start],120*80
979
    add  [text_start],120*80
1007
    add  ebx,32
980
    add  ebx,32
1008
    cmp  ebx,channel_list+19*32
981
    cmp  ebx,channel_list+19*32
1009
    jb	 stcl1
982
    jb	 stcl1
1010
 
983
 
1011
    mov  [text_start],I_END
984
    mov  [text_start],I_END
1012
 
985
 
1013
  found:
986
  found:
1014
 
987
 
1015
    popa
988
    popa
1016
 
989
 
1017
    ret
990
    ret
1018
 
991
 
1019
 
992
 
1020
channel_temp:	      times   100   db	 0
993
channel_temp:	      times   100   db	 0
1021
channel_temp_length   dd      0x0
994
channel_temp_length   dd      0x0
1022
 
995
 
1023
 
996
 
1024
 
997
 
1025
print_nick:
998
print_nick:
1026
 
999
 
1027
    pusha
1000
    pusha
1028
 
1001
 
1029
    mov  eax,command+1
1002
    mov  eax,command+1
1030
    mov  dl,'!'
1003
    mov  dl,'!'
1031
    call print_text
1004
    call print_text
1032
 
1005
 
1033
    popa
1006
    popa
1034
    ret
1007
    ret
1035
 
1008
 
1036
 
1009
 
1037
analyze_command:
1010
analyze_command:
1038
 
1011
 
1039
    pusha
1012
    pusha
1040
 
1013
 
1041
    mov  [text_start],I_END
1014
    mov  [text_start],I_END
1042
    mov  ecx,[rxs]
1015
    mov  ecx,[rxs]
1043
    imul ecx,11
1016
    imul ecx,11
1044
    mov  [pos],ecx
1017
    mov  [pos],ecx
1045
 
1018
 
1046
    mov  bl,13
1019
    mov  bl,13
1047
;  call print_character
1020
;  call print_character
1048
    mov  bl,10
1021
    mov  bl,10
1049
;  call print_character
1022
;  call print_character
1050
 
1023
 
1051
    mov  ecx,[cmd]
1024
    mov  ecx,[cmd]
1052
    sub  ecx,2
1025
    sub  ecx,2
1053
    mov  esi,command+0
1026
    mov  esi,command+0
1054
  newcmdc:
1027
  newcmdc:
1055
    mov  bl,[esi]
1028
    mov  bl,[esi]
1056
;  call print_character
1029
;  call print_character
1057
    inc  esi
1030
    inc  esi
1058
    loop newcmdc
1031
    loop newcmdc
1059
 
1032
 
1060
    mov   edx,I_END
1033
    mov   edx,I_END
1061
;  call  draw_channel_text
1034
;  call  draw_channel_text
1062
 
1035
 
1063
    cmp  [cmd],20
1036
    cmp  [cmd],20
1064
    jge  cmd_len_ok
1037
    jge  cmd_len_ok
1065
 
1038
 
1066
    mov  [cmd],0
1039
    mov  [cmd],0
1067
 
1040
 
1068
    popa
1041
    popa
1069
    ret
1042
    ret
1070
 
1043
 
1071
 
1044
 
1072
  cmd_len_ok:
1045
  cmd_len_ok:
1073
 
1046
 
1074
    cmp  [command],dword 'PING'  ; ping response
1047
    cmp  [command],dword 'PING'  ; ping response
1075
    jne  no_ping_responce
1048
    jne  no_ping_responce
1076
 
1049
 
1077
    call print_command_to_main
1050
    call print_command_to_main
1078
 
1051
 
1079
    mov  [command],dword 'PONG'
1052
    mov  [command],dword 'PONG'
1080
 
1053
 
1081
    call print_command_to_main
1054
    call print_command_to_main
1082
 
1055
 
1083
    mov  eax,4
1056
    mov  eax,4
1084
    mov  ebx,100*65536+3
1057
    mov  ebx,100*65536+3
1085
    mov  ecx,0xffffff
1058
    mov  ecx,0xffffff
1086
    mov  edx,command
1059
    mov  edx,command
1087
    mov  esi,[cmd]
1060
    mov  esi,[cmd]
1088
    mov  [command+esi-1],word '**'
1061
    mov  [command+esi-1],word '**'
1089
;    mcall
1062
;    mcall
1090
 
1063
 
1091
    mov  eax,53
1064
    mov  eax,53
1092
    mov  ebx,7
1065
    mov  ebx,7
1093
    mov  ecx,[socket]
1066
    mov  ecx,[socket]
1094
    mov  edx,[cmd]
1067
    mov  edx,[cmd]
1095
    sub  edx,2
1068
    sub  edx,2
1096
    and  edx,255
1069
    and  edx,255
1097
    mov  esi,command
1070
    mov  esi,command
1098
    mcall
1071
    mcall
1099
 
1072
 
1100
    mov  eax,53
1073
    mov  eax,53
1101
    mov  ebx,7
1074
    mov  ebx,7
1102
    mov  ecx,[socket]
1075
    mov  ecx,[socket]
1103
    mov  edx,2
1076
    mov  edx,2
1104
    mov  esi,linef
1077
    mov  esi,linef
1105
    mcall
1078
    mcall
1106
 
1079
 
1107
    popa
1080
    popa
1108
    ret
1081
    ret
1109
 
1082
 
1110
  linef  db  13,10
1083
  linef  db  13,10
1111
 
1084
 
1112
  no_ping_responce:
1085
  no_ping_responce:
1113
 
1086
 
1114
    mov  eax,[rxs]
1087
    mov  eax,[rxs]
1115
    imul eax,11
1088
    imul eax,11
1116
    mov  [pos],eax
1089
    mov  [pos],eax
1117
 
1090
 
1118
    mov  [command],byte '<'
1091
    mov  [command],byte '<'
1119
 
1092
 
1120
    mov  eax,command
1093
    mov  eax,command
1121
    mov  ecx,100
1094
    mov  ecx,100
1122
   new_blank:
1095
   new_blank:
1123
    cmp  [eax],byte ' '
1096
    cmp  [eax],byte ' '
1124
    je	 bl_found
1097
    je	 bl_found
1125
    inc  eax
1098
    inc  eax
1126
    loop new_blank
1099
    loop new_blank
1127
    mov  eax,50
1100
    mov  eax,50
1128
  bl_found:
1101
  bl_found:
1129
 
1102
 
1130
    inc  eax
1103
    inc  eax
1131
    mov  [command_position],eax
1104
    mov  [command_position],eax
1132
 
1105
 
1133
    mov  esi,eax
1106
    mov  esi,eax
1134
    mov  edi,irc_command
1107
    mov  edi,irc_command
1135
    mov  ecx,8
1108
    mov  ecx,8
1136
    cld
1109
    cld
1137
    rep  movsb
1110
    rep  movsb
1138
 
1111
 
1139
 
1112
 
1140
    cmp  [irc_command],'PRIV'  ; message to channel
1113
    cmp  [irc_command],'PRIV'  ; message to channel
1141
    jne  no_privmsg
1114
    jne  no_privmsg
1142
 
1115
 
1143
    ; compare nick
1116
    ; compare nick
1144
 
1117
 
1145
    mov  eax,[command_position]
1118
    mov  eax,[command_position]
1146
    add  eax,8
1119
    add  eax,8
1147
    call compare_to_nick
1120
    call compare_to_nick
1148
    cmp  [cresult],0
1121
    cmp  [cresult],0
1149
    jne  no_query_msg
1122
    jne  no_query_msg
1150
    mov  eax,command+1
1123
    mov  eax,command+1
1151
  no_query_msg:
1124
  no_query_msg:
1152
    call set_channel
1125
    call set_channel
1153
 
1126
 
1154
    mov  ecx,100 ; [cmd]
1127
    mov  ecx,100 ; [cmd]
1155
    mov  eax,command+10
1128
    mov  eax,command+10
1156
  acl3:
1129
  acl3:
1157
    cmp  [eax],byte ':'
1130
    cmp  [eax],byte ':'
1158
    je	 acl4
1131
    je	 acl4
1159
    inc  eax
1132
    inc  eax
1160
    loop acl3
1133
    loop acl3
1161
    mov  eax,10
1134
    mov  eax,10
1162
  acl4:
1135
  acl4:
1163
    inc  eax
1136
    inc  eax
1164
 
1137
 
1165
    cmp  [eax+1],dword 'ACTI'
1138
    cmp  [eax+1],dword 'ACTI'
1166
    jne  no_action
1139
    jne  no_action
1167
    push eax
1140
    push eax
1168
    mov  eax,action_header_short
1141
    mov  eax,action_header_short
1169
    mov  dl,0
1142
    mov  dl,0
1170
    call print_text
1143
    call print_text
1171
    mov  eax,command+1
1144
    mov  eax,command+1
1172
    mov  dl,'!'
1145
    mov  dl,'!'
1173
    call print_text
1146
    call print_text
1174
    mov  bl,' '
1147
    mov  bl,' '
1175
    call print_character
1148
    call print_character
1176
    pop  eax
1149
    pop  eax
1177
    add  eax,8
1150
    add  eax,8
1178
    mov  dl,0
1151
    mov  dl,0
1179
    call print_text
1152
    call print_text
1180
    popa
1153
    popa
1181
    ret
1154
    ret
1182
 
1155
 
1183
  no_action:
1156
  no_action:
1184
 
1157
 
1185
    push eax
1158
    push eax
1186
    mov  bl,10
1159
    mov  bl,10
1187
    call print_character
1160
    call print_character
1188
    mov  eax,command
1161
    mov  eax,command
1189
    mov  dl,'!'
1162
    mov  dl,'!'
1190
    call print_text
1163
    call print_text
1191
    mov  bl,'>'
1164
    mov  bl,'>'
1192
    call print_character
1165
    call print_character
1193
    mov  bl,' '
1166
    mov  bl,' '
1194
    call print_character
1167
    call print_character
1195
    pop  eax
1168
    pop  eax
1196
 
1169
 
1197
    mov  dl,0
1170
    mov  dl,0
1198
    call print_text
1171
    call print_text
1199
 
1172
 
1200
    popa
1173
    popa
1201
    ret
1174
    ret
1202
 
1175
 
1203
  no_privmsg:
1176
  no_privmsg:
1204
 
1177
 
1205
 
1178
 
1206
    cmp  [irc_command],'PART'	 ; channel leave
1179
    cmp  [irc_command],'PART'	 ; channel leave
1207
    jne  no_part
1180
    jne  no_part
1208
 
1181
 
1209
    ; compare nick
1182
    ; compare nick
1210
 
1183
 
1211
    mov  eax,command+1
1184
    mov  eax,command+1
1212
    call compare_to_nick
1185
    call compare_to_nick
1213
    cmp  [cresult],0
1186
    cmp  [cresult],0
1214
    jne  no_close_window
1187
    jne  no_close_window
1215
 
1188
 
1216
    mov  eax,[command_position]
1189
    mov  eax,[command_position]
1217
    add  eax,5
1190
    add  eax,5
1218
    call set_channel
1191
    call set_channel
1219
 
1192
 
1220
    mov  eax,[text_start]
1193
    mov  eax,[text_start]
1221
    mov  [eax+120*60+4],byte 1
1194
    mov  [eax+120*60+4],byte 1
1222
 
1195
 
1223
    popa
1196
    popa
1224
    ret
1197
    ret
1225
 
1198
 
1226
  no_close_window:
1199
  no_close_window:
1227
 
1200
 
1228
    mov  eax,[command_position]
1201
    mov  eax,[command_position]
1229
    add  eax,5
1202
    add  eax,5
1230
    call set_channel
1203
    call set_channel
1231
 
1204
 
1232
    mov  eax,action_header_red
1205
    mov  eax,action_header_red
1233
    mov  dl,0
1206
    mov  dl,0
1234
    call print_text
1207
    call print_text
1235
    mov  eax,command+1
1208
    mov  eax,command+1
1236
    mov  dl,'!'
1209
    mov  dl,'!'
1237
    mov  cl,' '
1210
    mov  cl,' '
1238
    call print_text
1211
    call print_text
1239
    mov  eax,has_left_channel
1212
    mov  eax,has_left_channel
1240
    mov  dl,0
1213
    mov  dl,0
1241
    call print_text
1214
    call print_text
1242
    mov  eax,[command_position]
1215
    mov  eax,[command_position]
1243
    add  eax,5
1216
    add  eax,5
1244
    mov  dl,' '
1217
    mov  dl,' '
1245
    call print_text
1218
    call print_text
1246
 
1219
 
1247
    popa
1220
    popa
1248
    ret
1221
    ret
1249
 
1222
 
1250
  no_part:
1223
  no_part:
1251
 
1224
 
1252
 
1225
 
1253
    cmp  [irc_command],'JOIN'	 ; channel join
1226
    cmp  [irc_command],'JOIN'	 ; channel join
1254
    jne  no_join
1227
    jne  no_join
1255
 
1228
 
1256
    ; compare nick
1229
    ; compare nick
1257
 
1230
 
1258
    mov  eax,command+1
1231
    mov  eax,command+1
1259
    call compare_to_nick
1232
    call compare_to_nick
1260
    cmp  [cresult],0
1233
    cmp  [cresult],0
1261
    jne  no_new_window
1234
    jne  no_new_window
1262
 
1235
 
1263
    mov  edi,I_END+120*80
1236
    mov  edi,I_END+120*80
1264
    mov  eax,1 ; create channel window - search for empty slot
1237
    mov  eax,1 ; create channel window - search for empty slot
1265
   newse:
1238
   newse:
1266
    mov  ebx,eax
1239
    mov  ebx,eax
1267
    shl  ebx,5
1240
    shl  ebx,5
1268
    cmp  dword [channel_list+ebx],dword '    '
1241
    cmp  dword [channel_list+ebx],dword '    '
1269
    je	 free_found
1242
    je	 free_found
1270
    add  edi,120*80
1243
    add  edi,120*80
1271
    inc  eax
1244
    inc  eax
1272
    cmp  eax,[max_windows]
1245
    cmp  eax,[max_windows]
1273
    jb	 newse
1246
    jb	 newse
1274
 
1247
 
1275
  free_found:
1248
  free_found:
1276
 
1249
 
1277
    mov  edx,[command_position]
1250
    mov  edx,[command_position]
1278
    add  edx,6
1251
    add  edx,6
1279
 
1252
 
1280
    push eax
1253
    push eax
1281
    push edx
1254
    push edx
1282
    mov  ecx,0
1255
    mov  ecx,0
1283
   finde:
1256
   finde:
1284
    inc  ecx
1257
    inc  ecx
1285
    inc  edx
1258
    inc  edx
1286
    movzx eax,byte [edx]
1259
    movzx eax,byte [edx]
1287
    cmp  eax,'#'
1260
    cmp  eax,'#'
1288
    jge  finde
1261
    jge  finde
1289
    mov  [channel_list+ebx+31],cl
1262
    mov  [channel_list+ebx+31],cl
1290
    pop  edx
1263
    pop  edx
1291
    pop  eax
1264
    pop  eax
1292
 
1265
 
1293
    call create_channel_name
1266
    call create_channel_name
1294
 
1267
 
1295
    push edi
1268
    push edi
1296
    push eax
1269
    push eax
1297
    mov  [edi+120*60+8],byte 0 ; channel window
1270
    mov  [edi+120*60+8],byte 0 ; channel window
1298
    mov  eax,32
1271
    mov  eax,32
1299
    mov  ecx,120*60
1272
    mov  ecx,120*60
1300
    cld
1273
    cld
1301
    rep  stosb
1274
    rep  stosb
1302
    pop  eax
1275
    pop  eax
1303
    pop  edi
1276
    pop  edi
1304
 
1277
 
1305
    ; eax has the free position
1278
    ; eax has the free position
1306
    mov  [thread_screen],edi
1279
    mov  [thread_screen],edi
1307
    call create_channel_window
1280
    call create_channel_window
1308
 
1281
 
1309
  no_new_window:
1282
  no_new_window:
1310
 
1283
 
1311
    mov  eax,[command_position]
1284
    mov  eax,[command_position]
1312
    add  eax,6
1285
    add  eax,6
1313
    call set_channel
1286
    call set_channel
1314
 
1287
 
1315
    mov  eax,action_header_blue
1288
    mov  eax,action_header_blue
1316
    mov  dl,0
1289
    mov  dl,0
1317
    call print_text
1290
    call print_text
1318
    mov  eax,command+1
1291
    mov  eax,command+1
1319
    mov  dl,'!'
1292
    mov  dl,'!'
1320
    mov  cl,' '
1293
    mov  cl,' '
1321
    call print_text
1294
    call print_text
1322
 
1295
 
1323
    mov  eax,joins_channel
1296
    mov  eax,joins_channel
1324
    mov  dl,0
1297
    mov  dl,0
1325
    call print_text
1298
    call print_text
1326
 
1299
 
1327
    mov  eax,[command_position]
1300
    mov  eax,[command_position]
1328
    add  eax,6
1301
    add  eax,6
1329
    mov  dl,0
1302
    mov  dl,0
1330
    call print_text
1303
    call print_text
1331
 
1304
 
1332
    popa
1305
    popa
1333
    ret
1306
    ret
1334
 
1307
 
1335
  no_join:
1308
  no_join:
1336
 
1309
 
1337
 
1310
 
1338
    cmp  [irc_command],'NICK'	   ; nick change
1311
    cmp  [irc_command],'NICK'	   ; nick change
1339
    jne  no_nick_change
1312
    jne  no_nick_change
1340
 
1313
 
1341
    mov  [text_start],I_END
1314
    mov  [text_start],I_END
1342
    add  [text_start],120*80
1315
    add  [text_start],120*80
1343
 
1316
 
1344
 new_all_channels3:
1317
 new_all_channels3:
1345
 
1318
 
1346
    mov  eax,action_header_short
1319
    mov  eax,action_header_short
1347
    mov  dl,0
1320
    mov  dl,0
1348
    call print_text
1321
    call print_text
1349
    mov  eax,command+1
1322
    mov  eax,command+1
1350
    mov  dl,'!'
1323
    mov  dl,'!'
1351
    call print_text
1324
    call print_text
1352
    mov  eax,is_now_known_as
1325
    mov  eax,is_now_known_as
1353
    mov  dl,0
1326
    mov  dl,0
1354
    call print_text
1327
    call print_text
1355
    mov  eax,[command_position]
1328
    mov  eax,[command_position]
1356
    add  eax,6
1329
    add  eax,6
1357
    mov  dl,0
1330
    mov  dl,0
1358
    call print_text
1331
    call print_text
1359
 
1332
 
1360
    add  [text_start],120*80
1333
    add  [text_start],120*80
1361
    cmp  [text_start],I_END+120*80*20
1334
    cmp  [text_start],I_END+120*80*20
1362
    jb	 new_all_channels3
1335
    jb	 new_all_channels3
1363
 
1336
 
1364
    popa
1337
    popa
1365
    ret
1338
    ret
1366
 
1339
 
1367
  no_nick_change:
1340
  no_nick_change:
1368
 
1341
 
1369
 
1342
 
1370
     cmp  [irc_command],'KICK'	    ; kick
1343
     cmp  [irc_command],'KICK'	    ; kick
1371
     jne  no_kick
1344
     jne  no_kick
1372
 
1345
 
1373
    mov  [text_start],I_END
1346
    mov  [text_start],I_END
1374
    add  [text_start],120*80
1347
    add  [text_start],120*80
1375
 
1348
 
1376
    mov  eax,[command_position]
1349
    mov  eax,[command_position]
1377
    add  eax,5
1350
    add  eax,5
1378
    call set_channel
1351
    call set_channel
1379
 
1352
 
1380
; new_all_channels4:
1353
; new_all_channels4:
1381
 
1354
 
1382
    mov  eax,action_header_short
1355
    mov  eax,action_header_short
1383
    mov  dl,0
1356
    mov  dl,0
1384
    call print_text
1357
    call print_text
1385
    mov  eax,command+1
1358
    mov  eax,command+1
1386
    mov  dl,'!'
1359
    mov  dl,'!'
1387
    call print_text
1360
    call print_text
1388
     mov  eax,kicked
1361
     mov  eax,kicked
1389
     mov  dl,0
1362
     mov  dl,0
1390
    call print_text
1363
    call print_text
1391
    mov  eax,[command_position]
1364
    mov  eax,[command_position]
1392
    add  eax,5
1365
    add  eax,5
1393
    mov  dl,0
1366
    mov  dl,0
1394
    call print_text
1367
    call print_text
1395
 
1368
 
1396
;    add  [text_start],120*80
1369
;    add  [text_start],120*80
1397
;    cmp  [text_start],I_END+120*80*20
1370
;    cmp  [text_start],I_END+120*80*20
1398
;    jb   new_all_channels4
1371
;    jb   new_all_channels4
1399
 
1372
 
1400
    popa
1373
    popa
1401
    ret
1374
    ret
1402
 
1375
 
1403
  no_kick:
1376
  no_kick:
1404
 
1377
 
1405
 
1378
 
1406
 
1379
 
1407
 
1380
 
1408
    cmp  [irc_command],'QUIT'	 ; irc quit
1381
    cmp  [irc_command],'QUIT'	 ; irc quit
1409
    jne  no_quit
1382
    jne  no_quit
1410
 
1383
 
1411
    mov  [text_start],I_END
1384
    mov  [text_start],I_END
1412
    add  [text_start],120*80
1385
    add  [text_start],120*80
1413
 
1386
 
1414
 new_all_channels2:
1387
 new_all_channels2:
1415
 
1388
 
1416
    mov  eax,action_header_red
1389
    mov  eax,action_header_red
1417
    mov  dl,0
1390
    mov  dl,0
1418
    call print_text
1391
    call print_text
1419
    mov  eax,command+1
1392
    mov  eax,command+1
1420
    mov  dl,'!'
1393
    mov  dl,'!'
1421
    call print_text
1394
    call print_text
1422
    mov  eax,has_quit_irc
1395
    mov  eax,has_quit_irc
1423
    mov  dl,0
1396
    mov  dl,0
1424
    call print_text
1397
    call print_text
1425
 
1398
 
1426
    add  [text_start],120*80
1399
    add  [text_start],120*80
1427
    cmp  [text_start],I_END+120*80*20
1400
    cmp  [text_start],I_END+120*80*20
1428
    jb	 new_all_channels2
1401
    jb	 new_all_channels2
1429
 
1402
 
1430
    popa
1403
    popa
1431
    ret
1404
    ret
1432
 
1405
 
1433
  no_quit:
1406
  no_quit:
1434
 
1407
 
1435
 
1408
 
1436
    cmp  [irc_command],dword 'MODE'  ; channel mode change
1409
    cmp  [irc_command],dword 'MODE'  ; channel mode change
1437
    jne  no_mode
1410
    jne  no_mode
1438
 
1411
 
1439
    mov  [text_start],I_END
1412
    mov  [text_start],I_END
1440
    add  [text_start],120*80
1413
    add  [text_start],120*80
1441
 
1414
 
1442
    mov  eax,[command_position]
1415
    mov  eax,[command_position]
1443
    add  eax,5
1416
    add  eax,5
1444
    call set_channel
1417
    call set_channel
1445
 
1418
 
1446
 new_all_channels:
1419
 new_all_channels:
1447
 
1420
 
1448
    mov  eax,action_header_short
1421
    mov  eax,action_header_short
1449
    mov  dl,0
1422
    mov  dl,0
1450
    call print_text
1423
    call print_text
1451
 
1424
 
1452
    call print_nick
1425
    call print_nick
1453
 
1426
 
1454
    mov  eax,sets_mode
1427
    mov  eax,sets_mode
1455
    mov  dl,0
1428
    mov  dl,0
1456
    call print_text
1429
    call print_text
1457
 
1430
 
1458
    mov  eax,[command_position]
1431
    mov  eax,[command_position]
1459
    add  eax,5
1432
    add  eax,5
1460
    mov  dl,0
1433
    mov  dl,0
1461
    call print_text
1434
    call print_text
1462
 
1435
 
1463
;    add  [text_start],120*80
1436
;    add  [text_start],120*80
1464
;    cmp  [text_start],I_END+120*80*20
1437
;    cmp  [text_start],I_END+120*80*20
1465
;    jb   new_all_channels
1438
;    jb   new_all_channels
1466
 
1439
 
1467
    popa
1440
    popa
1468
    ret
1441
    ret
1469
 
1442
 
1470
  no_mode:
1443
  no_mode:
1471
 
1444
 
1472
 
1445
 
1473
    cmp  [irc_command],dword '353 '  ; channel user names
1446
    cmp  [irc_command],dword '353 '  ; channel user names
1474
    jne  no_user_list
1447
    jne  no_user_list
1475
 
1448
 
1476
    mov  eax,[command_position]
1449
    mov  eax,[command_position]
1477
   finde2:
1450
   finde2:
1478
    inc  eax
1451
    inc  eax
1479
    cmp  [eax],byte '#'
1452
    cmp  [eax],byte '#'
1480
    jne  finde2
1453
    jne  finde2
1481
    call set_channel
1454
    call set_channel
1482
 
1455
 
1483
   finde3:
1456
   finde3:
1484
    inc  eax
1457
    inc  eax
1485
    cmp  [eax],byte ':'
1458
    cmp  [eax],byte ':'
1486
    jne  finde3
1459
    jne  finde3
1487
 
1460
 
1488
    pusha
1461
    pusha
1489
    cmp  [user_list_pos],0
1462
    cmp  [user_list_pos],0
1490
    jne  no_clear_user_list
1463
    jne  no_clear_user_list
1491
    mov  edi,[text_start]
1464
    mov  edi,[text_start]
1492
    add  edi,120*70
1465
    add  edi,120*70
1493
    mov  [edi-8],dword 0
1466
    mov  [edi-8],dword 0
1494
    mov  [edi-4],dword 0
1467
    mov  [edi-4],dword 0
1495
    mov  eax,32
1468
    mov  eax,32
1496
    mov  ecx,1200
1469
    mov  ecx,1200
1497
    cld
1470
    cld
1498
    rep  stosb
1471
    rep  stosb
1499
  no_clear_user_list:
1472
  no_clear_user_list:
1500
    popa
1473
    popa
1501
 
1474
 
1502
    push eax
1475
    push eax
1503
 
1476
 
1504
    mov  esi,eax
1477
    mov  esi,eax
1505
    inc  esi
1478
    inc  esi
1506
    mov  edi,[text_start]
1479
    mov  edi,[text_start]
1507
    add  edi,120*70
1480
    add  edi,120*70
1508
    add  edi,[user_list_pos]
1481
    add  edi,[user_list_pos]
1509
    mov  edx,edi
1482
    mov  edx,edi
1510
    mov  ecx,command
1483
    mov  ecx,command
1511
    add  ecx,[cmd]
1484
    add  ecx,[cmd]
1512
    sub  ecx,[esp]
1485
    sub  ecx,[esp]
1513
    sub  ecx,3
1486
    sub  ecx,3
1514
    and  ecx,0xfff
1487
    and  ecx,0xfff
1515
    cld
1488
    cld
1516
    rep  movsb
1489
    rep  movsb
1517
 
1490
 
1518
    pop  eax
1491
    pop  eax
1519
    mov  ebx,command
1492
    mov  ebx,command
1520
    add  ebx,[cmd]
1493
    add  ebx,[cmd]
1521
    sub  ebx,eax
1494
    sub  ebx,eax
1522
    sub  ebx,2
1495
    sub  ebx,2
1523
    mov  [edx+ebx-1],dword '    '
1496
    mov  [edx+ebx-1],dword '    '
1524
 
1497
 
1525
    add  [user_list_pos],ebx
1498
    add  [user_list_pos],ebx
1526
 
1499
 
1527
    mov  eax,[user_list_pos]
1500
    mov  eax,[user_list_pos]
1528
    mov  ebx,[text_start]
1501
    mov  ebx,[text_start]
1529
    add  ebx,120*70
1502
    add  ebx,120*70
1530
    mov  [ebx-4],eax
1503
    mov  [ebx-4],eax
1531
 
1504
 
1532
    popa
1505
    popa
1533
    ret
1506
    ret
1534
 
1507
 
1535
  user_list_pos dd 0x0
1508
  user_list_pos dd 0x0
1536
 
1509
 
1537
  no_user_list:
1510
  no_user_list:
1538
 
1511
 
1539
 
1512
 
1540
    cmp  [irc_command],dword '366 '  ; channel user names end
1513
    cmp  [irc_command],dword '366 '  ; channel user names end
1541
    jne  no_user_list_end
1514
    jne  no_user_list_end
1542
 
1515
 
1543
    mov  [user_list_pos],0
1516
    mov  [user_list_pos],0
1544
 
1517
 
1545
    popa
1518
    popa
1546
    ret
1519
    ret
1547
 
1520
 
1548
  no_user_list_end:
1521
  no_user_list_end:
1549
 
1522
 
1550
    mov  [command],byte '-'
1523
    mov  [command],byte '-'
1551
    call print_command_to_main
1524
    call print_command_to_main
1552
 
1525
 
1553
    popa
1526
    popa
1554
 
1527
 
1555
    ret
1528
    ret
1556
 
1529
 
1557
 
1530
 
1558
cresult db 0
1531
cresult db 0
1559
 
1532
 
1560
compare_to_nick:
1533
compare_to_nick:
1561
 
1534
 
1562
; input  : eax = start of compare
1535
; input  : eax = start of compare
1563
; output : [cresult] = 0 if match, [cresult]=1 if no match
1536
; output : [cresult] = 0 if match, [cresult]=1 if no match
1564
 
1537
 
1565
 
1538
 
1566
    pusha
1539
    pusha
1567
 
1540
 
1568
    mov  esi,eax
1541
    mov  esi,eax
1569
    mov  edi,0
1542
    mov  edi,0
1570
 
1543
 
1571
  new_nick_compare:
1544
  new_nick_compare:
1572
 
1545
 
1573
    mov  bl,byte [esi]
1546
    mov  bl,byte [esi]
1574
    mov  cl,byte [user_nick+4+edi]
1547
    mov  cl,byte [user_nick+4+edi]
1575
 
1548
 
1576
    cmp  bl,cl
1549
    cmp  bl,cl
1577
    jne  nonickm
1550
    jne  nonickm
1578
 
1551
 
1579
    add  esi,1
1552
    add  esi,1
1580
    add  edi,1
1553
    add  edi,1
1581
 
1554
 
1582
    cmp  edi,[user_nick]
1555
    cmp  edi,[user_nick]
1583
    jb	 new_nick_compare
1556
    jb	 new_nick_compare
1584
 
1557
 
1585
    movzx eax,byte [esi]
1558
    movzx eax,byte [esi]
1586
    cmp  eax,40
1559
    cmp  eax,40
1587
    jge  nonickm
1560
    jge  nonickm
1588
 
1561
 
1589
    popa
1562
    popa
1590
    mov  [cresult],0
1563
    mov  [cresult],0
1591
    ret
1564
    ret
1592
 
1565
 
1593
  nonickm:
1566
  nonickm:
1594
 
1567
 
1595
    popa
1568
    popa
1596
    mov  [cresult],1
1569
    mov  [cresult],1
1597
    ret
1570
    ret
1598
 
1571
 
1599
 
1572
 
1600
 
1573
 
1601
 
1574
 
1602
 
1575
 
1603
print_command_to_main:
1576
print_command_to_main:
1604
 
1577
 
1605
    pusha
1578
    pusha
1606
 
1579
 
1607
    mov  [text_start],I_END
1580
    mov  [text_start],I_END
1608
    mov  ecx,[rxs]
1581
    mov  ecx,[rxs]
1609
    imul ecx,11
1582
    imul ecx,11
1610
    mov  [pos],ecx
1583
    mov  [pos],ecx
1611
 
1584
 
1612
    mov  bl,13
1585
    mov  bl,13
1613
    call print_character
1586
    call print_character
1614
    mov  bl,10
1587
    mov  bl,10
1615
    call print_character
1588
    call print_character
1616
 
1589
 
1617
    mov  ecx,[cmd]
1590
    mov  ecx,[cmd]
1618
    sub  ecx,2
1591
    sub  ecx,2
1619
    mov  esi,command
1592
    mov  esi,command
1620
   newcmdc2:
1593
   newcmdc2:
1621
    mov  bl,[esi]
1594
    mov  bl,[esi]
1622
    call print_character
1595
    call print_character
1623
    inc  esi
1596
    inc  esi
1624
    loop newcmdc2
1597
    loop newcmdc2
1625
 
1598
 
1626
    mov   edx,I_END
1599
    mov   edx,I_END
1627
    call  draw_channel_text
1600
    call  draw_channel_text
1628
 
1601
 
1629
    popa
1602
    popa
1630
 
1603
 
1631
    ret
1604
    ret
1632
 
1605
 
1633
 
1606
 
1634
 
1607
 
1635
 
1608
 
1636
print_text:
1609
print_text:
1637
 
1610
 
1638
    pusha
1611
    pusha
1639
 
1612
 
1640
    mov  ecx,command-2
1613
    mov  ecx,command-2
1641
    add  ecx,[cmd]
1614
    add  ecx,[cmd]
1642
 
1615
 
1643
  ptr2:
1616
  ptr2:
1644
    mov  bl,[eax]
1617
    mov  bl,[eax]
1645
    cmp  bl,dl
1618
    cmp  bl,dl
1646
    je	 ptr_ret
1619
    je	 ptr_ret
1647
    cmp  bl,0
1620
    cmp  bl,0
1648
    je	 ptr_ret
1621
    je	 ptr_ret
1649
    call print_character
1622
    call print_character
1650
    inc  eax
1623
    inc  eax
1651
    cmp  eax,ecx
1624
    cmp  eax,ecx
1652
    jbe  ptr2
1625
    jbe  ptr2
1653
 
1626
 
1654
  ptr_ret:
1627
  ptr_ret:
1655
 
1628
 
1656
    mov  eax,[text_start]
1629
    mov  eax,[text_start]
1657
    mov  [eax+120*60],byte 1
1630
    mov  [eax+120*60],byte 1
1658
 
1631
 
1659
    popa
1632
    popa
1660
    ret
1633
    ret
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
1670
  db $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF ; E
1643
  db $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF ; E
1671
  db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; F
1644
  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
1680
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; D
1654
  db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; D
1681
  db $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF ; E
1655
  db $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF ; E
1682
  db $A8,$B8,'?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; F
1656
  db $A8,$B8,$AA,$BA,$AF,$BF,$A1,$A2 , $B0,$95,$B7,'?',$B9,$A4,'?','?' ; F
-
 
1657
 
1683
;    0   1   2   3   4   5   6   7     8   9   A   B   C   D   E   F
1658
;    0   1   2   3   4   5   6   7     8   9   A   B   C   D   E   F
1684
 
1659
 
1685
print_character:
1660
print_character:
1686
 
1661
 
1687
    pusha
1662
    pusha
1688
 
1663
 
1689
    cmp  bl,13	   ; line beginning
1664
    cmp  bl,13	   ; line beginning
1690
    jne  nobol
1665
    jne  nobol
1691
    mov  ecx,[pos]
1666
    mov  ecx,[pos]
1692
    add  ecx,1
1667
    add  ecx,1
1693
  boll1:
1668
  boll1:
1694
    sub  ecx,1
1669
    sub  ecx,1
1695
    mov  eax,ecx
1670
    mov  eax,ecx
1696
    xor  edx,edx
1671
    xor  edx,edx
1697
    mov  ebx,[rxs]
1672
    mov  ebx,[rxs]
1698
    div  ebx
1673
    div  ebx
1699
    cmp  edx,0
1674
    cmp  edx,0
1700
    jne  boll1
1675
    jne  boll1
1701
    mov  [pos],ecx
1676
    mov  [pos],ecx
1702
    jmp  newdata
1677
    jmp  newdata
1703
  nobol:
1678
  nobol:
1704
 
1679
 
1705
    cmp  bl,10	   ; line down
1680
    cmp  bl,10	   ; line down
1706
    jne  nolf
1681
    jne  nolf
1707
   addx1:
1682
   addx1:
1708
    add  [pos],dword 1
1683
    add  [pos],dword 1
1709
    mov  eax,[pos]
1684
    mov  eax,[pos]
1710
    xor  edx,edx
1685
    xor  edx,edx
1711
    mov  ecx,[rxs]
1686
    mov  ecx,[rxs]
1712
    div  ecx
1687
    div  ecx
1713
    cmp  edx,0
1688
    cmp  edx,0
1714
    jnz  addx1
1689
    jnz  addx1
1715
    mov  eax,[pos]
1690
    mov  eax,[pos]
1716
    jmp  cm1
1691
    jmp  cm1
1717
  nolf:
1692
  nolf:
1718
  no_lf_ret:
1693
  no_lf_ret:
1719
 
1694
 
1720
 
1695
 
1721
    cmp  bl,15	  ; character
1696
    cmp  bl,15	  ; character
1722
    jbe  newdata
1697
    jbe  newdata
1723
 
1698
 
1724
    mov  eax,[irc_data]
1699
    mov  eax,[irc_data]
1725
    shl  eax,8
1700
    shl  eax,8
1726
    mov  al,bl
1701
    mov  al,bl
1727
    mov  [irc_data],eax
1702
    mov  [irc_data],eax
1728
 
1703
 
1729
    mov  eax,[pos]
1704
    mov  eax,[pos]
1730
    call draw_data
1705
    call draw_data
1731
 
1706
 
1732
    mov  eax,[pos]
1707
    mov  eax,[pos]
1733
    add  eax,1
1708
    add  eax,1
1734
  cm1:
1709
  cm1:
1735
    mov  ebx,[scroll+4]
1710
    mov  ebx,[scroll+4]
1736
    imul ebx,[rxs]
1711
    imul ebx,[rxs]
1737
    cmp  eax,ebx
1712
    cmp  eax,ebx
1738
    jb	 noeaxz
1713
    jb	 noeaxz
1739
 
1714
 
1740
    mov  esi,[text_start]
1715
    mov  esi,[text_start]
1741
    add  esi,[rxs]
1716
    add  esi,[rxs]
1742
 
1717
 
1743
    mov  edi,[text_start]
1718
    mov  edi,[text_start]
1744
    mov  ecx,ebx
1719
    mov  ecx,ebx
1745
    cld
1720
    cld
1746
    rep  movsb
1721
    rep  movsb
1747
 
1722
 
1748
    mov  esi,[text_start]
1723
    mov  esi,[text_start]
1749
    mov  ecx,[rxs]
1724
    mov  ecx,[rxs]
1750
    imul ecx,61
1725
    imul ecx,61
1751
    add  esi,ecx
1726
    add  esi,ecx
1752
 
1727
 
1753
    mov  edi,[text_start]
1728
    mov  edi,[text_start]
1754
    mov  ecx,[rxs]
1729
    mov  ecx,[rxs]
1755
    imul ecx,60
1730
    imul ecx,60
1756
    add  edi,ecx
1731
    add  edi,ecx
1757
    mov  ecx,ebx
1732
    mov  ecx,ebx
1758
    cld
1733
    cld
1759
    rep  movsb
1734
    rep  movsb
1760
 
1735
 
1761
    mov  eax,ebx
1736
    mov  eax,ebx
1762
    sub  eax,[rxs]
1737
    sub  eax,[rxs]
1763
  noeaxz:
1738
  noeaxz:
1764
    mov  [pos],eax
1739
    mov  [pos],eax
1765
 
1740
 
1766
  newdata:
1741
  newdata:
1767
 
1742
 
1768
    mov  eax,[text_start]
1743
    mov  eax,[text_start]
1769
    mov  [eax+120*60],byte 1
1744
    mov  [eax+120*60],byte 1
1770
 
1745
 
1771
    popa
1746
    popa
1772
    ret
1747
    ret
1773
 
1748
 
1774
 
1749
 
1775
 
1750
 
1776
draw_data:
1751
draw_data:
1777
 
1752
 
1778
    pusha
1753
    pusha
1779
 
1754
 
1780
    and  ebx,0xff
1755
    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:
-
 
1795
 
-
 
1796
    add  eax,[text_start]
1756
    add  eax,[text_start]
1797
    mov  [eax],bl
1757
    mov  [eax],bl
1798
 
1758
 
1799
    popa
1759
    popa
1800
    ret
1760
    ret
1801
 
1761
 
1802
 
1762
 
1803
read_incoming_byte:
1763
read_incoming_byte:
1804
 
1764
 
1805
    mov  eax, 53
1765
    mov  eax, 53
1806
    mov  ebx, 2
1766
    mov  ebx, 2
1807
    mov  ecx, [socket]
1767
    mov  ecx, [socket]
1808
    mcall
1768
    mcall
1809
 
1769
 
1810
    mov  ecx,-1
1770
    mov  ecx,-1
1811
 
1771
 
1812
    cmp  eax,0
1772
    cmp  eax,0
1813
    je	 no_more_data
1773
    je	 no_more_data
1814
 
1774
 
1815
    mov  eax, 53
1775
    mov  eax, 53
1816
    mov  ebx, 3
1776
    mov  ebx, 3
1817
    mov  ecx, [socket]
1777
    mov  ecx, [socket]
1818
    mcall
1778
    mcall
1819
 
1779
 
1820
	cmp	bl,0x80
1780
	cmp	bl,0x80
1821
	jb	@f
1781
	jb	@f
1822
	and	ebx,0x7F
1782
	and	ebx,0x7F
1823
	mov	bl,[cp1251_table+ebx]
1783
	mov	bl,[cp1251_table+ebx]
1824
    @@:
1784
    @@:
1825
 
1785
 
1826
    mov  ecx,0
1786
    mov  ecx,0
1827
 
1787
 
1828
  no_more_data:
1788
  no_more_data:
1829
 
1789
 
1830
    ret
1790
    ret
1831
 
1791
 
1832
 
1792
 
1833
 
1793
 
1834
draw_window:
1794
draw_window:
1835
 
1795
 
1836
    pusha
1796
    pusha
1837
 
1797
 
1838
    mov  eax,12
1798
    mov  eax,12
1839
    mov  ebx,1
1799
    mov  ebx,1
1840
    mcall
1800
    mcall
1841
 
1801
 
1842
    mov  [old_status],300
1802
    mov  [old_status],300
1843
 
1803
 
1844
    xor  eax,eax		   ; draw window
1804
    xor  eax,eax		   ; draw window
1845
    mov  ebx,5*65536+499
1805
    mov  ebx,5*65536+499
1846
    mov  ecx,5*65536+345
1806
    mov  ecx,5*65536+345
1847
    mov  edx,[wcolor]
1807
    mov  edx,[wcolor]
1848
    add  edx,0x14ffffff
1808
    add  edx,0x14ffffff
1849
    mov  edi,title
1809
    mov  edi,title
1850
    mcall
1810
    mcall
1851
 
1811
 
1852
    mov  eax,8			   ; button: open socket
1812
    mov  eax,8			   ; button: open socket
1853
    mov  ebx,43*65536+22
1813
    mov  ebx,43*65536+22
1854
    mov  ecx,229*65536+10
1814
    mov  ecx,229*65536+10
1855
    mov  edx,22
1815
    mov  edx,22
1856
    mov  esi,[main_button]
1816
    mov  esi,[main_button]
1857
    mcall
1817
    mcall
1858
 
1818
 
1859
    ;mov  eax,8			   ; button: send userinfo
1819
    ;mov  eax,8			   ; button: send userinfo
1860
    mov  ebx,180*65536+22
1820
    mov  ebx,180*65536+22
1861
    mov  ecx,229*65536+10
1821
    mov  ecx,229*65536+10
1862
    mov  edx,23
1822
    mov  edx,23
1863
    mcall
1823
    mcall
1864
 
1824
 
1865
    ;mov  eax,8			   ; button: close socket
1825
    ;mov  eax,8			   ; button: close socket
1866
    mov  ebx,317*65536+22
1826
    mov  ebx,317*65536+22
1867
    mov  ecx,229*65536+10
1827
    mov  ecx,229*65536+10
1868
    mov  edx,24
1828
    mov  edx,24
1869
    mcall
1829
    mcall
1870
 
1830
 
1871
    mov  eax,38 		   ; line
1831
    mov  eax,38 		   ; line
1872
    mov  ebx,5*65536+494
1832
    mov  ebx,5*65536+494
1873
    mov  ecx,148*65536+148
1833
    mov  ecx,148*65536+148
1874
    mov  edx,[main_line]
1834
    mov  edx,[main_line]
1875
    mcall
1835
    mcall
1876
    add  ecx,1*65536+1
1836
    add  ecx,1*65536+1
1877
 
1837
 
1878
    mov  eax,38 		   ; line
1838
    mov  eax,38 		   ; line
1879
    mov  ebx,5*65536+494
1839
    mov  ebx,5*65536+494
1880
    mov  ecx,166*65536+166
1840
    mov  ecx,166*65536+166
1881
    mcall
1841
    mcall
1882
    add  ecx,1*65536+1
1842
    add  ecx,1*65536+1
1883
 
1843
 
1884
    mov  eax,38 		   ; line
1844
    mov  eax,38 		   ; line
1885
    mov  ebx,410*65536+410
1845
    mov  ebx,410*65536+410
1886
    mov  ecx,22*65536+148
1846
    mov  ecx,22*65536+148
1887
    mcall
1847
    mcall
1888
    add  ebx,1*65536+1
1848
    add  ebx,1*65536+1
1889
 
1849
 
1890
    mov  ebx,25*65536+183	   ; info text
1850
    mov  ebx,25*65536+183	   ; info text
1891
    mov  ecx,0x000000
1851
    mov  ecx,0x000000
1892
    mov  edx,text
1852
    mov  edx,text
1893
    mov  esi,70
1853
    mov  esi,70
1894
  newline:
1854
  newline:
1895
    mov  eax,4
1855
    mov  eax,4
1896
    mcall
1856
    mcall
1897
    add  ebx,12
1857
    add  ebx,12
1898
    add  edx,70
1858
    add  edx,70
1899
    cmp  [edx],byte 'x'
1859
    cmp  [edx],byte 'x'
1900
    jne  newline
1860
    jne  newline
1901
 
1861
 
1902
    mov  edx,I_END		  ; text from server
1862
    mov  edx,I_END		  ; text from server
1903
    call draw_channel_text
1863
    call draw_channel_text
1904
 
1864
 
1905
    mov  eax,12
1865
    mov  eax,12
1906
    mov  ebx,2
1866
    mov  ebx,2
1907
    mcall
1867
    mcall
1908
 
1868
 
1909
    popa
1869
    popa
1910
 
1870
 
1911
    ret
1871
    ret
1912
 
1872
 
1913
main_line    dd 0x000000
1873
main_line    dd 0x000000
1914
main_button  dd 0x6565cc
1874
main_button  dd 0x6565cc
1915
 
1875
 
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                     '
1888
db '   /part #ChannelName         - eg /part #windows                     '
1929
db '   /query Nickname            - eg /query Mary                        '
1889
db '   /query Nickname            - eg /query Mary                        '
1930
db '   /quit                      - Quit server and Close socket          '
1890
db '   /quit                      - Quit server and Close socket          '
1931
 
-
 
1932
db 'x' ; <- END MARKER, DONT DELETE
1891
db 'x' ; <- END MARKER, DONT DELETE
1933
 
1892
 
1934
 
1893
 
1935
 
1894
 
1936
 
1895
 
1937
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1896
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1938
;
1897
;
1939
;                        CHANNEL THREADS
1898
;                        CHANNEL THREADS
1940
;
1899
;
1941
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1900
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1942
 
1901
 
1943
 
1902
 
1944
 
1903
 
1945
channel_thread:
1904
channel_thread:
1946
 
1905
 
1947
    mov   ebp,[thread_nro]
1906
    mov   ebp,[thread_nro]
1948
    mov   eax,ebp
1907
    mov   eax,ebp
1949
    shl   eax,14
1908
    shl   eax,14
1950
    add   eax,0x80000
1909
    add   eax,0x80000
1951
    mov   esp,eax
1910
    mov   esp,eax
1952
 
1911
 
1953
    mov   edi,ebp	 ; clear thread memory
1912
    mov   edi,ebp	 ; clear thread memory
1954
    imul  edi,120*80
1913
    imul  edi,120*80
1955
    add   edi,I_END
1914
    add   edi,I_END
1956
    mov   ecx,120*80
1915
    mov   ecx,120*80
1957
    mov   eax,32
1916
    mov   eax,32
1958
    cld
1917
    cld
1959
;    rep   stosb
1918
;    rep   stosb
1960
 
1919
 
1961
    mov   edx,[thread_screen]
1920
    mov   edx,[thread_screen]
1962
 
1921
 
1963
    call  thread_draw_window
1922
    call  thread_draw_window
1964
 
1923
 
1965
  w_t:
1924
  w_t:
1966
 
1925
 
1967
    mov  esi,ebp
1926
    mov  esi,ebp
1968
    imul esi,120*80
1927
    imul esi,120*80
1969
    add  esi,I_END
1928
    add  esi,I_END
1970
    cmp  [esi+120*60+4],byte 1
1929
    cmp  [esi+120*60+4],byte 1
1971
    jne  no_channel_leave
1930
    jne  no_channel_leave
1972
    mov  [esi+120*60+4],byte 0
1931
    mov  [esi+120*60+4],byte 0
1973
    mov  edi,ebp
1932
    mov  edi,ebp
1974
    shl  edi,5
1933
    shl  edi,5
1975
    mov  dword [channel_list+edi],dword '    '
1934
    mov  dword [channel_list+edi],dword '    '
1976
    mov  byte  [channel_list+edi+31],byte 1
1935
    mov  byte  [channel_list+edi+31],byte 1
1977
    mov  eax,-1
1936
    mov  eax,-1
1978
    mcall
1937
    mcall
1979
  no_channel_leave:
1938
  no_channel_leave:
1980
 
1939
 
1981
    call  check_mouse
1940
    call  check_mouse
1982
 
1941
 
1983
    mov   eax,23
1942
    mov   eax,23
1984
    mov   ebx,1
1943
    mov   ebx,1
1985
    mcall
1944
    mcall
1986
 
1945
 
1987
    cmp   eax,1
1946
    cmp   eax,1
1988
    jne   no_draw_window
1947
    jne   no_draw_window
1989
    call  thread_draw_window
1948
    call  thread_draw_window
1990
    call  draw_channel_text
1949
    call  draw_channel_text
1991
    call  print_user_list
1950
    call  print_user_list
1992
  no_draw_window:
1951
  no_draw_window:
1993
 
1952
 
1994
    cmp   eax,2
1953
    cmp   eax,2
1995
    je	  thread_key
1954
    je	  thread_key
1996
 
1955
 
1997
    cmp   eax,3
1956
    cmp   eax,3
1998
    jne   no_end
1957
    jne   no_end
1999
    mov   eax,17
1958
    mov   eax,17
2000
    mcall
1959
    mcall
2001
    mov   eax,ebp
1960
    mov   eax,ebp
2002
    imul  eax,120*80
1961
    imul  eax,120*80
2003
    add   eax,I_END
1962
    add   eax,I_END
2004
    cmp   [eax+120*60+8],byte 0 ; channel window
1963
    cmp   [eax+120*60+8],byte 0 ; channel window
2005
    je	  not_close
1964
    je	  not_close
2006
    mov   eax,ebp
1965
    mov   eax,ebp
2007
    shl   eax,5
1966
    shl   eax,5
2008
    add   eax,channel_list
1967
    add   eax,channel_list
2009
    mov   [eax],dword '    '
1968
    mov   [eax],dword '    '
2010
    mov   [eax+31],byte 1
1969
    mov   [eax+31],byte 1
2011
    mov   eax,-1
1970
    mov   eax,-1
2012
    mcall
1971
    mcall
2013
  not_close:
1972
  not_close:
2014
    mov   [text_start],eax
1973
    mov   [text_start],eax
2015
    mov   eax,nocl
1974
    mov   eax,nocl
2016
  newcc:
1975
  newcc:
2017
    mov   bl,[eax]
1976
    mov   bl,[eax]
2018
    call  print_character
1977
    call  print_character
2019
    inc   eax
1978
    inc   eax
2020
    cmp   [eax],byte 0
1979
    cmp   [eax],byte 0
2021
    jne   newcc
1980
    jne   newcc
2022
    call  draw_channel_text
1981
    call  draw_channel_text
2023
    jmp   w_t
1982
    jmp   w_t
2024
   nocl:   db  13,10,'To exit channel, use PART or QUIT command.',0
1983
   nocl:   db  13,10,'To exit channel, use PART or QUIT command.',0
2025
   no_end:
1984
   no_end:
2026
 
1985
 
2027
    cmp   [edx+120*60],byte 1
1986
    cmp   [edx+120*60],byte 1
2028
    jne   no_update
1987
    jne   no_update
2029
    mov   [edx+120*60],byte 0
1988
    mov   [edx+120*60],byte 0
2030
    call  draw_channel_text
1989
    call  draw_channel_text
2031
  no_update:
1990
  no_update:
2032
 
1991
 
2033
    test [cursor_on_off],0x3f
1992
    test [cursor_on_off],0x3f
2034
    jnz   nopri2
1993
    jnz   nopri2
2035
 
1994
 
2036
    call  blink_cursor
1995
    call  blink_cursor
2037
    call  print_user_list
1996
    call  print_user_list
2038
 
1997
 
2039
  nopri2:
1998
  nopri2:
2040
 
1999
 
2041
    jmp   w_t
2000
    jmp   w_t
2042
 
2001
 
2043
 
2002
 
2044
 
2003
 
2045
check_mouse:
2004
check_mouse:
2046
 
2005
 
2047
    pusha
2006
    pusha
2048
 
2007
 
2049
    mov  eax,37
2008
    mov  eax,37
2050
    mov  ebx,1
2009
    mov  ebx,1
2051
    mcall
2010
    mcall
2052
 
2011
 
2053
    mov  ebx,eax
2012
    mov  ebx,eax
2054
    shr  eax,16
2013
    shr  eax,16
2055
    and  ebx,0xffff
2014
    and  ebx,0xffff
2056
 
2015
 
2057
    cmp  eax,420
2016
    cmp  eax,420
2058
    jb	 no_mouse
2017
    jb	 no_mouse
2059
    cmp  eax,494
2018
    cmp  eax,494
2060
    jg	 no_mouse
2019
    jg	 no_mouse
2061
 
2020
 
2062
    cmp  ebx,145
2021
    cmp  ebx,145
2063
    jg	 no_mouse
2022
    jg	 no_mouse
2064
    cmp  ebx,23
2023
    cmp  ebx,23
2065
    jb	 no_mouse
2024
    jb	 no_mouse
2066
 
2025
 
2067
 
2026
 
2068
    cmp  ebx,100
2027
    cmp  ebx,100
2069
    jb	 no_plus
2028
    jb	 no_plus
2070
    mov  eax,ebp
2029
    mov  eax,ebp
2071
    imul eax,120*80
2030
    imul eax,120*80
2072
    add  eax,120*70+I_END
2031
    add  eax,120*70+I_END
2073
    inc  dword [eax-8]
2032
    inc  dword [eax-8]
2074
    call print_user_list
2033
    call print_user_list
2075
    mov  eax,5
2034
    mov  eax,5
2076
    mov  ebx,8
2035
    mov  ebx,8
2077
    mcall
2036
    mcall
2078
    jmp  no_mouse
2037
    jmp  no_mouse
2079
  no_plus:
2038
  no_plus:
2080
 
2039
 
2081
    cmp  ebx,80
2040
    cmp  ebx,80
2082
    jg	 no_mouse
2041
    jg	 no_mouse
2083
    mov  eax,ebp
2042
    mov  eax,ebp
2084
    imul eax,120*80
2043
    imul eax,120*80
2085
    add  eax,120*70+I_END
2044
    add  eax,120*70+I_END
2086
    cmp  dword [eax-8],dword 0
2045
    cmp  dword [eax-8],dword 0
2087
    je	 no_mouse
2046
    je	 no_mouse
2088
    dec  dword [eax-8]
2047
    dec  dword [eax-8]
2089
    call print_user_list
2048
    call print_user_list
2090
    mov  eax,5
2049
    mov  eax,5
2091
    mov  ebx,8
2050
    mov  ebx,8
2092
    mcall
2051
    mcall
2093
 
2052
 
2094
  no_minus:
2053
  no_minus:
2095
 
2054
 
2096
  no_mouse:
2055
  no_mouse:
2097
 
2056
 
2098
    popa
2057
    popa
2099
 
2058
 
2100
    ret
2059
    ret
2101
 
2060
 
2102
 
2061
 
2103
 
2062
 
2104
 
2063
 
2105
thread_key:
2064
thread_key:
2106
 
2065
 
2107
    mov  eax,2
2066
    mov  eax,2
2108
    mcall
2067
    mcall
2109
 
2068
 
2110
    shr  eax,8
2069
    shr  eax,8
2111
 
2070
 
2112
    cmp  eax,8
2071
    cmp  eax,8
2113
    jne  no_bks
2072
    jne  no_bks
2114
    cmp  [xpos],0
2073
    cmp  [xpos],0
2115
    je	 w_t
2074
    je	 w_t
2116
    dec  [xpos]
2075
    dec  [xpos]
2117
    call print_entry
2076
    call print_entry
2118
    jmp  w_t
2077
    jmp  w_t
2119
   no_bks:
2078
   no_bks:
2120
 
2079
 
2121
    cmp  eax,20
2080
    cmp  eax,20
2122
    jbe  no_character
2081
    jbe  no_character
2123
    mov  ebx,[xpos]
2082
    mov  ebx,[xpos]
2124
    mov  [send_string+ebx],al
2083
    mov  [send_string+ebx],al
2125
    inc  [xpos]
2084
    inc  [xpos]
2126
    cmp  [xpos],80
2085
    cmp  [xpos],80
2127
    jb	 xpok
2086
    jb	 xpok
2128
    mov  [xpos],79
2087
    mov  [xpos],79
2129
  xpok:
2088
  xpok:
2130
    call print_entry
2089
    call print_entry
2131
    jmp  w_t
2090
    jmp  w_t
2132
  no_character:
2091
  no_character:
2133
 
2092
 
2134
    cmp  eax,13
2093
    cmp  eax,13
2135
    jne  no_send
2094
    jne  no_send
2136
    cmp  [xpos],0
2095
    cmp  [xpos],0
2137
    je	 no_send
2096
    je	 no_send
2138
    mov  dword [send_to_channel],ebp
2097
    mov  dword [send_to_channel],ebp
2139
    mov  [send_to_server],1
2098
    mov  [send_to_server],1
2140
  wait_for_sending:
2099
  wait_for_sending:
2141
    mov  eax,5
2100
    mov  eax,5
2142
    mov  ebx,1
2101
    mov  ebx,1
2143
    mcall
2102
    mcall
2144
    cmp  [send_to_server],1
2103
    cmp  [send_to_server],1
2145
    je	 wait_for_sending
2104
    je	 wait_for_sending
2146
    call draw_channel_text
2105
    call draw_channel_text
2147
    call print_entry
2106
    call print_entry
2148
    jmp  w_t
2107
    jmp  w_t
2149
  no_send:
2108
  no_send:
2150
 
2109
 
2151
    jmp  w_t
2110
    jmp  w_t
2152
 
2111
 
2153
 
2112
 
2154
 
2113
 
2155
 
2114
 
2156
 
2115
 
2157
 
2116
 
2158
draw_channel_text:
2117
draw_channel_text:
2159
 
2118
 
2160
    pusha
2119
    pusha
2161
 
2120
 
2162
    mov   eax,4
2121
    mov   eax,4
2163
    mov   ebx,10*65536+26
2122
    mov   ebx,10*65536+26
2164
    mov   ecx,12
2123
    mov   ecx,12
2165
    mov   esi,[rxs]
2124
    mov   esi,[rxs]
2166
  dct:
2125
  dct:
2167
    pusha
2126
    pusha
2168
    mov   cx,bx
2127
    mov   cx,bx
2169
    shl   ecx,16
2128
    shl   ecx,16
2170
    mov   cx,9
2129
    mov   cx,9
2171
    mov   eax,13
2130
    mov   eax,13
2172
    mov   ebx,10*65536
2131
    mov   ebx,10*65536
2173
    mov   bx,word [rxs]
2132
    mov   bx,word [rxs]
2174
    imul  bx,6
2133
    imul  bx,6
2175
    mov   edx,0xffffff
2134
    mov   edx,0xffffff
2176
    mcall
2135
    mcall
2177
    popa
2136
    popa
2178
    push  ecx
2137
    push  ecx
2179
    mov   eax,4
2138
    mov   eax,4
2180
    mov   ecx,0
2139
    mov   ecx,0
2181
    cmp   [edx],word '* '
2140
    cmp   [edx],word '* '
2182
    jne   no_red
2141
    jne   no_red
2183
    mov   ecx,0x0000ff
2142
    mov   ecx,0x0000ff
2184
   no_red:
2143
   no_red:
2185
    cmp   [edx],word '**'
2144
    cmp   [edx],word '**'
2186
    jne   no_light_blue
2145
    jne   no_light_blue
2187
    cmp   [edx+2],byte '*'
2146
    cmp   [edx+2],byte '*'
2188
    jne   no_light_blue
2147
    jne   no_light_blue
2189
    mov   ecx,0x0000ff
2148
    mov   ecx,0x0000ff
2190
  no_light_blue:
2149
  no_light_blue:
2191
    cmp   [edx],byte '#'
2150
    cmp   [edx],byte '#'
2192
    jne   no_blue
2151
    jne   no_blue
2193
    mov   ecx,0x0000ff
2152
    mov   ecx,0x0000ff
2194
  no_blue:
2153
  no_blue:
2195
    mcall
2154
    mcall
2196
    add   edx,[rxs]
2155
    add   edx,[rxs]
2197
    add   ebx,10
2156
    add   ebx,10
2198
    pop   ecx
2157
    pop   ecx
2199
    loop  dct
2158
    loop  dct
2200
 
2159
 
2201
    popa
2160
    popa
2202
    ret
2161
    ret
2203
 
2162
 
2204
 
2163
 
2205
 
2164
 
2206
 
2165
 
2207
 
2166
 
2208
thread_draw_window:
2167
thread_draw_window:
2209
 
2168
 
2210
    pusha
2169
    pusha
2211
 
2170
 
2212
    mov  eax,12
2171
    mov  eax,12
2213
    mov  ebx,1
2172
    mov  ebx,1
2214
    mcall
2173
    mcall
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
2221
    mov  cx,170
2180
    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
-
 
2229
 
2181
 
2230
    mov  edx,[wcolor]
2182
    mov  edx,[wcolor]
2231
    add  edx,0x03ffffff
2183
    add  edx,0x03ffffff
2232
    mov  esi,0x80555599
2184
    mov  esi,0x80555599
2233
    mov  edi,0x00ffffff
2185
    mov  edi,0x00ffffff
2234
 
2186
 
2235
    mcall
2187
    mcall
2236
 
2188
 
2237
    mov  eax,ebp		   ; label
2189
    mov  eax,ebp		   ; label
2238
    add  eax,48
2190
    add  eax,48
2239
    mov  [labelc+14],al
2191
    mov  [labelc+14],al
2240
    mov  eax,ebp
2192
    mov  eax,ebp
2241
    shl  eax,5
2193
    shl  eax,5
2242
    add  eax,channel_list
2194
    add  eax,channel_list
2243
    mov  esi,eax
2195
    mov  esi,eax
2244
    mov  edi,labelc+17
2196
    mov  edi,labelc+17
2245
    movzx ecx,byte [eax+31]
2197
    movzx ecx,byte [eax+31]
2246
    cld
2198
    cld
2247
    rep   movsb
2199
    rep   movsb
2248
 
2200
 
2249
    mov  esi,17 		   ; print label
2201
    mov  esi,17 		   ; print label
2250
    movzx ebx,byte [eax+31]
2202
    movzx ebx,byte [eax+31]
2251
    add  esi,ebx
2203
    add  esi,ebx
2252
    mov  eax,4
2204
    mov  eax,4
2253
    mov  ebx,9*65536+8
2205
    mov  ebx,9*65536+8
2254
    mov  ecx,0x00ffffff
2206
    mov  ecx,0x00ffffff
2255
    mov  edx,labelc
2207
    mov  edx,labelc
2256
    mcall
2208
    mcall
2257
 
2209
 
2258
    mov  eax,38 		   ; line
2210
    mov  eax,38 		   ; line
2259
    mov  ebx,5*65536+494
2211
    mov  ebx,5*65536+494
2260
    mov  ecx,148*65536+148
2212
    mov  ecx,148*65536+148
2261
    mov  edx,[channel_line_sun]
2213
    mov  edx,[channel_line_sun]
2262
    mcall
2214
    mcall
2263
    add  ecx,1*65536+1
2215
    add  ecx,1*65536+1
2264
    mov  edx,[channel_line_shadow]
2216
    mov  edx,[channel_line_shadow]
2265
    mcall
2217
    mcall
2266
 
2218
 
2267
 
2219
 
2268
    ;mov  eax,38 		   ; line
2220
    ;mov  eax,38 		   ; line
2269
    mov  ebx,410*65536+410
2221
    mov  ebx,410*65536+410
2270
    mov  ecx,22*65536+148
2222
    mov  ecx,22*65536+148
2271
    mov  edx,[channel_line_sun]
2223
    mov  edx,[channel_line_sun]
2272
    mcall
2224
    mcall
2273
    add  ebx,1*65536+1
2225
    add  ebx,1*65536+1
2274
    mov  edx,[channel_line_shadow]
2226
    mov  edx,[channel_line_shadow]
2275
    mcall
2227
    mcall
2276
 
2228
 
2277
    mov  eax,12
2229
    mov  eax,12
2278
    mov  ebx,2
2230
    mov  ebx,2
2279
    mcall
2231
    mcall
2280
 
2232
 
2281
    popa
2233
    popa
2282
 
2234
 
2283
    ret
2235
    ret
2284
 
2236
 
2285
 
2237
 
2286
; DATA AREA
2238
; DATA AREA
2287
 
2239
 
2288
socket	dd  0x0
2240
socket	dd  0x0
2289
 
2241
 
2290
bgc  dd  0x000000
2242
bgc  dd  0x000000
2291
     dd  0x000000
2243
     dd  0x000000
2292
     dd  0x00ff00
2244
     dd  0x00ff00
2293
     dd  0x0000ff
2245
     dd  0x0000ff
2294
     dd  0x005500
2246
     dd  0x005500
2295
     dd  0xff00ff
2247
     dd  0xff00ff
2296
     dd  0x00ffff
2248
     dd  0x00ffff
2297
     dd  0x770077
2249
     dd  0x770077
2298
 
2250
 
2299
tc   dd  0xffffff
2251
tc   dd  0xffffff
2300
     dd  0xff00ff
2252
     dd  0xff00ff
2301
     dd  0xffffff
2253
     dd  0xffffff
2302
     dd  0xffffff
2254
     dd  0xffffff
2303
     dd  0xffffff
2255
     dd  0xffffff
2304
     dd  0xffffff
2256
     dd  0xffffff
2305
     dd  0xffffff
2257
     dd  0xffffff
2306
     dd  0xffffff
2258
     dd  0xffffff
2307
 
2259
 
2308
channel_line_sun    dd 0x9999ff
2260
channel_line_sun    dd 0x9999ff
2309
channel_line_shadow dd 0x666699
2261
channel_line_shadow dd 0x666699
2310
 
2262
 
2311
cursor_on_off  dd  0x0
2263
cursor_on_off  dd  0x0
2312
 
2264
 
2313
max_windows    dd  20
2265
max_windows    dd  20
2314
 
2266
 
2315
thread_stack   dd  0x9fff0
2267
thread_stack   dd  0x9fff0
2316
thread_nro     dd 1
2268
thread_nro     dd 1
2317
thread_screen  dd I_END+120*80*1
2269
thread_screen  dd I_END+120*80*1
2318
 
2270
 
2319
action_header_blue  db	10,'*** ',0
2271
action_header_blue  db	10,'*** ',0
2320
action_header_red   db	10,'*** ',0
2272
action_header_red   db	10,'*** ',0
2321
 
2273
 
2322
action_header_short db	10,'* ',0
2274
action_header_short db	10,'* ',0
2323
 
2275
 
2324
has_left_channel db  ' has left ',0
2276
has_left_channel db  ' has left ',0
2325
joins_channel	 db  ' has joined ',0
2277
joins_channel	 db  ' has joined ',0
2326
is_now_known_as  db  ' is now known as ',0
2278
is_now_known_as  db  ' is now known as ',0
2327
has_quit_irc	 db  ' has quit IRC',0
2279
has_quit_irc	 db  ' has quit IRC',0
2328
sets_mode	 db  ' sets mode ',0
2280
sets_mode	 db  ' sets mode ',0
2329
kicked		 db  ' kicked from ',0
2281
kicked		 db  ' kicked from ',0
2330
 
2282
 
2331
index_list_1	 dd  0x0000bb
2283
index_list_1	 dd  0x0000bb
2332
index_list_2	 dd  0x0000ff
2284
index_list_2	 dd  0x0000ff
2333
 
2285
 
2334
posx		 dd  0x0
2286
posx		 dd  0x0
2335
incoming_pos	 dd  0x0
2287
incoming_pos	 dd  0x0
2336
incoming_string: times 128 db 0
2288
incoming_string: times 128 db 0
2337
 
2289
 
2338
pos	     dd  0x0
2290
pos	     dd  0x0
2339
 
2291
 
2340
text_start   dd  I_END
2292
text_start   dd  I_END
2341
irc_data     dd  0x0
2293
irc_data     dd  0x0
2342
print	     db  0x0
2294
print	     db  0x0
2343
cmd	     dd  0x0
2295
cmd	     dd  0x0
2344
rxs	     dd  66
2296
rxs	     dd  66
2345
 
2297
 
2346
res:	     db  0,0
2298
res:	     db  0,0
2347
command:     times  600  db 0x0
2299
command:     times  600  db 0x0
2348
 
2300
 
2349
nick	     dd  0,0,0
2301
nick	     dd  0,0,0
2350
irc_command  dd  0,0
2302
irc_command  dd  0,0
2351
 
2303
 
2352
command_position  dd 0x0
2304
command_position  dd 0x0
2353
counter 	  dd  0
2305
counter 	  dd  0
2354
send_to_server	  db 0
2306
send_to_server	  db 0
2355
 
2307
 
2356
channel_list:	  times 32*20 db 32
2308
channel_list:	  times 32*20 db 32
2357
send_to_channel   dd 0x0
2309
send_to_channel   dd 0x0
2358
 
2310
 
2359
send_string_header:  db     'privmsg #eax :'
2311
send_string_header:  db     'privmsg #eax :'
2360
		     times  100  db  0x0
2312
		     times  100  db  0x0
2361
 
2313
 
2362
send_string:	     times  100  db  0x0
2314
send_string:	     times  100  db  0x0
2363
xpos	     dd  0
2315
xpos	     dd  0
2364
 
2316
 
2365
string0:     db  'USER guest ser1 ser2 :'
2317
string0:     db  'USER guest ser1 ser2 :'
2366
string0l:
2318
string0l:
2367
string1:     db  'nick '
2319
string1:     db  'nick '
2368
string1l:
2320
string1l:
2369
 
2321
 
2370
attribute   dd	0
2322
attribute   dd	0
2371
scroll	    dd	1
2323
scroll	    dd	1
2372
	    dd	12
2324
	    dd	12
2373
 
2325
 
2374
numtext     db	'                     '
2326
numtext     db	'                     '
2375
 
2327
 
2376
wcolor	    dd	0x000000
2328
wcolor	    dd	0x000000
2377
 
2329
 
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
2380
 
2332
 
2381
;include_debug_strings  ; ALWAYS present in data section
2333
;include_debug_strings  ; ALWAYS present in data section
-
 
2334
 
-
 
2335
irc_server_ip db ?  ; bufer for server_IP
2382
 
2336
 
2383
dnsMsg:  rb 512     ; buffer used by DNS client
2337
dnsMsg:  rb 512     ; buffer used by DNS client
2384
 
2338
 
2385
 
2339
 
2386
;;
2340
;;
2387
;;   Channel data at I_END
2341
;;   Channel data at I_END
2388
;;
2342
;;
2389
;;   120*80 * channel window (1+)
2343
;;   120*80 * channel window (1+)
2390
;;
2344
;;
2391
;;      At         Size
2345
;;      At         Size
2392
;;
2346
;;
2393
;;      00      ,  120*60   window text 120 characters per row
2347
;;      00      ,  120*60   window text 120 characters per row
2394
;;  120*60      ,  1        text is updated
2348
;;  120*60      ,  1        text is updated
2395
;;  120*60+4    ,  1        close yourself
2349
;;  120*60+4    ,  1        close yourself
2396
;;  120*60+8    ,  1        0 = channel window  :  1 = private chat
2350
;;  120*60+8    ,  1        0 = channel window  :  1 = private chat
2397
;;  120*61      ,  256      channel name
2351
;;  120*61      ,  256      channel name
2398
;;  120*61+254  ,  254      channel entry text from user
2352
;;  120*61+254  ,  254      channel entry text from user
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:
2405
 
2359
 
2406
>
2360
>
2407
>
2361
>