Subversion Repositories Kolibri OS

Rev

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

Rev 485 Rev 551
1
; Yahoo Messanger for MenuetOS
1
; Yahoo Messanger for MenuetOS
2
; Compile with FASM for Menuet
2
; Compile with FASM for Menuet
3
   
3
   
4
;B+ System header
4
;B+ System header
5
use32
5
use32
6
 org	0x0
6
 org	0x0
7
 db	'MENUET01'    ; header
7
 db	'MENUET01'    ; header
8
 dd	0x01	      ; header version
8
 dd	0x01	      ; header version
9
 dd	START	      ; entry point
9
 dd	START	      ; entry point
10
 dd	I_END	      ; image size
10
 dd	I_END	      ; image size
11
 dd	I_END+0x10000 ; required memory
11
 dd	I_END+0x10000 ; required memory
12
 dd	I_END+0x10000 ; esp
12
 dd	I_END+0x10000 ; esp
13
 dd	0x0 , 0x0     ; I_Param , I_Path
13
 dd	0x0 , 0x0     ; I_Param , I_Path
14
 
14
 
15
;E:.
15
;E:.
16
include 'lang.inc'   
16
include 'lang.inc'   
17
include '..\..\..\macros.inc'
17
include '..\..\..\macros.inc'
18
;B+ Definitions
18
;B+ Definitions
19
v_sp equ 330
19
v_sp equ 330
20
h_sp equ 400
20
h_sp equ 400
21
fr_sp equ 120
21
fr_sp equ 120
22
   
22
   
23
line_wid equ 45
23
line_wid equ 45
24
fr_max_lines equ 17								
24
fr_max_lines equ 17								
25
   
25
   
26
;memory
26
;memory
27
sys_colors  equ I_END
27
sys_colors  equ I_END
28
text_zone   equ sys_colors+4*10
28
text_zone   equ sys_colors+4*10
29
;friend_zone equ text_zone+45*25                        ;uncom
29
;friend_zone equ text_zone+45*25                        ;uncom
30
	    ;friend_zone+32*fr_max_lines
30
	    ;friend_zone+32*fr_max_lines
31
;E:.
31
;E:.
32
   
32
   
33
START:
33
START:
34
;B+ Main execution
34
;B+ Main execution
35
 
35
 
36
  mov  ebx,3
36
  mov  ebx,3
37
  mov  ecx,sys_colors
37
  mov  ecx,sys_colors
38
  mov  edx,10*4
38
  mov  edx,10*4
39
  mov  eax,48
39
  mov  eax,48
40
  mcall
40
  mcall
41
   
41
   
42
  call clear_text
42
  call clear_text
43
   
43
   
44
red:
44
red:
45
  call draw_window
45
  call draw_window
46
still:
46
still:
47
  mov  ebx,50
47
  mov  ebx,50
48
  mov  eax,23
48
  mov  eax,23
49
  mcall
49
  mcall
50
   
50
   
51
  cmp  eax,1
51
  cmp  eax,1
52
  je   red
52
  je   red
53
  cmp  eax,2
53
  cmp  eax,2
54
  je   key
54
  je   key
55
  cmp  eax,3
55
  cmp  eax,3
56
  je   button
56
  je   button
57
   
57
   
58
  call check_message
58
  call check_message
59
   
59
   
60
  jmp  still
60
  jmp  still
61
   
61
   
62
key:
62
key:
63
  mov  eax,2
63
  mov  eax,2
64
  mcall
64
  mcall
65
  cmp  [is_connect],0
65
  cmp  [is_connect],0
66
  je   still
66
  je   still
67
  call send_key_string
67
  call send_key_string
68
  jmp  still
68
  jmp  still
69
   
69
   
70
button:
70
button:
71
  mov  eax,17
71
  mov  eax,17
72
  mcall
72
  mcall
73
   
73
   
74
  cmp  ah,1
74
  cmp  ah,1
75
  jne  noclose
75
  jne  noclose
76
  or  eax,-1
76
  or  eax,-1
77
  mcall
77
  mcall
78
  jmp  $
78
  jmp  $
79
noclose:
79
noclose:
80
   
80
   
81
;B+ Check friend
81
;B+ Check friend
82
  cmp  ah,2
82
  cmp  ah,2
83
  jb   .no_friend
83
  jb   .no_friend
84
  cmp  ah,100
84
  cmp  ah,100
85
  ja   .no_friend
85
  ja   .no_friend
86
   
86
   
87
  ;pressed number
87
  ;pressed number
88
  sub  ah,2
88
  sub  ah,2
89
  shr  ax,8
89
  shr  ax,8
90
   
90
   
91
  ;find real name
91
  ;find real name
92
  mov  [friend_p],friend_zone
92
  mov  [friend_p],friend_zone
93
  mov  edi,0
93
  mov  edi,0
94
.next:
94
.next:
95
 push [friend_p]
95
 push [friend_p]
96
  call test_friend
96
  call test_friend
97
  jc   .group
97
  jc   .group
98
  inc  edi
98
  inc  edi
99
.group:
99
.group:
100
  cmp  di,ax
100
  cmp  di,ax
101
 pop  ebx
101
 pop  ebx
102
  jbe  .next
102
  jbe  .next
103
  inc  ebx
103
  inc  ebx
104
  ;exact place
104
  ;exact place
105
  mov  ecx,[friend_p]
105
  mov  ecx,[friend_p]
106
  sub  ecx,ebx
106
  sub  ecx,ebx
107
  dec  ecx
107
  dec  ecx
108
   
108
   
109
  ;Insert in send
109
  ;Insert in send
110
  cmp  al,10
110
  cmp  al,10
111
  jb   .good
111
  jb   .good
112
  add  al,'A'-'0'-10
112
  add  al,'A'-'0'-10
113
.good:
113
.good:
114
  add  al,'0'
114
  add  al,'0'
115
  mov  [view_text+1],al
115
  mov  [view_text+1],al
116
   
116
   
117
  ;Clear old a. friend
117
  ;Clear old a. friend
118
 pusha
118
 pusha
119
  mov  ebx,(h_sp-140) shl 16 + 132
119
  mov  ebx,(h_sp-140) shl 16 + 132
120
  mov  ecx,(v_sp-53) shl 16 + 10
120
  mov  ecx,(v_sp-53) shl 16 + 10
121
  mov  edx,[sys_colors+4*5]
121
  mov  edx,[sys_colors+4*5]
122
  mov  eax,13
122
  mov  eax,13
123
  mcall
123
  mcall
124
 popa
124
 popa
125
   
125
   
126
  ;show item
126
  ;show item
127
  mov  [f_name_b],ebx
127
  mov  [f_name_b],ebx
128
  mov  [f_name_l],ecx
128
  mov  [f_name_l],ecx
129
  call show_a_friend
129
  call show_a_friend
130
  jmp  still
130
  jmp  still
131
   
131
   
132
.no_friend:
132
.no_friend:
133
;E:.
133
;E:.
134
   
134
   
135
;B+ Check User / Password
135
;B+ Check User / Password
136
  cmp  ah,103
136
  cmp  ah,103
137
  je   input_username
137
  je   input_username
138
  cmp  ah,104
138
  cmp  ah,104
139
  je   input_password
139
  je   input_password
140
;E:.
140
;E:.
141
   
141
   
142
;B+ Connect / Dis...
142
;B+ Connect / Dis...
143
  cmp  ah,101
143
  cmp  ah,101
144
  je   yahoo_c
144
  je   yahoo_c
145
  cmp  ah,102
145
  cmp  ah,102
146
  je   yahoo_d
146
  je   yahoo_d
147
;E:.
147
;E:.
148
   
148
   
149
  jmp  still
149
  jmp  still
150
;E:.
150
;E:.
151
   
151
   
152
draw_window:
152
draw_window:
153
;B+ Draw window
153
;B+ Draw window
154
  
