Subversion Repositories Kolibri OS

Rev

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

Rev 3704 Rev 4376
Line 36... Line 36...
36
 
36
 
Line 37... Line 37...
37
include '../../network.inc'
37
include '../../network.inc'
Line 38... Line -...
38
 
-
 
39
start:
38
 
40
 
39
start:
41
        cld
40
 
42
        mov     edi, path       ; Calculate the length of zero-terminated string
41
        mov     edi, path       ; Calculate the length of zero-terminated string
43
        xor     al, al
42
        xor     al, al
44
        mov     ecx, 1024
43
        mov     ecx, 1024
45
        repne   scasb
44
        repne   scasb
46
        dec     edi
45
        dec     edi
Line 47... Line 46...
47
        mov     esi, filename   ; append the path with '.ini'
46
        mov     esi, filename   ; append the path with '.ini'
-
 
47
        movsd
Line 48... Line 48...
48
        movsd
48
        movsb
49
        movsb
49
 
50
 
50
        mcall   68, 11
Line 109... Line 109...
109
 
109
 
110
        push    str7
110
        push    str7
Line 111... Line 111...
111
        call    [con_write_asciiz]
111
        call    [con_write_asciiz]
-
 
112
 
Line 112... Line 113...
112
 
113
        mcall   40, EVM_STACK
113
        mcall   40, EVM_STACK
114
        mcall   10
Line 114... Line 115...
114
 
115
 
115
login:
116
login:
Line 116... Line 117...
116
        call    wait_for_data
117
        call    wait_for_data
117
 
118
 
118
        push    buffer_ptr + 4
119
        push    buffer_ptr + 4
119
        call    [con_write_asciiz]
120
        call    [con_write_asciiz]
120
 
121
 
121
        cmp     dword [buffer_ptr], 11 shl 24
122
        cmp     dword [buffer_ptr], 11 shl 24   ; length of string
122
        jne     login
123
        jne     error
123
        cmp     dword [buffer_ptr + 4], 'Syne'
124
        cmp     dword [buffer_ptr + 4], 'Syne'
Line 124... Line 125...
124
        jne     login
125
        jne     error
125
        cmp     word [buffer_ptr + 8], 'rg'
126
        cmp     word [buffer_ptr + 8], 'rg'
Line 126... Line 127...
126
        jne     login
127
        jne     error
Line 182... Line 183...
182
        je      .next
183
        je      .next
Line 183... Line 184...
183
 
184
 
184
        cmp     dword [edi + 4], 'CIAK' ; resolution changed?
185
        cmp     dword [edi + 4], 'CIAK' ; resolution changed?
Line -... Line 186...
-
 
186
        je      .ciak
-
 
187
 
-
 
188
;        cmp     dword [edi + 4], 'DMWM' ; mouse wheel moved
-
 
189
;        je      .dmwm
-
 
190
 
-
 
191
        cmp     dword [edi + 4], 'DKDN' ; Key pressed
-
 
192
        je      .dkdn
-
 
193
 
-
 
194
        cmp     dword [edi + 4], 'DKUP' ; key up
-
 
195
        je      .dkup
-
 
196
 
-
 
197
        cmp     dword [edi + 4], 'DKRP' ; key auto repeat
185
        je      .ciak
198
        je      .dkrp
186
 
199
 
Line 187... Line 200...
187
        push    str3
200
        push    str3
188
        call    [con_write_asciiz]
201
        call    [con_write_asciiz]
Line 215... Line 228...
215
        mcall   send, [socketnum], screeninfo, screeninfo.length, 0     ; send client name
228
        mcall   send, [socketnum], screeninfo, screeninfo.length, 0     ; send client name
216
        jmp     .next
229
        jmp     .next
Line 217... Line 230...
217
 
230
 
218
 
231
 
-
 
232
  .calv:
219
  .calv:
233
        mcall   send, [socketnum], calv, calv.length, 0                 ; keepalive
Line 220... Line 234...
220
        mcall   send, [socketnum], calv, calv.length, 0     ; looks like ping-pong event
234
 
221
        jmp     .next
235
        jmp     .next
Line 237... Line 251...
237
  .dmmv:
251
  .dmmv:
238
        mov     edx, [edi + 8]
252
        mov     edx, [edi + 8]
239
        bswap   edx
253
        bswap   edx
240
        mcall   18, 19, 4
254
        mcall   18, 19, 4
241
        mcall   send, [socketnum], cnop, cnop.length, 0     ; reply with NOP
255
        mcall   send, [socketnum], cnop, cnop.length, 0     ; reply with NOP
242
        push    str4
-
 
243
        call    [con_write_asciiz]
-
 
244
        jmp     .next
256
        jmp     .next
Line 245... Line 257...
245
 
257
 
-
 
258
  .cout:
-
 
259
        ; TODO: hide cursor
-
 
260
        push    str8
246
  .cout:
261
        call    [con_write_asciiz]
Line 247... Line 262...
247
        jmp     .next
262
        jmp     .next
248
 
263
 
249
  .dmdn:
264
  .dmdn:
250
        movzx   eax, byte [edi + 8]
265
        movzx   eax, byte [edi + 8]
251
        or      [mousestate], eax
266
        or      [mousestate], eax
252
        mcall   18, 19, 5, [mousestate]
-
 
253
        mcall   send, [socketnum], cnop, cnop.length, 0     ; reply with NOP
-
 
254
        push    str5
267
        mcall   18, 19, 5, [mousestate]
Line 255... Line 268...
255
        call    [con_write_asciiz]
268
        mcall   send, [socketnum], cnop, cnop.length, 0     ; reply with NOP
256
        jmp     .next
269
        jmp     .next
257
 
270
 
258
  .dmup:
271
  .dmup:
259
        movzx   eax, byte [edi + 8]
272
        movzx   eax, byte [edi + 8]
260
        not     eax
273
        not     eax
261
        and     [mousestate], eax
-
 
262
        mcall   18, 19, 5, [mousestate]
-
 
263
        mcall   send, [socketnum], cnop, cnop.length, 0     ; reply with NOP
274
        and     [mousestate], eax
Line 264... Line 275...
264
        push    str5
275
        mcall   18, 19, 5, [mousestate]
265
        call    [con_write_asciiz]
276
        mcall   send, [socketnum], cnop, cnop.length, 0     ; reply with NOP
Line -... Line 277...
-
 
277
        jmp     .next
-
 
278
 
-
 
279
  .ciak:
-
 
280
        jmp     .next
-
 
281
 
-
 
282
;  .dmwm:
-
 
283
;        jmp     .next
-
 
284
 
-
 
285
  .dkdn:
-
 
286
        movzx   edx, word[edi + 8 + 4]  ; key button
-
 
287
        rol     dx, 8
-
 
288
        mcall   72, 1, 2                ; send key
-
 
289
        jmp     .next
-
 
290
 
-
 
291
  .dkrp:
-
 
292
        movzx   edx, word[edi + 8 + 6]
-
 
293
        rol     dx, 8
-
 
294
        mcall   72, 1, 2                ; send key
-
 
295
        jmp     .next
-
 
296
 
-
 
297
  .dkup:
-
 
298
        movzx   edx, word[edi + 8 + 4]
-
 
299
        rol     dx, 8
266
        jmp     .next
300
        add     edx, 128
267
 
301
        mcall   72, 1, 2                ; send key
268
  .ciak:
302
 
Line 269... Line 303...
269
        jmp     .next
303
        jmp     .next
270
 
-
 
271
error:
304
 
Line 272... Line 305...
272
        push    str_err
305
error:
Line 273... Line 306...
273
        call    [con_write_asciiz]
306
        push    str_err
Line 285... Line 318...
285
        mcall   -1
318
        mcall   -1
Line 286... Line 319...
286
 
319
 
287
 
320
 
-
 
321
wait_for_data:
-
 
322
        mcall   recv, [socketnum], buffer_ptr, BUFFERSIZE, 0
288
wait_for_data:
323
        inc     eax
289
        mcall   recv, [socketnum], buffer_ptr, BUFFERSIZE, 0
324
        jz      error
Line 290... Line 325...
290
        cmp     eax, -1
325
        dec     eax
291
        je      wait_for_data
326
        jz      closed
Line 292... Line 327...
292
 
327
 
Line -... Line 328...
-
 
328
        cmp     eax, 8
-
 
329
        jb      wait_for_data   ; FIXME
-
 
330
 
-
 
331
        ret
-
 
332
 
-
 
333
closed:
-
 
334
 
Line 293... Line 335...
293
        cmp     eax, 8
335
        push    str_cls
294
        jb      wait_for_data   ; FIXME
336
        call    [con_write_asciiz]
295
 
337
 
296
        ret
338
        jmp     wait_for_key
297
 
339
 
298
 
340
 
299
 
341
 
300
; data
342
; data
301
title   db      'Synergy client',0
343
title   db      'Synergy client',0
302
str0    db      'Welcome to the software KM switch for KolibriOS.',10,10,0
-
 
303
str1    db      'Connecting to: ',0
344
str0    db      'Welcome to the software KM switch for KolibriOS.',10,10,0
304
str7    db      'Connected!',10,0
345
str1    db      'Connecting to: ',0
-
 
346
str7    db      'Connected!',10,0
Line 305... Line 347...
305
str2    db      10,'Handshake received',10,0
347
str2    db      10,'Handshake received',10,0
306
str3    db      'Unsupported command: ',0
348
str3    db      'Unsupported command: ',0
307
newline db      10,0
349
newline db      10,0
308
str4    db      'mouse moved',10,0
350
str6    db      'Entering screen',10,0
Line 339... Line 381...
339
 
381
 
340
 
382
 
341
sockaddr1:
383
sockaddr1:
342
        dw AF_INET4
384
        dw AF_INET4
343
.port   dw 0
385
.port   dw 0
Line 344... Line 386...
344
.ip     dd 192 + 168 shl 8 + 1 shl 16 + 115 shl 24
386
.ip     dd 0
345
        rb 10
387
        rb 10
346
 
388