154
  
155
  mov  ebx,1
155
  mov  ebx,1
156
  mov  eax,12
156
  mov  eax,12
157
  mcall
157
  mcall
158
 
158
 
159
  xor  eax,eax		     ;DRAW WINDOW
159
  xor  eax,eax		     ;DRAW WINDOW
160
  mov  ebx,150*65536+h_sp
160
  mov  ebx,150*65536+h_sp
161
  mov  ecx,100*65536+v_sp
161
  mov  ecx,100*65536+v_sp
162
  mov  edx,[sys_colors+4*5]
162
  mov  edx,[sys_colors+4*5]
163
  or   edx,0x13000000
163
  or   edx,0x14000000
164
  mov  edi,title
164
  mov  edi,title
165
  mcall
165
  mcall
166
 
166
 
167
;B+ Friend panel
167
;B+ Friend panel
168
  mov  ebx,(h_sp-fr_sp) shl 16 + 3
168
  mov  ebx,(h_sp-fr_sp) shl 16 + 3
169
  mov  ecx,20 shl 16 + v_sp-31 -56
169
  mov  ecx,20 shl 16 + v_sp-31 -56
170
  mov  edx,[sys_colors+4*9]
170
  mov  edx,[sys_colors+4*9]
171
  mov  eax,13
171
  mov  eax,13
172
  mcall
172
  mcall
173
  call show_friends
173
  call show_friends
174
;E:.
174
;E:.
175
   
175
   
176
;B+ Input panel
176
;B+ Input panel
177
  mov  ebx,5 shl 16 + h_sp-9
177
  mov  ebx,5 shl 16 + h_sp-9
178
  mov  ecx,(v_sp-31 -33-3) shl 16 + 3
178
  mov  ecx,(v_sp-31 -33-3) shl 16 + 3
179
  mov  edx,[sys_colors+4*9]
179
  mov  edx,[sys_colors+4*9]
180
  mov  eax,13
180
  mov  eax,13
181
  mcall
181
  mcall
182
  mov  ebx,(h_sp-(fr_sp-12)*8/6) shl 16 + 4
182
  mov  ebx,(h_sp-(fr_sp-12)*8/6) shl 16 + 4
183
  mov  ecx,(v_sp-31-33) shl 16 + 30
183
  mov  ecx,(v_sp-31-33) shl 16 + 30
184
  mcall
184
  mcall
185
  mov  ebx,(h_sp-8) shl 16 + 4
185
  mov  ebx,(h_sp-8) shl 16 + 4
186
  mcall
186
  mcall
187
  call show_a_friend
187
  call show_a_friend
188
  call show_string
188
  call show_string
189
;E:.
189
;E:.
190
   
190
   
191
;B+ Login panel
191
;B+ Login panel
192
  mov  ebx,5 shl 16 + h_sp-9
192
  mov  ebx,5 shl 16 + h_sp-9
193
  mov  ecx,(v_sp-35) shl 16 + 31
193
  mov  ecx,(v_sp-35) shl 16 + 31
194
  mov  edx,[sys_colors+4*9]
194
  mov  edx,[sys_colors+4*9]
195
  mov  eax,13
195
  mov  eax,13
196
  mcall
196
  mcall
197
  mov  ebx,(5+2+8+(user_txt_end-user_txt)*6) shl 16 + 6*15+7
197
  mov  ebx,(5+2+8+(user_txt_end-user_txt)*6) shl 16 + 6*15+7
198
  mov  ecx,(v_sp-32) shl 16 + 12
198
  mov  ecx,(v_sp-32) shl 16 + 12
199
  mov  edx,[sys_colors+4*5]
199
  mov  edx,[sys_colors+4*5]
200
  mcall
200
  mcall
201
  mov  ebx,(171+2+8+(psw_txt_end-psw_txt)*6) shl 16 + 6*23+7
201
  mov  ebx,(171+2+8+(psw_txt_end-psw_txt)*6) shl 16 + 6*23+7
202
  mov  ecx,(v_sp-32) shl 16 + 12
202
  mov  ecx,(v_sp-32) shl 16 + 12
203
  mcall
203
  mcall
204
   
204
   
205
  ;connect button
205
  ;connect button
206
  mov  ebx,(h_sp-128) shl 16 + (con_txt_end-con_txt)*6 + 7
206
  mov  ebx,(h_sp-128) shl 16 + (con_txt_end-con_txt)*6 + 7
207
  mov  ecx,(v_sp-18) shl 16 + 12
207
  mov  ecx,(v_sp-18) shl 16 + 12
208
  mov  edx,101
208
  mov  edx,101
209
  mov  esi,[sys_colors+4*6]
209
  mov  esi,[sys_colors+4*6]
210
  mov  eax,8
210
  mov  eax,8
211
  mcall
211
  mcall
212
  ;disconnect button
212
  ;disconnect button
213
  shl  ebx,16
213
  shl  ebx,16
214
  add  ebx,(h_sp-128+3) shl 16 + (dis_txt_end-dis_txt)*6 + 7
214
  add  ebx,(h_sp-128+3) shl 16 + (dis_txt_end-dis_txt)*6 + 7
215
  mov  edx,102
215
  mov  edx,102
216
  mcall
216
  mcall
217
  ;user button
217
  ;user button
218
  mov  ebx,8 shl 16 + (user_txt_end-user_txt)*6 + 5
218
  mov  ebx,8 shl 16 + (user_txt_end-user_txt)*6 + 5
219
  mov  ecx,(v_sp-18-15) shl 16 + 12
219
  mov  ecx,(v_sp-18-15) shl 16 + 12
220
  mov  edx,103
220
  mov  edx,103
221
  mcall
221
  mcall
222
  ;password button
222
  ;password button
223
  mov  ebx,174 shl 16 + (psw_txt_end-psw_txt)*6 + 5
223
  mov  ebx,174 shl 16 + (psw_txt_end-psw_txt)*6 + 5
224
  mov  edx,104
224
  mov  edx,104
225
  mcall
225
  mcall
226
   
226
   
227
  ;login text
227
  ;login text
228
  mov  ebx,11 shl 16 + v_sp-15
228
  mov  ebx,11 shl 16 + v_sp-15
229
  mov  ecx,[sys_colors+4*7]
229
  mov  ecx,[sys_colors+4*7]
230
  mov  edx,login_txt
230
  mov  edx,login_txt
231
  mov  esi,login_txt_end-login_txt
231
  mov  esi,login_txt_end-login_txt
232
  mov  eax,4
232
  mov  eax,4
233
  mcall
233
  mcall
234
  ;user text
234
  ;user text
235
  mov  ebx,11 shl 16 + v_sp-15-15
235
  mov  ebx,11 shl 16 + v_sp-15-15
236
  mov  edx,user_txt
236
  mov  edx,user_txt
237
  mov  esi,user_txt_end-user_txt
237
  mov  esi,user_txt_end-user_txt
238
  mcall
238
  mcall
239
  ;password text
239
  ;password text
240
  mov  ebx,(174+5) shl 16 + v_sp-15-15
240
  mov  ebx,(174+5) shl 16 + v_sp-15-15
241
  mov  edx,psw_txt
241
  mov  edx,psw_txt
242
  mov  esi,psw_txt_end-psw_txt
242
  mov  esi,psw_txt_end-psw_txt
243
  mcall
243
  mcall
244
  ;connect text
244
  ;connect text
245
  mov  ebx,(h_sp-128+5) shl 16 + v_sp-15
245
  mov  ebx,(h_sp-128+5) shl 16 + v_sp-15
246
  mov  edx,con_txt
246
  mov  edx,con_txt
247
  mov  esi,con_txt_end-con_txt
247
  mov  esi,con_txt_end-con_txt
248
  mcall
248
  mcall
249
  ;disconnect text
249
  ;disconnect text
250
  add  ebx,((con_txt_end-con_txt)*6+8 + 3) shl 16
250
  add  ebx,((con_txt_end-con_txt)*6+8 + 3) shl 16
251
  mov  edx,dis_txt
251
  mov  edx,dis_txt
252
  mov  esi,dis_txt_end-dis_txt
252
  mov  esi,dis_txt_end-dis_txt
253
  mcall
253
  mcall
254
   
254
   
255
  call show_username
255
  call show_username
256
  call show_password
256
  call show_password
257
;E:.
257
;E:.
258
   
258
   
259
  call show_text
259
  call show_text
260
   
260
   
261
  mov  ebx,2
261
  mov  ebx,2
262
  mov  eax,12
262
  mov  eax,12
263
  mcall
263
  mcall
264
  ret
264
  ret
265
;E:.
265
;E:.
266
   
266
   
267
show_friends:
267
show_friends:
268
;B+ Show friend list
268
;B+ Show friend list
269
  cmp  [last_friend_place],friend_zone
269
  cmp  [last_friend_place],friend_zone
270
  jne  .yes_show
270
  jne  .yes_show
271
  ret
271
  ret
272
.yes_show:
272
.yes_show:
273
   
273
   
274
  ;show button
274
  ;show button
275
  mov  ebx,(h_sp-fr_sp+5) shl 16 + 10
275
  mov  ebx,(h_sp-fr_sp+5) shl 16 + 10
276
  mov  ecx,(20+3) shl 16 + 10
276
  mov  ecx,(20+3) shl 16 + 10
277
  mov  edx,2
277
  mov  edx,2
278
  mov  esi,[sys_colors+4*6]
278
  mov  esi,[sys_colors+4*6]
279
  mov  eax,8
279
  mov  eax,8
280
  mov  edi,0
280
  mov  edi,0
281
   
281
   
282
  mov  [friend_p],friend_zone
282
  mov  [friend_p],friend_zone
283
.next_button:
283
.next_button:
284
  call test_friend
284
  call test_friend
285
  jc   .no_b
285
  jc   .no_b
286
  mcall
286
  mcall
287
  inc  edx
287
  inc  edx
288
.no_b:
288
.no_b:
289
  inc  edi
289
  inc  edi
290
  add  ecx,15 shl 16
290
  add  ecx,15 shl 16
291
  cmp  edi,[last_friend_line]
291
  cmp  edi,[last_friend_line]
292
  jne  .next_button
292
  jne  .next_button
293
   
293
   
294
  ;show numbers
294
  ;show numbers
295
  mov  [digit],'0'-1
295
  mov  [digit],'0'-1
296
  mov  ebx,(h_sp-fr_sp+8) shl 16 + (20+3)+2
296
  mov  ebx,(h_sp-fr_sp+8) shl 16 + (20+3)+2
297
  ;mov  ecx,[sys_colors+4*7]
297
  ;mov  ecx,[sys_colors+4*7]
298
  mov  edx,digit
298
  mov  edx,digit
299
  mov  esi,1
299
  mov  esi,1
300
  mov  eax,4
300
  mov  eax,4
301
  mov  edi,0
301
  mov  edi,0
302
   
302
   
303
  mov  [friend_p],friend_zone
303
  mov  [friend_p],friend_zone
304
 push edx
304
 push edx
305
.next_digit:
305
.next_digit:
306
  mov  edx,[friend_p]
306
  mov  edx,[friend_p]
307
  call test_friend
307
  call test_friend
308
  cmp  [edx],byte 1
308
  cmp  [edx],byte 1
309
  je   .no_item
309
  je   .no_item
310
  inc  [digit]
310
  inc  [digit]
311
  cmp  [digit],'9'+1
311
  cmp  [digit],'9'+1
312
  jne  .good
312
  jne  .good
313
  mov  [digit],'A'
313
  mov  [digit],'A'
314
.good:
314
.good:
315
  ;add  ebx,1 shl 16
315
  ;add  ebx,1 shl 16
316
  cmp  [edx],byte 2
316
  cmp  [edx],byte 2
317
  mov  edx,[esp]
317
  mov  edx,[esp]
318
  mov  ecx,[sys_colors+4*6]
318
  mov  ecx,[sys_colors+4*6]
319
  call hi_light
319
  call hi_light
320
  jne  .no_online
320
  jne  .no_online
321
  mov  ecx,[sys_colors+4*7]
321
  mov  ecx,[sys_colors+4*7]
322
  ;mcall
322
  ;mcall
323
  ;or    ecx,0x10000000
323
  ;or    ecx,0x10000000
324
.no_online:
324
.no_online:
325
  ;sub  ebx,1 shl 16
325
  ;sub  ebx,1 shl 16
326
  mcall
326
  mcall
327
  ;and  ecx,not 0x10000000
327
  ;and  ecx,not 0x10000000
328
.no_item:
328
.no_item:
329
  add  ebx,15
329
  add  ebx,15
330
  inc  edi
330
  inc  edi
331
  cmp  edi,[last_friend_line]
331
  cmp  edi,[last_friend_line]
332
  jne  .next_digit
332
  jne  .next_digit
333
  add  esp,4
333
  add  esp,4
334
   
334
   
335
  ;show names
335
  ;show names
336
  mov  ebx,(h_sp-fr_sp+8 + 10) shl 16 + (20+3)+2
336
  mov  ebx,(h_sp-fr_sp+8 + 10) shl 16 + (20+3)+2
337
  mov  ecx,[sys_colors+4*8]
337
  mov  ecx,[sys_colors+4*8]
338
  mov  eax,4
338
  mov  eax,4
339
  mov  edi,0
339
  mov  edi,0
340
   
340
   
341
  mov  [friend_p],friend_zone
341
  mov  [friend_p],friend_zone
342
  mov  esi,4
342
  mov  esi,4
343
.next_name:
343
.next_name:
344
  mov  edx,[friend_p]
344
  mov  edx,[friend_p]
345
  call test_friend
345
  call test_friend
346
  mov  esi,[friend_p]
346
  mov  esi,[friend_p]
347
  inc  edx
347
  inc  edx
348
  sub  esi,edx
348
  sub  esi,edx
349
   
349
   
350
  and  ebx,0xffff
350
  and  ebx,0xffff
351
  or   ebx,(h_sp-fr_sp+8 + 10) shl 16
351
  or   ebx,(h_sp-fr_sp+8 + 10) shl 16
352
  cmp  [edx-1],byte 1
352
  cmp  [edx-1],byte 1
353
  jne  .no_group
353
  jne  .no_group
354
  sub  ebx,12 shl 16
354
  sub  ebx,12 shl 16
355
.no_group:
355
.no_group:
356
  mcall
356
  mcall
357
  add  ebx,15
357
  add  ebx,15
358
  inc  edi
358
  inc  edi
359
  cmp  edi,[last_friend_line]
359
  cmp  edi,[last_friend_line]
360
  jne  .next_name
360
  jne  .next_name
361
   
361
   
362
  ret
362
  ret
363
.p db 16 ;>
363
.p db 16 ;>
364
   
364
   
365
digit db '0'
365
digit db '0'
366
;last_friend_line dd 0x0                                ;uncom
366
;last_friend_line dd 0x0                                ;uncom
367
   
367
   
368
test_friend:
368
test_friend:
369
 push eax
369
 push eax
370
  mov  eax,[friend_p]
370
  mov  eax,[friend_p]
371
  clc
371
  clc
372
  cmp  [eax],byte 1
372
  cmp  [eax],byte 1
373
  jne  .no_hide
373
  jne  .no_hide
374
  stc
374
  stc
375
.no_hide:
375
.no_hide:
376
 pushf
376
 pushf
377
.next:
377
.next:
378
  inc  [friend_p]
378
  inc  [friend_p]
379
  mov  eax,[friend_p]
379
  mov  eax,[friend_p]
380
  cmp  [eax],byte 0
380
  cmp  [eax],byte 0
381
  jne  .next
381
  jne  .next
382
  inc  [friend_p]
382
  inc  [friend_p]
383
 popf
383
 popf
384
 pop  eax
384
 pop  eax
385
  ret
385
  ret
386
   
386
   
387
friend_p dd 0x0
387
friend_p dd 0x0
388
   
388
   
389
hi_light:
389
hi_light:
390
 pushf
390
 pushf
391
  add  ecx,0x400000
391
  add  ecx,0x400000
392
  test ecx,0xb00000
392
  test ecx,0xb00000
393
  jnz  .no_red_plus
393
  jnz  .no_red_plus
394
  sub  ecx,0x400000
394
  sub  ecx,0x400000
395
.no_red_plus:
395
.no_red_plus:
396
  add  ecx,0x004000
396
  add  ecx,0x004000
397
  test ecx,0x00b000
397
  test ecx,0x00b000
398
  jnz  .no_green_plus
398
  jnz  .no_green_plus
399
  sub  ecx,0x008000
399
  sub  ecx,0x008000
400
.no_green_plus:
400
.no_green_plus:
401
  add  ecx,0x000040 ;80
401
  add  ecx,0x000040 ;80
402
  test ecx,0x0000b0 ;80
402
  test ecx,0x0000b0 ;80
403
  jnz  .no_blue_plus
403
  jnz  .no_blue_plus
404
  sub  ecx,0x000040 ;100
404
  sub  ecx,0x000040 ;100
405
.no_blue_plus:
405
.no_blue_plus:
406
 popf
406
 popf
407
  ret
407
  ret
408
;E:.
408
;E:.
409
   
409
   
410
;B+ Message text op.
410
;B+ Message text op.
411
clear_text:
411
clear_text:
412
  mov  edi,text_zone
412
  mov  edi,text_zone
413
  mov  ecx,45*26
413
  mov  ecx,45*26
414
  mov  al,0
414
  mov  al,0
415
  cld
415
  cld
416
rep stosb
416
rep stosb
417
  ret
417
  ret
418
   
418
   
419
show_text:
419
show_text:
420
  mov  ebx,7 shl 16 + (20+3) ;+ 2
420
  mov  ebx,7 shl 16 + (20+3) ;+ 2
421
  mov  ecx,[sys_colors+4*8]
421
  mov  ecx,[sys_colors+4*8]
422
  mov  edx,text_zone+45
422
  mov  edx,text_zone+45
423
  mov  esi,45
423
  mov  esi,45
424
  mov  eax,4
424
  mov  eax,4
425
  mov  edi,0
425
  mov  edi,0
426
.next_line:
426
.next_line:
427
  cmp  [edx-1],byte 0
427
  cmp  [edx-1],byte 0
428
  jne  .shift
428
  jne  .shift
429
  mcall
429
  mcall
430
.next:
430
.next:
431
  add  ebx,10
431
  add  ebx,10
432
  add  edx,45
432
  add  edx,45
433
  inc  edi
433
  inc  edi
434
  cmp  edi,24
434
  cmp  edi,24
435
  jne  .next_line
435
  jne  .next_line
436
  ret
436
  ret
437
.shift:
437
.shift:
438
  add  ebx,3 shl 16
438
  add  ebx,3 shl 16
439
  mcall
439
  mcall
440
  sub  ebx,3 shl 16
440
  sub  ebx,3 shl 16
441
  jmp  .next
441
  jmp  .next
442
   
442
   
443
scroll_text:
443
scroll_text:
444
 pusha
444
 pusha
445
  ;move text
445
  ;move text
446
  mov  edi,text_zone
446
  mov  edi,text_zone
447
  mov  esi,edi
447
  mov  esi,edi
448
  add  esi,line_wid
448
  add  esi,line_wid
449
  mov  ecx,line_wid*24
449
  mov  ecx,line_wid*24
450
  cld
450
  cld
451
rep movsb
451
rep movsb
452
  ;clear last line
452
  ;clear last line
453
  mov  ecx,line_wid
453
  mov  ecx,line_wid
454
  mov  al,0
454
  mov  al,0
455
rep stosb
455
rep stosb
456
  ;clear zone
456
  ;clear zone
457
  mov  ebx,7 shl 16 + line_wid*6+2
457
  mov  ebx,7 shl 16 + line_wid*6+2
458
  mov  ecx,(25-2) shl 16 + 24*10-2 +2
458
  mov  ecx,(25-2) shl 16 + 24*10-2 +2
459
  mov  edx,[sys_colors+4*5]
459
  mov  edx,[sys_colors+4*5]
460
  mov  eax,13
460
  mov  eax,13
461
  mcall
461
  mcall
462
  ;show text
462
  ;show text
463
  call show_text
463
  call show_text
464
 popa
464
 popa
465
  ret
465
  ret
466
   
466
   
467
show_message:
467
show_message:
468
 ;ebx - begin
468
 ;ebx - begin
469
 ;ecx - length
469
 ;ecx - length
470
   
470
   
471
  mov  eax,[.m_p]
471
  mov  eax,[.m_p]
472
  add  eax,ecx
472
  add  eax,ecx
473
.test:
473
.test:
474
  cmp  eax,text_zone+line_wid*25-1
474
  cmp  eax,text_zone+line_wid*25-1
475
  jb   .good1
475
  jb   .good1
476
  call scroll_text
476
  call scroll_text
477
  sub  eax,line_wid
477
  sub  eax,line_wid
478
  sub  [.m_p],line_wid
478
  sub  [.m_p],line_wid
479
  jmp  .test
479
  jmp  .test
480
.good1:
480
.good1:
481
  cmp  [.m_p],text_zone+line_wid
481
  cmp  [.m_p],text_zone+line_wid
482
  jae  .good2
482
  jae  .good2
483
  add  ebx,line_wid
483
  add  ebx,line_wid
484
  add  [.m_p],line_wid
484
  add  [.m_p],line_wid
485
  sub  ecx,line_wid
485
  sub  ecx,line_wid
486
  jmp  .good1
486
  jmp  .good1
487
.good2:
487
.good2:
488
  ;
488
  ;
489
 push ecx
489
 push ecx
490
  mov  esi,ebx
490
  mov  esi,ebx
491
  mov  edi,[.m_p]
491
  mov  edi,[.m_p]
492
  cld
492
  cld
493
rep movsb
493
rep movsb
494
 pop  ecx
494
 pop  ecx
495
   
495
   
496
  ;find v place
496
  ;find v place
497
  mov  eax,[.m_p]
497
  mov  eax,[.m_p]
498
  sub  eax,text_zone+line_wid
498
  sub  eax,text_zone+line_wid
499
  mov  ebx,line_wid
499
  mov  ebx,line_wid
500
  xor  edx,edx
500
  xor  edx,edx
501
  div  ebx
501
  div  ebx
502
  xor  edx,edx
502
  xor  edx,edx
503
  mov  ebx,10
503
  mov  ebx,10
504
  mul  ebx
504
  mul  ebx
505
  mov  ebx,eax
505
  mov  ebx,eax
506
  ;show line
506
  ;show line
507
  add  ebx,7 shl 16 + 23 ;+2
507
  add  ebx,7 shl 16 + 23 ;+2
508
  mov  ecx,[sys_colors+4*8]
508
  mov  ecx,[sys_colors+4*8]
509
  mov  edx,[.m_p]
509
  mov  edx,[.m_p]
510
  mov  esi,line_wid
510
  mov  esi,line_wid
511
  mov  eax,4
511
  mov  eax,4
512
  mcall
512
  mcall
513
  add  ebx,3 shl 16
513
  add  ebx,3 shl 16
514
.next_line:
514
.next_line:
515
  add  ebx,10
515
  add  ebx,10
516
  add  edx,line_wid
516
  add  edx,line_wid
517
  cmp  [edx-1],byte 0
517
  cmp  [edx-1],byte 0
518
  je   .good3
518
  je   .good3
519
  mcall
519
  mcall
520
  jmp  .next_line
520
  jmp  .next_line
521
.good3:
521
.good3:
522
  mov  [.m_p],edx
522
  mov  [.m_p],edx
523
  ret
523
  ret
524
   
524
   
525
.m_p dd text_zone+45
525
.m_p dd text_zone+45
526
;E:.
526
;E:.
527
   
527
   
528
;B+ Show current people
528
;B+ Show current people
529
show_a_friend:
529
show_a_friend:
530
  mov  ebx,(h_sp-137) shl 16 + v_sp-52
530
  mov  ebx,(h_sp-137) shl 16 + v_sp-52
531
  mov  ecx,[sys_colors+4*8]
531
  mov  ecx,[sys_colors+4*8]
532
  or   ecx,0x10000000
532
  or   ecx,0x10000000
533
  mov  edx,[f_name_b]
533
  mov  edx,[f_name_b]
534
  mov  esi,[f_name_l]
534
  mov  esi,[f_name_l]
535
  mov  eax,4
535
  mov  eax,4
536
  mcall
536
  mcall
537
  ret
537
  ret
538
   
538
   
539
f_name_b dd fnb
539
f_name_b dd fnb
540
f_name_l dd 10
540
f_name_l dd 10
541
   
541
   
542
fnb:
542
fnb:
543
 db 'yahoo_help'
543
 db 'yahoo_help'
544
;E:.
544
;E:.
545
   
545
   
546
;B+ Input strings
546
;B+ Input strings
547
send_key_string:
547
send_key_string:
548
;B+ Test active keys
548
;B+ Test active keys
549
  cmp  ah,13
549
  cmp  ah,13
550
  je   send_text
550
  je   send_text
551
  cmp  ah,27
551
  cmp  ah,27
552
  je   clear_input_text
552
  je   clear_input_text
553
  cmp  ah,8
553
  cmp  ah,8
554
  je   .backs_text
554
  je   .backs_text
555
;E:.
555
;E:.
556
   
556
   
557
  mov  [.this_c],ah
557
  mov  [.this_c],ah
558
  cmp  [.c_pl],123
558
  cmp  [.c_pl],123
559
  jne  .show
559
  jne  .show
560
  ret
560
  ret
561
.show:
561
.show:
562
   
562
   
563
  ;save char
563
  ;save char
564
  mov  ebx,[.c_pl]
564
  mov  ebx,[.c_pl]
565
  mov  [in_text+ebx],ah
565
  mov  [in_text+ebx],ah
566
  inc  [.c_pl]
566
  inc  [.c_pl]
567
   
567
   
568
  ;show char
568
  ;show char
569
  mov  ebx,[.xy]
569
  mov  ebx,[.xy]
570
  mov  ecx,[sys_colors+4*8]
570
  mov  ecx,[sys_colors+4*8]
571
  mov  edx,.this_c
571
  mov  edx,.this_c
572
  mov  esi,1
572
  mov  esi,1
573
  mov  eax,4
573
  mov  eax,4
574
  mcall
574
  mcall
575
  ;
575
  ;
576
  cmp  [.c_pl],41
576
  cmp  [.c_pl],41
577
  je   .new_line
577
  je   .new_line
578
  cmp  [.c_pl],82
578
  cmp  [.c_pl],82
579
  je   .new_line
579
  je   .new_line
580
  add  [.xy],6 shl 16
580
  add  [.xy],6 shl 16
581
  call show_cursor
581
  call show_cursor
582
  ret
582
  ret
583
  ;;;
583
  ;;;
584
.new_line:
584
.new_line:
585
  and  [.xy],0x0000ffff
585
  and  [.xy],0x0000ffff
586
  add  [.xy],9 shl 16 + 9
586
  add  [.xy],9 shl 16 + 9
587
  call show_cursor
587
  call show_cursor
588
  ret
588
  ret
589
   
589
   
590
.this_c db ' '
590
.this_c db ' '
591
.c_pl dd 0x0
591
.c_pl dd 0x0
592
.xy dd 7 shl 16 + v_sp-62
592
.xy dd 7 shl 16 + v_sp-62
593
   
593
   
594
;B+ Special keys - action
594
;B+ Special keys - action
595
.backs_text:
595
.backs_text:
596
  ;
596
  ;
597
  cmp  [.c_pl],0
597
  cmp  [.c_pl],0
598
  jne  .yes_back
598
  jne  .yes_back
599
  ret
599
  ret
600
.yes_back:
600
.yes_back:
601
  cmp  [.c_pl],41
601
  cmp  [.c_pl],41
602
  je   .back_line
602
  je   .back_line
603
  add  [.xy],2 shl 16
603
  add  [.xy],2 shl 16
604
  cmp  [.c_pl],82
604
  cmp  [.c_pl],82
605
  je   .back_line
605
  je   .back_line
606
  sub  [.xy],2 shl 16
606
  sub  [.xy],2 shl 16
607
.next:
607
.next:
608
  ;
608
  ;
609
  sub  [.xy],6 shl 16
609
  sub  [.xy],6 shl 16
610
  dec  [.c_pl]
610
  dec  [.c_pl]
611
  mov  eax,[.c_pl]
611
  mov  eax,[.c_pl]
612
  mov  bl,[in_text+eax]
612
  mov  bl,[in_text+eax]
613
  mov  [.this_c],bl
613
  mov  [.this_c],bl
614
  mov  ebx,[.xy]
614
  mov  ebx,[.xy]
615
  mov  ecx,[sys_colors+4*5]
615
  mov  ecx,[sys_colors+4*5]
616
  mov  edx,.this_c
616
  mov  edx,.this_c
617
  mov  esi,1
617
  mov  esi,1
618
  mov  eax,4
618
  mov  eax,4
619
  mcall
619
  mcall
620
  mov  ebx,[.c_pl]
620
  mov  ebx,[.c_pl]
621
  mov  [in_text+ebx],byte 0
621
  mov  [in_text+ebx],byte 0
622
  jmp  show_cursor
622
  jmp  show_cursor
623
  ;
623
  ;
624
.back_line:
624
.back_line:
625
  ;and  [.xy],0x0000ffff
625
  ;and  [.xy],0x0000ffff
626
  sub  [.xy],9
626
  sub  [.xy],9
627
  add  [.xy],(253-9) shl 16
627
  add  [.xy],(253-9) shl 16
628
  jmp  .next
628
  jmp  .next
629
   
629
   
630
send_text:
630
send_text:
631
  ;show text to message board
631
  ;show text to message board
632
  mov  ebx,view_text
632
  mov  ebx,view_text
633
  mov  ecx,[send_key_string.c_pl]
633
  mov  ecx,[send_key_string.c_pl]
634
  add  ecx,3
634
  add  ecx,3
635
  call show_message
635
  call show_message
636
   
636
   
637
  ;send message to internet
637
  ;send message to internet
638
  ;call internet_send
638
  ;call internet_send
639
   
639
   
640
clear_input_text:
640
clear_input_text:
641
  ;prepare new message
641
  ;prepare new message
642
  ;; clear memory
642
  ;; clear memory
643
  mov  edi,in_text
643
  mov  edi,in_text
644
  mov  ecx,255/4
644
  mov  ecx,255/4
645
  xor  eax,eax
645
  xor  eax,eax
646
  cld
646
  cld
647
rep stosd
647
rep stosd
648
  ;; clear zone
648
  ;; clear zone
649
  mov  ebx,5 shl 16 + h_sp-140-9
649
  mov  ebx,5 shl 16 + h_sp-140-9
650
  mov  ecx,(v_sp-31 -33) shl 16 + 29
650
  mov  ecx,(v_sp-31 -33) shl 16 + 29
651
  mov  edx,[sys_colors+4*5]
651
  mov  edx,[sys_colors+4*5]
652
  mov  eax,13
652
  mov  eax,13
653
  mcall
653
  mcall
654
  ;; move cursor
654
  ;; move cursor
655
  mov  ebx,7 shl 16 + v_sp-62
655
  mov  ebx,7 shl 16 + v_sp-62
656
  mov  [send_key_string.xy],ebx
656
  mov  [send_key_string.xy],ebx
657
  mov  [show_cursor.old_xy],ebx
657
  mov  [show_cursor.old_xy],ebx
658
  ;; clear place
658
  ;; clear place
659
  xor  ebx,ebx
659
  xor  ebx,ebx
660
  mov  [send_key_string.c_pl],ebx
660
  mov  [send_key_string.c_pl],ebx
661
   
661
   
662
;  call show_cursor
662
;  call show_cursor
663
;  ret
663
;  ret
664
;E:.
664
;E:.
665
   
665
   
666
show_cursor:
666
show_cursor:
667
  ;login text
667
  ;login text
668
;  mov  ebx,4 shl 16 + v_sp-64
668
;  mov  ebx,4 shl 16 + v_sp-64
669
  mov  ebx,[.old_xy]
669
  mov  ebx,[.old_xy]
670
  sub  ebx,3 shl 16 + 2
670
  sub  ebx,3 shl 16 + 2
671
  mov  ecx,[sys_colors+4*5]
671
  mov  ecx,[sys_colors+4*5]
672
  mov  edx,curs
672
  mov  edx,curs
673
  mov  esi,1
673
  mov  esi,1
674
  mov  eax,4
674
  mov  eax,4
675
  mcall
675
  mcall
676
  add  ebx,4
676
  add  ebx,4
677
  mcall
677
  mcall
678
  mov  ebx,[send_key_string.xy]
678
  mov  ebx,[send_key_string.xy]
679
  mov  [.old_xy],ebx
679
  mov  [.old_xy],ebx
680
  sub  ebx,3 shl 16 + 2
680
  sub  ebx,3 shl 16 + 2
681
  mov  ecx,0xffffff;[sys_colors+4*8]
681
  mov  ecx,0xffffff;[sys_colors+4*8]
682
  mcall
682
  mcall
683
  add  ebx,4
683
  add  ebx,4
684
  mcall
684
  mcall
685
  ret
685
  ret
686
   
686
   
687
.old_xy dd 7 shl 16 + v_sp-62
687
.old_xy dd 7 shl 16 + v_sp-62
688
curs db '|'
688
curs db '|'
689
   
689
   
690
show_string:
690
show_string:
691
  mov  ebx,7 shl 16 + v_sp-62
691
  mov  ebx,7 shl 16 + v_sp-62
692
  mov  ecx,[sys_colors+4*8]
692
  mov  ecx,[sys_colors+4*8]
693
  mov  edx,in_text
693
  mov  edx,in_text
694
  mov  esi,41
694
  mov  esi,41
695
  mov  eax,4
695
  mov  eax,4
696
  mcall
696
  mcall
697
  add  ebx,2 shl 16 + 9
697
  add  ebx,2 shl 16 + 9
698
  add  edx,41
698
  add  edx,41
699
  mcall
699
  mcall
700
  add  ebx,9
700
  add  ebx,9
701
  add  edx,41
701
  add  edx,41
702
  mcall
702
  mcall
703
  call show_cursor
703
  call show_cursor
704
  ret
704
  ret
705
   
705
   
706
view_text db 16,'?',16
706
view_text db 16,'?',16
707
in_text: times 255 db 0
707
in_text: times 255 db 0
708
;E:.
708
;E:.
709
   
709
   
710
;B+ Friends...
710
;B+ Friends...
711
add_friend:
711
add_friend:
712
 ;ebx - begin
712
 ;ebx - begin
713
 ; [ebx]=1 - Group name
713
 ; [ebx]=1 - Group name
714
 ; [ebx]=2 - Active user
714
 ; [ebx]=2 - Active user
715
 ; [ebx]=other - Non active user
715
 ; [ebx]=other - Non active user
716
 ;ecx - length
716
 ;ecx - length
717
  cmp  [last_friend_line],fr_max_lines-1
717
  cmp  [last_friend_line],fr_max_lines-1
718
  je   .no_more
718
  je   .no_more
719
  test ecx,not 31
719
  test ecx,not 31
720
  jnz  .no_more ; very long id name
720
  jnz  .no_more ; very long id name
721
  inc  [last_friend_line]
721
  inc  [last_friend_line]
722
  mov  esi,ebx
722
  mov  esi,ebx
723
  mov  edi,[last_friend_place]
723
  mov  edi,[last_friend_place]
724
  inc  ecx
724
  inc  ecx
725
  add  [last_friend_place],ecx
725
  add  [last_friend_place],ecx
726
  dec  ecx
726
  dec  ecx
727
  cld
727
  cld
728
rep movsb
728
rep movsb
729
  mov  al,0
729
  mov  al,0
730
  stosb
730
  stosb
731
  stosb
731
  stosb
732
.no_more:
732
.no_more:
733
  ret
733
  ret
734
   
734
   
735
last_friend_place dd fr_e				;del
735
last_friend_place dd fr_e				;del
736
;last_friend_place dd friend_zone                       ;uncom
736
;last_friend_place dd friend_zone                       ;uncom
737
   
737
   
738
find_friend:
738
find_friend:
739
 push ebx ecx
739
 push ebx ecx
740
  mov  edx,friend_zone
740
  mov  edx,friend_zone
741
  mov  esi,0
741
  mov  esi,0
742
  mov  edi,[last_friend_line]
742
  mov  edi,[last_friend_line]
743
;  inc  edi                                             ;? uncom ?
743
;  inc  edi                                             ;? uncom ?
744
.next_name:
744
.next_name:
745
  cmp  [edx],byte 1
745
  cmp  [edx],byte 1
746
  je   .no_find ;Group                                                          
746
  je   .no_find ;Group                                                          
747
  inc  edx
747
  inc  edx
748
  dec  ecx
748
  dec  ecx
749
.next:
749
.next:
750
  mov  al,[edx]
750
  mov  al,[edx]
751
  mov  ah,[ebx]
751
  mov  ah,[ebx]
752
  cmp  ah,al
752
  cmp  ah,al
753
  jne  .no_find
753
  jne  .no_find
754
  inc  edx
754
  inc  edx
755
  inc  ebx
755
  inc  ebx
756
  dec  ecx
756
  dec  ecx
757
  jne  .next
757
  jne  .next
758
  cmp  [edx],byte 0
758
  cmp  [edx],byte 0
759
  jne  .no_find
759
  jne  .no_find
760
  ;find
760
  ;find
761
  mov  eax,esi
761
  mov  eax,esi
762
  cmp  esi,9
762
  cmp  esi,9
763
  ja   .letter
763
  ja   .letter
764
  add  al,'0'
764
  add  al,'0'
765
  ret
765
  ret
766
.letter:
766
.letter:
767
  add  al,'A'-10
767
  add  al,'A'-10
768
  ret
768
  ret
769
.no_find:
769
.no_find:
770
  cmp  [edx],byte 0
770
  cmp  [edx],byte 0
771
  je   .go_next
771
  je   .go_next
772
  inc  edx
772
  inc  edx
773
  jmp  .no_find
773
  jmp  .no_find
774
.go_next:
774
.go_next:
775
  dec  edi
775
  dec  edi
776
  je   .noting
776
  je   .noting
777
  mov  ebx,[esp+4]
777
  mov  ebx,[esp+4]
778
  mov  ecx,[esp]
778
  mov  ecx,[esp]
779
  inc  esi
779
  inc  esi
780
  jmp  .next_name
780
  jmp  .next_name
781
.noting:
781
.noting:
782
  mov  al,'!'
782
  mov  al,'!'
783
 pop  ecx ebx
783
 pop  ecx ebx
784
  ret
784
  ret
785
   
785
   
786
;E:.
786
;E:.
787
   
787
   
788
;B+ Connect / Disconnect
788
;B+ Connect / Disconnect
789
yahoo_c:
789
yahoo_c:
790
  call connect
790
  call connect
791
  cmp  eax,0
791
  cmp  eax,0
792
  jne  still ;not connected
792
  jne  still ;not connected
793
  mov  [is_connect],0x1
793
  mov  [is_connect],0x1
794
  jmp  still
794
  jmp  still
795
   
795
   
796
yahoo_d:
796
yahoo_d:
797
  cmp  [is_connect],0x0
797
  cmp  [is_connect],0x0
798
  je   .noting
798
  je   .noting
799
   
799
   
800
  call disconnect
800
  call disconnect
801
  ;
801
  ;
802
  ;stop connection
802
  ;stop connection
803
  mov  [is_connect],0x0
803
  mov  [is_connect],0x0
804
  ;
804
  ;
805
  ;clear text
805
  ;clear text
806
  mov  ah,27
806
  mov  ah,27
807
  call send_key_string
807
  call send_key_string
808
  ;
808
  ;
809
  ;clear friends
809
  ;clear friends
810
;  mov  [last_friend_line],0x0                          ;uncom
810
;  mov  [last_friend_line],0x0                          ;uncom
811
;  mov  [last_friend_place],friend_zone                 ;uncom
811
;  mov  [last_friend_place],friend_zone                 ;uncom
812
  ;
812
  ;
813
  ;set dafaut friend
813
  ;set dafaut friend
814
  mov  [f_name_b],fnb
814
  mov  [f_name_b],fnb
815
  mov  [f_name_l],10
815
  mov  [f_name_l],10
816
  mov  [view_text+1],'?'
816
  mov  [view_text+1],'?'
817
   
817
   
818
  call draw_window
818
  call draw_window
819
   
819
   
820
.noting:
820
.noting:
821
  jmp  still
821
  jmp  still
822
   
822
   
823
is_connect dd 0x0
823
is_connect dd 0x0
824
;E:.
824
;E:.
825
   
825
   
826
;B+ Load username / password
826
;B+ Load username / password
827
input_username:
827
input_username:
828
  mov  edi,username
828
  mov  edi,username
829
  mov  [edi],byte '_'
829
  mov  [edi],byte '_'
830
  inc  edi
830
  inc  edi
831
  mov  ecx,16-1
831
  mov  ecx,16-1
832
  cld
832
  cld
833
rep stosb
833
rep stosb
834
  mov  [.unp],username
834
  mov  [.unp],username
835
   
835
   
836
.next:
836
.next:
837
  call show_username
837
  call show_username
838
   
838
   
839
  ;get enen
839
  ;get enen
840
  mov  eax,10
840
  mov  eax,10
841
  mcall
841
  mcall
842
   
842
   
843
  cmp  eax,1
843
  cmp  eax,1
844
  je   .end
844
  je   .end
845
  cmp  eax,3
845
  cmp  eax,3
846
  je   .end
846
  je   .end
847
   
847
   
848
  ;key
848
  ;key
849
  mov  eax,2
849
  mov  eax,2
850
  mcall
850
  mcall
851
   
851
   
852
  cmp  ah,13
852
  cmp  ah,13
853
  je   .end
853
  je   .end
854
  cmp  ah,8
854
  cmp  ah,8
855
  jne  .no_back
855
  jne  .no_back
856
  cmp  [.unp],username
856
  cmp  [.unp],username
857
  je   .next
857
  je   .next
858
  dec  [.unp]
858
  dec  [.unp]
859
  mov  ebx,[.unp]
859
  mov  ebx,[.unp]
860
  mov  [ebx],byte '_'
860
  mov  [ebx],byte '_'
861
  mov  [ebx+1],byte 0
861
  mov  [ebx+1],byte 0
862
  jmp  .next
862
  jmp  .next
863
.no_back:
863
.no_back:
864
   
864
   
865
  cmp  [.unp],username+16
865
  cmp  [.unp],username+16
866
  je   .next
866
  je   .next
867
   
867
   
868
  cmp  ah,'0'
868
  cmp  ah,'0'
869
  jb   .bad
869
  jb   .bad
870
   
870
   
871
  mov  ebx,[.unp]
871
  mov  ebx,[.unp]
872
  mov  [ebx],ah
872
  mov  [ebx],ah
873
  mov  [ebx+1],byte '_'
873
  mov  [ebx+1],byte '_'
874
  inc  [.unp]
874
  inc  [.unp]
875
   
875
   
876
.bad:
876
.bad:
877
  jmp  .next
877
  jmp  .next
878
.end:
878
.end:
879
  ;del cursor
879
  ;del cursor
880
  mov  ebx,[.unp]
880
  mov  ebx,[.unp]
881
  mov  [ebx],byte 0
881
  mov  [ebx],byte 0
882
  call show_username
882
  call show_username
883
  ;clear password
883
  ;clear password
884
  mov  [password],byte 0
884
  mov  [password],byte 0
885
  ;hide password
885
  ;hide password
886
  mov  ebx,(2+41*6) shl 16 + v_sp-15-15
886
  mov  ebx,(2+41*6) shl 16 + v_sp-15-15
887
  mov  ecx,[sys_colors+4*5]
887
  mov  ecx,[sys_colors+4*5]
888
  mov  edx,f_password
888
  mov  edx,f_password
889
  mov  esi,4
889
  mov  esi,4
890
  mov  eax,4								       
890
  mov  eax,4								       
891
  mcall
891
  mcall
892
  jmp  still
892
  jmp  still
893
.unp dd username
893
.unp dd username
894
   
894
   
895
show_username:
895
show_username:
896
  ;hide
896
  ;hide
897
  mov  ebx,(4+12*6-1) shl 16 + 16*6+1
897
  mov  ebx,(4+12*6-1) shl 16 + 16*6+1
898
  mov  ecx,(v_sp-15-15) shl 16 + 9
898
  mov  ecx,(v_sp-15-15) shl 16 + 9
899
  mov  edx,[sys_colors+4*5]
899
  mov  edx,[sys_colors+4*5]
900
  mov  eax,13
900
  mov  eax,13
901
  mcall
901
  mcall
902
  ;show
902
  ;show
903
  mov  ebx,(4+12*6) shl 16 + v_sp-15-15
903
  mov  ebx,(4+12*6) shl 16 + v_sp-15-15
904
  mov  ecx,[sys_colors+4*8]
904
  mov  ecx,[sys_colors+4*8]
905
  mov  edx,username
905
  mov  edx,username
906
  mov  esi,16
906
  mov  esi,16
907
  mov  eax,4									
907
  mov  eax,4									
908
  mcall
908
  mcall
909
  ret
909
  ret
910
   
910
   
911
username: times (16+1) db 0
911
username: times (16+1) db 0
912
   
912
   
913
   
913
   
914
   
914
   
915
input_password:
915
input_password:
916
  ;clear
916
  ;clear
917
  mov  edi,password
917
  mov  edi,password
918
  mov  ecx,24
918
  mov  ecx,24
919
  mov  al,0
919
  mov  al,0
920
  cld
920
  cld
921
rep stosb
921
rep stosb
922
  mov  [.unp],password
922
  mov  [.unp],password
923
  ;hide password
923
  ;hide password
924
  mov  ebx,(2+41*6) shl 16 + v_sp-15-15
924
  mov  ebx,(2+41*6) shl 16 + v_sp-15-15
925
  mov  ecx,[sys_colors+4*5]
925
  mov  ecx,[sys_colors+4*5]
926
  mov  edx,f_password
926
  mov  edx,f_password
927
  mov  esi,4
927
  mov  esi,4
928
  mov  eax,4									
928
  mov  eax,4									
929
  mcall
929
  mcall
930
   
930
   
931
.next:
931
.next:
932
  ;get enen
932
  ;get enen
933
  mov  eax,10
933
  mov  eax,10
934
  mcall
934
  mcall
935
   
935
   
936
  cmp  eax,1
936
  cmp  eax,1
937
  je   still
937
  je   still
938
  cmp  eax,3
938
  cmp  eax,3
939
  je   still
939
  je   still
940
   
940
   
941
  ;key
941
  ;key
942
  mov  eax,2
942
  mov  eax,2
943
  mcall
943
  mcall
944
   
944
   
945
  cmp  [.unp],password+24
945
  cmp  [.unp],password+24
946
  je   .no_next
946
  je   .no_next
947
  cmp  ah,13
947
  cmp  ah,13
948
  jne  .no_still
948
  jne  .no_still
949
.no_next:
949
.no_next:
950
  call show_password
950
  call show_password
951
  jmp  still
951
  jmp  still
952
.no_still:									
952
.no_still:									
953
   
953
   
954
  mov  ebx,[.unp]
954
  mov  ebx,[.unp]
955
  mov  [ebx],ah
955
  mov  [ebx],ah
956
  inc  [.unp]
956
  inc  [.unp]
957
  jmp  .next
957
  jmp  .next
958
   
958
   
959
.unp dd password
959
.unp dd password
960
   
960
   
961
show_password:
961
show_password:
962
  cmp  [password],byte 0
962
  cmp  [password],byte 0
963
  je   .end
963
  je   .end
964
  mov  ebx,(2+41*6) shl 16 + v_sp-15-15
964
  mov  ebx,(2+41*6) shl 16 + v_sp-15-15
965
  mov  ecx,[sys_colors+4*8]
965
  mov  ecx,[sys_colors+4*8]
966
  mov  edx,f_password
966
  mov  edx,f_password
967
  mov  esi,4
967
  mov  esi,4
968
  mov  eax,4									
968
  mov  eax,4									
969
  mcall
969
  mcall
970
.end:
970
.end:
971
  ret										
971
  ret										
972
   
972
   
973
f_password db '####'
973
f_password db '####'
974
   
974
   
975
password: times (24+1) db 0
975
password: times (24+1) db 0
976
;E:.
976
;E:.
977
   
977
   
978
   
978
   
979
   
979
   
980
;B+ INTERNET
980
;B+ INTERNET
981
   
981
   
982
;Functions:
982
;Functions:
983
 ;call add_friend
983
 ;call add_friend
984
 ; ebx+1 - pointer to name
984
 ; ebx+1 - pointer to name
985
 ;   [ebx]=1 - Group name
985
 ;   [ebx]=1 - Group name
986
 ;   [ebx]=2 - Active user
986
 ;   [ebx]=2 - Active user
987
 ;   [ebx]=other - Non active user
987
 ;   [ebx]=other - Non active user
988
 ; ecx - length
988
 ; ecx - length
989
 ;
989
 ;
990
 ;call show_message
990
 ;call show_message
991
 ; ebx - begin of string
991
 ; ebx - begin of string
992
 ; ecx - length
992
 ; ecx - length
993
 ; -----
993
 ; -----
994
 ; NOTE Use format:
994
 ; NOTE Use format:
995
 ;  () 
995
 ;  () 
996
 ;  where:
996
 ;  where:
997
 ;    - friend user char
997
 ;    - friend user char
998
 ;    - message from friend
998
 ;    - message from friend
999
 ;
999
 ;
1000
 ;call find_friend
1000
 ;call find_friend
1001
 ; ebx - begin of name
1001
 ; ebx - begin of name
1002
 ; ecx - length
1002
 ; ecx - length
1003
 ; ret:
1003
 ; ret:
1004
 ; al - friend user char
1004
 ; al - friend user char
1005
 ; -----
1005
 ; -----
1006
 ; NOTE currenly don't show message if al='!'
1006
 ; NOTE currenly don't show message if al='!'
1007
										
1007
										
1008
;Variables
1008
;Variables
1009
 ;usernave (zero terminated)
1009
 ;usernave (zero terminated)
1010
 ;password (zero terminated)
1010
 ;password (zero terminated)
1011
 ;f_name_b - current friend user (to send)
1011
 ;f_name_b - current friend user (to send)
1012
 ;f_name_l - ^ length
1012
 ;f_name_l - ^ length
1013
   
1013
   
1014
;Memory
1014
;Memory
1015
 ; (friend_zone+32*fr_max_lines) < addr: [addr] - free
1015
 ; (friend_zone+32*fr_max_lines) < addr: [addr] - free
1016
   
1016
   
1017
   
1017
   
1018
connect:
1018
connect:
1019
  ;conect to yahoo
1019
  ;conect to yahoo
1020
  ;return 0 if OK
1020
  ;return 0 if OK
1021
  ;return <>0 if some other event (sys.func.23)
1021
  ;return <>0 if some other event (sys.func.23)
1022
  mov  eax,0
1022
  mov  eax,0
1023
  ret
1023
  ret
1024
   
1024
   
1025
disconnect:									
1025
disconnect:									
1026
  ;disconnect
1026
  ;disconnect
1027
  ret
1027
  ret
1028
   
1028
   
1029
check_message:
1029
check_message:
1030
  ;test receive messages
1030
  ;test receive messages
1031
  ret
1031
  ret
1032
   
1032
   
1033
;E:.
1033
;E:.
1034
   
1034
   
1035
   
1035
   
1036
   
1036
   
1037
;B+ Test data                                           ;del
1037
;B+ Test data                                           ;del
1038
friend_zone:						;del
1038
friend_zone:						;del
1039
 db 1,'First:',0					;del
1039
 db 1,'First:',0					;del
1040
 db 2,'hahaha',0					;del
1040
 db 2,'hahaha',0					;del
1041
 db 3,'second',0					;del
1041
 db 3,'second',0					;del
1042
 db 3,'menuetos',0					;del
1042
 db 3,'menuetos',0					;del
1043
 db 1,'Treti:',0					;del
1043
 db 1,'Treti:',0					;del
1044
 db 2,'fourth',0					;del
1044
 db 2,'fourth',0					;del
1045
fr_e db 0						;del
1045
fr_e db 0						;del
1046
							;del
1046
							;del
1047
times 200 db 0						;del
1047
times 200 db 0						;del
1048
							;del
1048
							;del
1049
last_friend_line dd 0x6 				;del
1049
last_friend_line dd 0x6 				;del
1050
 
1050
 
1051
title db 'Messenger (Yahoo Compatible)',0
1051
title db 'Messenger (Yahoo Compatible)',0
1052
   
1052
   
1053
;User / Password
1053
;User / Password
1054
login_txt db 'STATUS:            SESSION: ___.___.___.___'
1054
login_txt db 'STATUS:            SESSION: ___.___.___.___'
1055
		     ;VISIBLE
1055
		     ;VISIBLE
1056
		     ;HIDDEN
1056
		     ;HIDDEN
1057
login_txt_end:
1057
login_txt_end:
1058
user_txt db 'USER ID ->'
1058
user_txt db 'USER ID ->'
1059
user_txt_end:
1059
user_txt_end:
1060
psw_txt db 'PASSWORD ->'
1060
psw_txt db 'PASSWORD ->'
1061
psw_txt_end:
1061
psw_txt_end:
1062
con_txt db 'CONNECT'
1062
con_txt db 'CONNECT'
1063
con_txt_end:
1063
con_txt_end:
1064
dis_txt db 'DISCONNECT'
1064
dis_txt db 'DISCONNECT'
1065
dis_txt_end:
1065
dis_txt_end:
1066
   
1066
   
1067
;E:.
1067
;E:.
1068
I_END:
1068
I_END: