Subversion Repositories Kolibri OS

Rev

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

Rev 129 Rev 384
Line 28... Line 28...
28
 
28
 
29
setwindowdefaults:
29
setwindowdefaults:
Line 30... Line 30...
30
        pushad
30
        pushad
31
 
31
 
32
        xor   eax,eax
32
        xor   eax,eax
33
        mov   ecx,0xc000
33
        mov   ecx,WIN_STACK
34
       @@:
34
       @@:
35
        inc   eax
35
        inc   eax
36
        add   ecx,2
36
        add   ecx,2
37
        mov   [ecx+0x000],ax          ; process no
37
        mov   [ecx+0x000],ax          ; process no
38
        mov   [ecx+0x400],ax          ; positions in stack
38
        mov   [ecx+0x400],ax          ; positions in stack
Line 39... Line 39...
39
        cmp   ecx,0xc400-2            ; the more high, the more surface
39
        cmp   ecx,WIN_POS-2            ; the more high, the more surface
40
        jnz   @b
40
        jnz   @b
Line 64... Line 64...
64
        xor   ebx, ebx
64
        xor   ebx, ebx
65
        mov   ecx, [0xFE00]
65
        mov   ecx, [0xFE00]
66
        mov   edx, [0xFE04]
66
        mov   edx, [0xFE04]
67
	call	[setscreen]
67
	call	[setscreen]
Line 68... Line 68...
68
 
68
 
69
        mov     ebp, [0x3004]        ; number of processes
69
        mov     ebp, [TASK_COUNT]        ; number of processes
70
        cmp     ebp, 1
70
        cmp     ebp, 1
71
        jbe     .finish
71
        jbe     .finish
72
        align 4
72
        align 4
73
      .new_wnd:
73
      .new_wnd:
74
        movzx   edi, word [0xC400 + esi * 2]
74
        movzx   edi, word [WIN_POS + esi * 2]
Line 75... Line 75...
75
        shl     edi, 5
75
        shl     edi, 5
76
 
76
 
Line 77... Line 77...
77
        cmp     [0x3000+edi+TASKDATA.state], byte 9
77
        cmp     [CURRENT_TASK+edi+TASKDATA.state], byte 9
78
        je      .not_wnd
78
        je      .not_wnd
79
 
79
 
Line 112... Line 112...
112
        jle     @f
112
        jle     @f
113
        mov     edx, [esp+RECT.bottom]
113
        mov     edx, [esp+RECT.bottom]
114
     @@:
114
     @@:
Line 115... Line 115...
115
 
115
 
116
        push    esi
116
        push    esi
117
        movzx   esi, word [0xC400 + esi * 2]
117
        movzx   esi, word [WIN_POS + esi * 2]
118
	call	[setscreen]
118
	call	[setscreen]
Line 119... Line 119...
119
        pop     esi
119
        pop     esi
120
 
120
 
Line 189... Line 189...
189
     jne  dspl00
189
     jne  dspl00
190
     mov  [windowtypechanged],dword 0
190
     mov  [windowtypechanged],dword 0
191
  redraw_screen_direct:
191
  redraw_screen_direct:
192
     mov  [dlx],dword 0
192
     mov  [dlx],dword 0
193
     mov  [dly],dword 0
193
     mov  [dly],dword 0
194
     mov  eax,[0xfe00]
194
     mov  eax,[ScreenWidth]
195
     mov  [dlxe],eax
195
     mov  [dlxe],eax
196
     mov  eax,[0xfe04]
196
     mov  eax,[ScreenHeight]
197
     mov  [dlye],eax
197
     mov  [dlye],eax
198
     mov  eax,window_data
198
     mov  eax,window_data
199
     call redrawscreen
199
     call redrawscreen
200
   dspl00:
200
   dspl00:
201
     popad
201
     popad
Line 215... Line 215...
215
   dspl1:
215
   dspl1:
Line 216... Line 216...
216
 
216
 
217
     cmp  eax,2       ; set common window colours
217
     cmp  eax,2       ; set common window colours
218
     jne  no_com_colours
218
     jne  no_com_colours
219
     mov  [windowtypechanged],dword 1
219
     mov  [windowtypechanged],dword 1
220
     mov  esi,[0x3010]
220
     mov  esi,[TASK_BASE]
221
     add  esi,TASKDATA.mem_start
221
     add  esi,TASKDATA.mem_start
222
     add  ebx,[esi]
222
     add  ebx,[esi]
223
     mov  esi,ebx
223
     mov  esi,ebx
224
     mov  edi,common_colours
224
     mov  edi,common_colours
Line 229... Line 229...
229
     ret
229
     ret
230
   no_com_colours:
230
   no_com_colours:
Line 231... Line 231...
231
 
231
 
232
     cmp  eax,3       ; get common window colours
232
     cmp  eax,3       ; get common window colours
233
     jne  no_get_com
233
     jne  no_get_com
234
     mov  esi,[0x3010]
234
     mov  esi,[TASK_BASE]
235
     add  esi,TASKDATA.mem_start
235
     add  esi,TASKDATA.mem_start
236
     add  ebx,[esi]
236
     add  ebx,[esi]
237
     mov  edi,ebx
237
     mov  edi,ebx
238
     mov  esi,common_colours
238
     mov  esi,common_colours
Line 267... Line 267...
267
        jne     no_set_workarea
267
        jne     no_set_workarea
268
        movsx   eax,word[esp+16+2]
268
        movsx   eax,word[esp+16+2]
269
        movsx   ebx,word[esp+16]
269
        movsx   ebx,word[esp+16]
270
        cmp     eax,ebx
270
        cmp     eax,ebx
271
        jge     .lp1
271
        jge     .lp1
272
        or      eax,eax;[0xFE00]
272
        or      eax,eax;[ScreenWidth]
273
        jl      @f
273
        jl      @f
274
        mov     [screen_workarea.left],eax
274
        mov     [screen_workarea.left],eax
275
    @@: cmp     ebx,[0xFE00]
275
    @@: cmp     ebx,[ScreenWidth]
276
        jg      .lp1
276
        jg      .lp1
277
        mov     [screen_workarea.right],ebx
277
        mov     [screen_workarea.right],ebx
278
  .lp1: movsx   eax,word[esp+24+2]
278
  .lp1: movsx   eax,word[esp+24+2]
279
        movsx   ebx,word[esp+24]
279
        movsx   ebx,word[esp+24]
280
        cmp     eax,ebx
280
        cmp     eax,ebx
281
        jge     .lp2
281
        jge     .lp2
282
        or      eax,eax;[0xFE04]
282
        or      eax,eax;[0xFE04]
283
        jl      @f
283
        jl      @f
284
        mov     [screen_workarea.top],eax
284
        mov     [screen_workarea.top],eax
285
    @@: cmp     ebx,[0xFE04]
285
    @@: cmp     ebx,[ScreenHeight]
286
        jg      .lp2
286
        jg      .lp2
287
        mov     [screen_workarea.bottom],ebx
287
        mov     [screen_workarea.bottom],ebx
288
  .lp2: call    repos_windows
288
  .lp2: call    repos_windows
289
        mov     eax, 0
289
        mov     eax, 0
290
        mov     ebx, 0
290
        mov     ebx, 0
291
        mov     ecx, [0xfe00]
291
        mov     ecx, [ScreenWidth]
292
        mov     edx, [0xfe04]
292
        mov     edx, [ScreenHeight]
293
	call	[calculatescreen]
293
	call	[calculatescreen]
294
;    jmp    redraw_screen_direct
294
;    jmp    redraw_screen_direct
295
    .exit:
295
    .exit:
296
        popad
296
        popad
297
        ret
297
        ret
Line 308... Line 308...
308
   no_get_skinmargins:
308
   no_get_skinmargins:
Line 309... Line 309...
309
 
309
 
310
        cmp     eax,8       ; set window skin
310
        cmp     eax,8       ; set window skin
311
        jne     no_set_skin
311
        jne     no_set_skin
312
        mov     eax,ebx
312
        mov     eax,ebx
313
        mov     edi,[0x3010]
313
        mov     edi,[TASK_BASE]
314
        add     ebx,[edi+TASKDATA.mem_start]        ; abs start of info block
314
        add     ebx,[edi+TASKDATA.mem_start]        ; abs start of info block
315
        pushd   [ebx+0] [ebx+4] [ebx+8] [ebx+12]
315
        pushd   [ebx+0] [ebx+4] [ebx+8] [ebx+12]
316
        mov     dword[ebx+0],0        ; read
316
        mov     dword[ebx+0],0        ; read
317
        mov     dword[ebx+4],0        ; from the beginning
317
        mov     dword[ebx+4],0        ; from the beginning
Line 338... Line 338...
338
        rep     movsd
338
        rep     movsd
339
        call    parse_skin_data
339
        call    parse_skin_data
340
    pushad
340
    pushad
341
        mov     eax, 0
341
        mov     eax, 0
342
        mov     ebx, 0
342
        mov     ebx, 0
343
        mov     ecx, [0xfe00]
343
        mov     ecx, [ScreenWidth]
344
        mov     edx, [0xfe04]
344
        mov     edx, [ScreenHeight]
345
        call    [calculatescreen]
345
        call    [calculatescreen]
346
    popad
346
    popad
347
        mov     dword[esp+32+36],0
347
        mov     dword[esp+32+36],0
348
        jmp     redraw_screen_direct
348
        jmp     redraw_screen_direct
349
  .exit:
349
  .exit:
Line 355... Line 355...
355
     popad
355
     popad
356
     ret
356
     ret
Line 357... Line 357...
357
 
357
 
358
 
358
 
359
repos_windows:
359
repos_windows:
360
        mov     ecx,[0x3004]
360
        mov     ecx,[TASK_COUNT]
361
        mov     esi,0x20*2
361
        mov     edi,0x20*2
362
    mov    byte[0x0000fff0],1
362
    mov    byte[REDRAW_BACKGROUND],1
363
        dec     ecx
363
        dec     ecx
364
        jge    @f
364
        jge    @f
365
        ret
365
        ret
366
    @@: mov    [esi+WDATA.fl_redraw],1
366
    @@: mov     [edi+WDATA.fl_redraw],1
367
    test    [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED
367
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
368
        jz      .lp2
368
        jz      .lp2
369
        mov     eax,[screen_workarea.left]
369
        mov     eax,[screen_workarea.left]
370
        mov     [esi+WDATA.box.left],eax
370
        mov     [edi+WDATA.box.left],eax
371
        sub     eax,[screen_workarea.right]
371
        sub     eax,[screen_workarea.right]
372
        neg     eax
372
        neg     eax
373
        mov     [esi+WDATA.box.width],eax
373
        mov     [edi+WDATA.box.width],eax
374
        mov     eax,[screen_workarea.top]
374
        mov     eax,[screen_workarea.top]
375
        mov     [esi+WDATA.box.top],eax
375
        mov     [edi+WDATA.box.top],eax
376
        test    [esi+WDATA.fl_wstate],WSTATE_ROLLEDUP
376
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
377
        jnz     .lp1
377
        jnz     .lp1
378
        sub     eax,[screen_workarea.bottom]
378
        sub     eax,[screen_workarea.bottom]
-
 
379
        neg     eax
-
 
380
        mov     [edi+WDATA.box.height],eax
379
        neg     eax
381
  .lp1:
380
        mov     [esi+WDATA.box.height],eax
382
        call    set_window_clientbox
381
  .lp1: add     esi,0x20
383
        add     edi,0x20
382
        loop    @b
384
        loop    @b
383
        ret
385
        ret
384
  .lp2: mov     eax,[esi+WDATA.box.left]
386
  .lp2: mov     eax,[edi+WDATA.box.left]
385
        add     eax,[esi+WDATA.box.width]
387
        add     eax,[edi+WDATA.box.width]
386
    mov    ebx,[0x0000fe00]
388
    mov    ebx,[ScreenWidth]
387
;    inc    ebx
389
;    inc    ebx
388
    cmp    eax,ebx
390
    cmp    eax,ebx
389
    jle    .lp4
391
    jle    .lp4
390
        mov     eax,[esi+WDATA.box.width]
392
        mov     eax,[edi+WDATA.box.width]
391
    sub    eax,ebx
393
    sub    eax,ebx
392
    jle    .lp3
394
    jle    .lp3
393
        mov     [esi+WDATA.box.width],ebx
395
        mov     [edi+WDATA.box.width],ebx
394
  .lp3: sub     ebx,[esi+WDATA.box.width]
396
  .lp3: sub     ebx,[edi+WDATA.box.width]
395
        mov     [esi+WDATA.box.left],ebx
397
        mov     [edi+WDATA.box.left],ebx
396
  .lp4: mov     eax,[esi+WDATA.box.top]
398
  .lp4: mov     eax,[edi+WDATA.box.top]
397
        add     eax,[esi+WDATA.box.height]
399
        add     eax,[edi+WDATA.box.height]
398
    mov    ebx,[0x0000fe04]
400
    mov    ebx,[ScreenHeight]
399
;    inc    ebx
401
;    inc    ebx
400
    cmp    eax,ebx
402
    cmp    eax,ebx
401
    jle    .lp6
403
    jle    .lp6
402
        mov     eax,[esi+WDATA.box.height]
404
        mov     eax,[edi+WDATA.box.height]
403
    sub    eax,ebx
405
    sub    eax,ebx
404
    jle    .lp5
406
    jle    .lp5
405
        mov     [esi+WDATA.box.height],ebx
407
        mov     [edi+WDATA.box.height],ebx
406
  .lp5: sub     ebx,[esi+WDATA.box.height]
408
  .lp5: sub     ebx,[edi+WDATA.box.height]
407
        mov     [esi+WDATA.box.top],ebx
-
 
408
  .lp6: add     esi,0x20
-
 
Line 409... Line 409...
409
        loop    @b
409
        mov     [edi+WDATA.box.top],ebx
410
    ret
410
  .lp6: jmp     .lp1
411
 
411
 
412
uglobal
412
uglobal
Line 432... Line 432...
432
 
432
 
433
    mov   eax,[timer_ticks]
433
    mov   eax,[timer_ticks]
434
    cmp   [new_window_starting],eax
434
    cmp   [new_window_starting],eax
Line 435... Line 435...
435
    jb    swml1
435
    jb    swml1
436
 
436
 
Line 437... Line 437...
437
    mov   [0xfff4],byte 0  ; no mouse background
437
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
Line 438... Line 438...
438
    mov   [0xfff5],byte 0  ; draw mouse
438
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
Line 472... Line 472...
472
        inc   eax
472
        inc   eax
473
        shl   eax,16
473
        shl   eax,16
474
        add   eax,[esi+WDATA.box.left]
474
        add   eax,[esi+WDATA.box.left]
475
        add   eax,[esi+WDATA.box.width]
475
        add   eax,[esi+WDATA.box.width]
476
        sub   eax,1
476
        sub   eax,1
-
 
477
        push  edx
-
 
478
        mov   edx,0x80000000
-
 
479
        mov   ecx,[esi+WDATA.cl_titlebar]
-
 
480
        and   ecx,edx
-
 
481
        cmp   ecx,edx
-
 
482
        jnz   .nofa
477
        mov   ecx,[esi+WDATA.cl_titlebar]
483
        mov   ecx,[esi+WDATA.cl_titlebar]
478
	test	ecx,0x80000000
-
 
479
	jz	.nofa
-
 
480
        sub   ecx,0x00040404
484
        sub   ecx,0x00040404
481
        mov   [esi+WDATA.cl_titlebar],ecx
485
        mov   [esi+WDATA.cl_titlebar],ecx
-
 
486
        and   ecx,0x00ffffff
-
 
487
        jmp   .faj
482
  .nofa:
488
  .nofa:
483
  .faj:
489
        mov   ecx,[esi+WDATA.cl_titlebar]
484
        and   ecx,0x00ffffff
490
        and   ecx,0x00ffffff
-
 
491
  .faj:
-
 
492
        pop   edx
485
        mov   edi,0
493
        mov   edi,0
486
        call  [draw_line]
494
        call  [draw_line]
487
        inc   edx
495
        inc   edx
488
        cmp   edx,[esp]
496
        cmp   edx,[esp]
489
        jl    .drwi
497
        jl    .drwi
Line 495... Line 503...
495
 
503
 
Line 496... Line 504...
496
 
504
 
-
 
505
drawwindow_I:
Line 497... Line 506...
497
drawwindow_I:
506
 
498
 
507
        pushad
499
        pushad
508
        or      [edx+WDATA.fl_wdrawn], 4
500
 
509
 
Line 507... Line 516...
507
        shl   ebx,16
516
        shl   ebx,16
508
        add   ebx,[edx+WDATA.box.top]
517
        add   ebx,[edx+WDATA.box.top]
509
        add   ebx,[edx+WDATA.box.height]
518
        add   ebx,[edx+WDATA.box.height]
510
        call  draw_rectangle
519
        call  draw_rectangle
Line -... Line 520...
-
 
520
 
-
 
521
        and     [edx+WDATA.fl_wdrawn], not 4
-
 
522
        test    [edx+WDATA.fl_wdrawn], 2
-
 
523
        jz      @f
-
 
524
        call    drawwindowframes
-
 
525
@@:
511
 
526
 
Line 512... Line 527...
512
        call    drawwindow_I_caption
527
        call    drawwindow_I_caption
513
 
528
 
514
        mov   edx,[esi+WDATA.box.top]      ; inside work area
529
        mov   edx,[esi+WDATA.box.top]      ; inside work area
Line 520... Line 535...
520
        mov   eax,1
535
        mov   eax,1
521
        mov   ebx,21
536
        mov   ebx,21
522
        mov   ecx,[esi+WDATA.box.width]
537
        mov   ecx,[esi+WDATA.box.width]
523
        mov   edx,[esi+WDATA.box.height]
538
        mov   edx,[esi+WDATA.box.height]
524
        mov   edi,[esi+WDATA.cl_workarea]
539
        mov   edi,[esi+WDATA.cl_workarea]
-
 
540
	test  edi,0x40000000
-
 
541
	jnz   noinside
525
        call  [drawbar]
542
        call  [drawbar]
526
      noinside:
543
      noinside:
Line 527... Line 544...
527
 
544
 
Line 636... Line 653...
636
    add   bx, word [edi+WDATA.box.height]
653
    add   bx, word [edi+WDATA.box.height]
637
        mov   esi,[edi+WDATA.cl_frames]
654
        mov   esi,[edi+WDATA.cl_frames]
638
        shr   esi,1
655
        shr   esi,1
639
        and   esi,0x007f7f7f
656
        and   esi,0x007f7f7f
640
        push  esi
657
        push  esi
-
 
658
        or      [edi+WDATA.fl_wdrawn], 4
641
        call  draw_rectangle
659
        call  draw_rectangle
-
 
660
        and     [edi+WDATA.fl_wdrawn], not 4
-
 
661
        test    [edi+WDATA.fl_wdrawn], 2
-
 
662
        jz      @f
-
 
663
        call    drawwindowframes
-
 
664
@@:
642
        mov   ecx,3
665
        mov   ecx,3
643
      dw3l:
666
      dw3l:
644
        add   eax,1*65536-1
667
        add   eax,1*65536-1
645
        add   ebx,1*65536-1
668
        add   ebx,1*65536-1
646
        mov   esi,[edi+WDATA.cl_frames]
669
        mov   esi,[edi+WDATA.cl_frames]
Line 665... Line 688...
665
        mov   ecx,[esi+WDATA.box.width]
688
        mov   ecx,[esi+WDATA.box.width]
666
        mov   edx,[esi+WDATA.box.height]
689
        mov   edx,[esi+WDATA.box.height]
667
        sub   ecx,4
690
        sub   ecx,4
668
        sub   edx,4
691
        sub   edx,4
669
        mov   edi,[esi+WDATA.cl_workarea]
692
        mov   edi,[esi+WDATA.cl_workarea]
-
 
693
	test  edi,0x40000000
-
 
694
	jnz   noinside2
670
        call  [drawbar]
695
        call  [drawbar]
671
      noinside2:
696
      noinside2:
Line 672... Line 697...
672
 
697
 
Line 684... Line 709...
684
 
709
 
Line 685... Line 710...
685
        pushad
710
        pushad
686
 
711
 
687
     ; if type of current active window is 3,
712
     ; if type of current active window is 3,
688
     ; it must be redrawn
713
     ; it must be redrawn
689
        mov   eax, [0x3004]
714
        mov   eax, [TASK_COUNT]
690
        movzx eax, word [0xC400 + eax*2]
715
        movzx eax, word [WIN_POS + eax*2]
691
        shl   eax, 5
716
        shl   eax, 5
692
        add   eax, window_data
717
        add   eax, window_data
693
        mov   ebx, [eax + WDATA.cl_workarea]
718
        mov   ebx, [eax + WDATA.cl_workarea]
Line 697... Line 722...
697
        mov   [eax + WDATA.fl_redraw], byte 1
722
        mov   [eax + WDATA.fl_redraw], byte 1
698
     @@:
723
     @@:
Line 699... Line 724...
699
 
724
 
700
        push   esi
725
        push   esi
701
      movzx   eax, word [esi] ; ax <- process no
726
      movzx   eax, word [esi] ; ax <- process no
Line 702... Line 727...
702
      movzx   eax, word [0xC000+eax*2] ; ax <- position in window stack
727
      movzx   eax, word [WIN_STACK+eax*2] ; ax <- position in window stack
703
 
728
 
704
        xor   esi, esi        ; drop others
729
        xor   esi, esi        ; drop others
705
      waloop:
730
      waloop:
706
        cmp   esi, dword [0x3004]
731
        cmp   esi, dword [TASK_COUNT]
707
        jae   wacont
732
        jae   wacont
708
        inc   esi
733
        inc   esi
709
        lea   edi, [0xC000 + esi*2]
734
        lea   edi, [WIN_STACK + esi*2]
710
        mov   bx, [edi] ; position of the current process
735
        mov   bx, [edi] ; position of the current process
711
        cmp   bx, ax
736
        cmp   bx, ax
712
        jbe   @f
737
        jbe   @f
Line 717... Line 742...
717
      wacont:
742
      wacont:
718
                            ; set to no 1
743
                            ; set to no 1
719
        pop   esi           ;   esi = pointer at 0xC400
744
        pop   esi           ;   esi = pointer at 0xC400
Line 720... Line 745...
720
 
745
 
721
      movzx   eax, word [esi]
746
      movzx   eax, word [esi]
722
        mov   bx, [0x3004]  ; number of processes
747
        mov   bx, [TASK_COUNT]  ; number of processes
Line 723... Line 748...
723
        mov   [0xC000+eax*2], bx     ; this is the last (and the upper)
748
        mov   [WIN_STACK+eax*2], bx     ; this is the last (and the upper)
724
 
749
 
725
        ; update on screen -window stack
750
        ; update on screen -window stack
-
 
751
        xor   esi, esi
726
        xor   esi, esi
752
      waloop2:
727
      waloop2:
753
        mov   edi, [TASK_COUNT]
728
	cmp	esi,[0x3004]
754
        cmp   esi, edi
729
        jae   wacont2
755
        jae   wacont2
730
        inc   esi
756
        inc   esi
731
        movzx ebx, word [esi*2 + 0xC000]
757
        movzx ebx, word [esi*2 + WIN_STACK]
732
        mov   [ebx*2 + 0xC400], si
758
        mov   [ebx*2 + WIN_POS], si
733
        jmp   waloop2
759
        jmp   waloop2
734
      wacont2:
760
      wacont2:
735
        mov   [0xf400], byte 0           ; empty keyboard buffer
761
        mov   [KEY_COUNT], byte 0           ; empty keyboard buffer
736
        mov   [0xf500], byte 0           ; empty button buffer
762
        mov   [BTN_COUNT], byte 0           ; empty button buffer
Line 737... Line 763...
737
        popad
763
        popad
Line 753... Line 779...
753
        sub   esi, window_data
779
        sub   esi, window_data
754
        shr   esi, 5
780
        shr   esi, 5
Line 755... Line 781...
755
 
781
 
Line 756... Line 782...
756
        ; esi = process number
782
        ; esi = process number
757
 
783
 
Line 758... Line 784...
758
        movzx eax, word [0xC000 + esi * 2] ; get value of the curr process
784
        movzx eax, word [WIN_STACK + esi * 2] ; get value of the curr process
Line 759... Line 785...
759
        lea   esi, [0xC400 + eax * 2]      ; get address of this process at 0xC400
785
        lea   esi, [WIN_POS + eax * 2]      ; get address of this process at 0xC400
Line 760... Line 786...
760
 
786
 
761
        push  esi
787
        push  esi
762
 
788
 
Line 763... Line 789...
763
      .new_check:
789
      .new_check:
764
 
790
 
Line 765... Line 791...
765
        pop   esi
791
        pop   esi
766
        add   esi, 2
792
        add   esi, 2
Line 767... Line 793...
767
        push  esi
793
        push  esi
768
 
794
 
769
        mov   eax, [0x3004]
795
        mov   eax, [TASK_COUNT]
770
        lea   eax, word [0xC400 + eax * 2] ; number of the upper window
796
        lea   eax, word [WIN_POS + eax * 2] ; number of the upper window
Line 771... Line 797...
771
 
797
 
Line 772... Line 798...
772
        cmp   esi, eax
798
        cmp   esi, eax
Line 825... Line 851...
825
        call  checkwindowdraw      ; draw window on activation ?
851
        call  checkwindowdraw      ; draw window on activation ?
826
        test  ecx, ecx
852
        test  ecx, ecx
827
        jz    .do_not_draw
853
        jz    .do_not_draw
Line 828... Line 854...
828
 
854
 
829
        popad
855
        popad
830
        mov   [0xfb44], byte 1     ; do draw mouse
856
        mov   [MOUSE_DOWN], byte 1     ; do draw mouse
Line 831... Line 857...
831
        call  windowactivate
857
        call  windowactivate
832
 
858
 
833
        ; update screen info
859
        ; update screen info
834
	call	[calc_clipping_rects]
860
	call	[calc_clipping_rects]
835
        pushad
861
        pushad
836
        mov   edi, [0x3004] ; the last process (number)
862
        mov   edi, [TASK_COUNT] ; the last process (number)
837
        movzx esi, word [0xC400 + edi * 2]
863
        movzx esi, word [WIN_POS + edi * 2]
Line 838... Line 864...
838
        shl   esi, 5
864
        shl   esi, 5
839
        add   esi, window_data
865
        add   esi, window_data
Line 845... Line 871...
845
    mov   edx, [esi + WDATA.box.height] ; sy
871
    mov   edx, [esi + WDATA.box.height] ; sy
Line 846... Line 872...
846
 
872
 
847
        add   ecx, eax       ; ecx = x_end
873
        add   ecx, eax       ; ecx = x_end
Line 848... Line 874...
848
        add   edx, ebx       ; edx = y_end
874
        add   edx, ebx       ; edx = y_end
849
 
875
 
850
        mov   edi, [0x3004]
876
        mov   edi, [TASK_COUNT]
851
        movzx esi, word [0xC400 + edi * 2]
877
        movzx esi, word [WIN_POS + edi * 2]
Line 852... Line 878...
852
        call  [setscreen]
878
        call  [setscreen]
853
        popad
879
        popad
Line 854... Line 880...
854
 
880
 
Line 855... Line 881...
855
    mov   [edi + WDATA.fl_redraw], 1  ; redraw flag for app
881
    mov   [edi + WDATA.fl_redraw], 1  ; redraw flag for app
Line 856... Line 882...
856
    mov   [0xfb44],byte 0             ; mouse down checks
882
    mov   [MOUSE_DOWN],byte 0             ; mouse down checks
Line 857... Line 883...
857
 
883
 
858
        ret
884
        ret
859
 
885
 
860
     .do_not_draw:
886
     .do_not_draw:
861
 
887
 
Line 862... Line 888...
862
        popad
888
        popad
863
 
889
 
864
        call  windowactivate
890
        call  windowactivate
865
        mov   [0xfb44],byte 0  ; mouse down checks
891
        mov   [MOUSE_DOWN],byte 0  ; mouse down checks
866
        mov   [0xfff4],byte 0  ; no mouse background
892
        mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
867
        mov   [0xfff5],byte 0  ; draw mouse
893
        mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
868
        ret
894
        ret
869
 
895
 
870
 
896
 
Line 902... Line 928...
902
; eax = window number on screen
928
; eax = window number on screen
903
; corrupts registers and [dl*]
929
; corrupts registers and [dl*]
904
restore_minimized_window:
930
restore_minimized_window:
905
        pushfd
931
        pushfd
906
        cli
932
        cli
907
        movzx esi, word [0xC400+eax*2]
933
        movzx esi, word [WIN_POS+eax*2]
908
        mov   edi, esi
934
        mov   edi, esi
909
        shl   edi, 5
935
        shl   edi, 5
910
        add   edi, window_data
936
        add   edi, window_data
911
        test  [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
937
        test  [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
912
        jz    .skip_redrawings
938
        jz    .skip_redrawings
913
        mov   [edi+WDATA.fl_redraw], 1
939
        mov   [edi+WDATA.fl_redraw], 1
914
        and   [edi+WDATA.fl_wstate], not WSTATE_MINIMIZED
940
        and   [edi+WDATA.fl_wstate], not WSTATE_MINIMIZED
915
        cmp   eax, [0x3004] ; the uppermost window
941
        cmp   eax, [TASK_COUNT] ; the uppermost window
916
        jnz   .no_uppermost
942
        jnz   .no_uppermost
917
        mov   eax, [edi+WDATA.box.left]
943
        mov   eax, [edi+WDATA.box.left]
918
        mov   ebx, [edi+WDATA.box.top]
944
        mov   ebx, [edi+WDATA.box.top]
919
        mov   ecx, eax
945
        mov   ecx, eax
920
        mov   edx, ebx
946
        mov   edx, ebx
Line 929... Line 955...
929
        mov   edx, ebx
955
        mov   edx, ebx
930
        add   ecx, [edi+WDATA.box.width]
956
        add   ecx, [edi+WDATA.box.width]
931
        add   edx, [edi+WDATA.box.height]
957
        add   edx, [edi+WDATA.box.height]
932
        call  [calculatescreen]
958
        call  [calculatescreen]
933
.done:
959
.done:
934
        mov   [0xfff4],byte 0 ; no mouse under
960
        mov   [MOUSE_BACKGROUND],byte 0 ; no mouse under
935
.skip_redrawings:
961
.skip_redrawings:
936
        popfd
962
        popfd
937
        ret
963
        ret
Line 947... Line 973...
947
checkwindows:
973
checkwindows:
948
        pushad
974
        pushad
Line 949... Line 975...
949
 
975
 
950
        cmp   [window_minimize], 0
976
        cmp   [window_minimize], 0
951
        je    .no_minimizing
977
        je    .no_minimizing
952
        mov   eax, [0x3004]       ; the uppermost window
978
        mov   eax, [TASK_COUNT]       ; the uppermost window
953
        mov   bl, 0
979
        mov   bl, 0
954
        xchg  [window_minimize], bl
980
        xchg  [window_minimize], bl
955
        cmp   bl, 1
981
        cmp   bl, 1
956
        jne   .restore
982
        jne   .restore
Line 959... Line 985...
959
  .restore:
985
  .restore:
960
        call  restore_minimized_window
986
        call  restore_minimized_window
961
  .continue:
987
  .continue:
962
  .no_minimizing:
988
  .no_minimizing:
Line 963... Line 989...
963
 
989
 
964
        cmp   [0xfb40],byte 0    ; mouse buttons pressed ?
990
        cmp   [BTN_DOWN],byte 0    ; mouse buttons pressed ?
965
        jne   .mouse_buttons_pressed
991
        jne   .mouse_buttons_pressed
966
        popad
992
        popad
967
        ret
993
        ret
Line 968... Line 994...
968
    .mouse_buttons_pressed:
994
    .mouse_buttons_pressed:
969
 
995
 
Line 970... Line 996...
970
        mov   esi,[0x3004]
996
        mov   esi,[TASK_COUNT]
971
        inc   esi
997
        inc   esi
972
 
998
 
Line 973... Line 999...
973
      cwloop:
999
      cwloop:
974
        cmp   esi,2
1000
        cmp   esi,2
975
        jb   .exit
1001
        jb   .exit
976
 
1002
 
977
        dec   esi
1003
        dec   esi
978
        movzx edi, word [0xC400 + esi * 2] ; ebx
1004
        movzx edi, word [WIN_POS + esi * 2] ; ebx
979
        shl   edi, 5
1005
        shl   edi, 5
Line 985... Line 1011...
985
        mov   eax,ecx
1011
        mov   eax,ecx
986
        mov   ebx,edx
1012
        mov   ebx,edx
987
        test    [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
1013
        test    [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
988
        jnz     cwloop
1014
        jnz     cwloop
Line 989... Line 1015...
989
 
1015
 
990
       movzx  eax, word [0xfb0a]
1016
       movzx  eax, word [MOUSE_X]
Line 991... Line 1017...
991
       movzx  ebx, word [0xfb0c]
1017
       movzx  ebx, word [MOUSE_Y]
992
       
1018
 
993
	cmp	eax,ecx
1019
	cmp	eax,ecx
994
	jl	cwloop
1020
	jl	cwloop
Line 1001... Line 1027...
1001
        cmp   ebx, edx
1027
        cmp   ebx, edx
1002
	jg	cwloop
1028
	jg	cwloop
Line 1003... Line 1029...
1003
 
1029
 
1004
        pushad
1030
        pushad
1005
        mov   eax, esi
1031
        mov   eax, esi
1006
        mov   ebx, [0x3004]
1032
        mov   ebx, [TASK_COUNT]
1007
        cmp   eax, ebx      ; is this window active?
1033
        cmp   eax, ebx      ; is this window active?
Line 1008... Line 1034...
1008
        jz    .move_resize_window
1034
        jz    .move_resize_window
1009
 
1035
 
1010
        ; eax = position in windowing stack
1036
        ; eax = position in windowing stack
1011
        ; redraw must ?
1037
        ; redraw must ?
1012
        lea   esi, [0xC400 + esi * 2]
1038
        lea   esi, [WIN_POS + esi * 2]
Line 1013... Line 1039...
1013
        call  waredraw
1039
        call  waredraw
1014
        add   esp, 32
1040
        add   esp, 32
1015
 
1041
 
Line 1016... Line 1042...
1016
      .exit:
1042
      .exit:
1017
        popad
-
 
1018
        ret
1043
        popad
Line 1019... Line 1044...
1019
 
1044
        ret
1020
   .move_resize_window:    ; MOVE OR RESIZE WINDOW
1045
 
1021
 
1046
   .move_resize_window:    ; MOVE OR RESIZE WINDOW
Line 1066... Line 1091...
1066
        mov   edx, ecx
1091
        mov   edx, ecx
1067
        sub   edx, [latest_window_touch]
1092
        sub   edx, [latest_window_touch]
1068
        mov   [latest_window_touch], ecx
1093
        mov   [latest_window_touch], ecx
1069
        mov   [latest_window_touch_delta], edx
1094
        mov   [latest_window_touch_delta], edx
Line 1070... Line 1095...
1070
 
1095
 
1071
        mov   cl, [0xfb40]     ; save for shade check
1096
        mov   cl, [BTN_DOWN]     ; save for shade check
1072
        mov   [do_resize], cl
1097
        mov   [do_resize], cl
1073
     no_emulation_righ_button:
1098
     no_emulation_righ_button:
1074
    mov   ecx, [edi + WDATA.box.left]
1099
    mov   ecx, [edi + WDATA.box.left]
Line 1084... Line 1109...
1084
        pop   edx ecx eax
1109
        pop   edx ecx eax
Line 1085... Line 1110...
1085
 
1110
 
1086
        sub   eax, ecx
1111
        sub   eax, ecx
Line 1087... Line 1112...
1087
        sub   ebx, edx
1112
        sub   ebx, edx
1088
 
1113
 
Line 1089... Line 1114...
1089
        mov   esi, [0xfb0a]
1114
        mov   esi, [MOUSE_X]
1090
        mov   [0xf300], esi
1115
        mov   [WIN_TEMP_XY], esi
1091
 
1116
 
1092
        push  eax;ad           ; wait for putimages to finish
1117
        push  eax;ad           ; wait for putimages to finish
Line 1114... Line 1139...
1114
        jnz     @f
1139
        jnz     @f
1115
        call  drawwindowframes
1140
        call  drawwindowframes
1116
    @@:
1141
    @@:
Line 1117... Line 1142...
1117
 
1142
 
1118
        mov   [reposition],0
1143
        mov   [reposition],0
Line 1119... Line 1144...
1119
        mov   [0xfb44],byte 1   ; no reaction to mouse up/down
1144
        mov   [MOUSE_DOWN],byte 1   ; no reaction to mouse up/down
Line 1120... Line 1145...
1120
 
1145
 
Line 1121... Line 1146...
1121
        ; move window
1146
        ; move window
Line 1122... Line 1147...
1122
 
1147
 
Line 1123... Line 1148...
1123
      newchm:
1148
      newchm:
Line 1124... Line 1149...
1124
 
1149
 
Line 1125... Line 1150...
1125
        mov   [0xfff5],byte 1
1150
        mov   [DONT_DRAW_MOUSE],byte 1
Line 1126... Line 1151...
1126
 
1151
 
1127
        call  checkidle
1152
        call  checkidle
1128
 
1153
 
Line 1129... Line 1154...
1129
        call  checkVga_N13
1154
        call  checkVga_N13
1130
 
1155
 
1131
        mov   [0xfff4],byte 0
1156
        mov   [MOUSE_BACKGROUND],byte 0
Line 1132... Line 1157...
1132
 
1157
 
1133
        call  [draw_pointer]
1158
        call  [draw_pointer]
1134
 
1159
 
1135
        pushad
1160
        pushad
1136
        call   stack_handler
1161
        call   stack_handler
1137
        popad
1162
        popad
1138
 
1163
 
1139
        mov   esi,[0xf300]
1164
        mov   esi,[WIN_TEMP_XY]
1140
        cmp   esi,[0xfb0a]
1165
        cmp   esi,[MOUSE_X]
1141
        je    cwb
1166
        je    cwb
Line 1142... Line 1167...
1142
 
1167
 
1143
        movzx ecx,word[0xfb0a]
1168
        movzx ecx,word[MOUSE_X]
Line 1144... Line 1169...
1144
        movzx edx,word[0xfb0c]
1169
        movzx edx,word[MOUSE_Y]
1145
        sub   ecx,eax
1170
        sub   ecx,eax
Line 1146... Line 1171...
1146
        sub   edx,ebx
1171
        sub   edx,ebx
Line 1176... Line 1201...
1176
        mov   edx,edi
1201
        mov   edx,edi
1177
        sub   edx,window_data
1202
        sub   edx,window_data
1178
        ;shr   edx,5
1203
        ;shr   edx,5
1179
        ;shl   edx,8
1204
        ;shl   edx,8
1180
        ;add   edx,0x80000                 ; process base at 0x80000+
1205
        ;add   edx,0x80000                 ; process base at 0x80000+
1181
    lea   edx, [0x80000 + edx*8]
1206
    lea   edx, [SLOT_BASE + edx*8]
Line 1182... Line 1207...
1182
 
1207
 
1183
        movzx eax,word [0xfb0a]
1208
        movzx eax,word [MOUSE_X]
1184
    cmp   eax,[edi + WDATA.box.left]
1209
    cmp   eax,[edi + WDATA.box.left]
1185
        jl    nnepx
1210
        jl    nnepx
1186
    sub   eax,[edi + WDATA.box.left]
1211
    sub   eax,[edi + WDATA.box.left]
1187
        cmp   eax,32 ; [edx+0x90+8]
1212
        cmp   eax,32 ; [edx+0x90+8]
Line 1191... Line 1216...
1191
        mov   [npxe],eax
1216
        mov   [npxe],eax
1192
      nnepx:
1217
      nnepx:
Line 1193... Line 1218...
1193
 
1218
 
1194
        call    get_rolledup_height
1219
        call    get_rolledup_height
1195
        mov     ebx,eax
1220
        mov     ebx,eax
1196
        movzx eax,word [0xfb0c]
1221
        movzx eax,word [MOUSE_Y]
1197
    cmp   eax,[edi + WDATA.box.top]
1222
    cmp   eax,[edi + WDATA.box.top]
1198
        jl    nnepy
1223
        jl    nnepy
1199
    sub   eax,[edi + WDATA.box.top]
1224
    sub   eax,[edi + WDATA.box.top]
1200
        cmp     eax,ebx ; [edx+0x90+12]
1225
        cmp     eax,ebx ; [edx+0x90+12]
Line 1214... Line 1239...
1214
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1239
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1215
        jnz     @f
1240
        jnz     @f
1216
        call  drawwindowframes
1241
        call  drawwindowframes
1217
    @@:
1242
    @@:
Line 1218... Line 1243...
1218
 
1243
 
1219
        mov   esi,[0xfb0a]
1244
        mov   esi,[MOUSE_X]
Line 1220... Line 1245...
1220
        mov   [0xf300],esi
1245
        mov   [WIN_TEMP_XY],esi
1221
 
1246
 
1222
      cwb:
1247
      cwb:
1223
        cmp   [0xfb40],byte 0
1248
        cmp   [BTN_DOWN],byte 0
1224
        jne   newchm 
1249
        jne   newchm
1225
                                     ; new position done
1250
                                     ; new position done
1226
        mov     [0xfff5],byte 1
1251
        mov     [DONT_DRAW_MOUSE],byte 1
1227
        mov     cl,0
1252
        mov     cl,0
1228
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1253
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1229
        jnz     @f
1254
        jnz     @f
Line 1236... Line 1261...
1236
    mov   [edi + WDATA.box.top],eax
1261
    mov   [edi + WDATA.box.top],eax
1237
        mov   eax,[npxe]
1262
        mov   eax,[npxe]
1238
    mov   [edi + WDATA.box.width],eax
1263
    mov   [edi + WDATA.box.width],eax
1239
        mov   eax,[npye]
1264
        mov   eax,[npye]
1240
    mov   [edi + WDATA.box.height],eax
1265
    mov   [edi + WDATA.box.height],eax
-
 
1266
        call    set_window_clientbox
Line 1241... Line 1267...
1241
 
1267
 
Line 1242... Line 1268...
1242
    @@: mov     [reposition],cl
1268
    @@: mov     [reposition],cl
1243
 
1269
 
Line 1250... Line 1276...
1250
        jnz   @f
1276
        jnz   @f
1251
        add   ecx,2
1277
        add   ecx,2
1252
    @@: sub   edi,window_data
1278
    @@: sub   edi,window_data
1253
        shr   edi,5
1279
        shr   edi,5
1254
        shl   edi,8
1280
        shl   edi,8
1255
        add   edi,0x80000+APPDATA.saved_box
1281
        add   edi,SLOT_BASE+APPDATA.saved_box
1256
        cld
1282
        cld
1257
        rep   movsd
1283
        rep   movsd
1258
        pop   ecx edi esi
1284
        pop   ecx edi esi
1259
      no_bounds_save:
1285
      no_bounds_save:
Line 1264... Line 1290...
1264
        je    no_window_sizing
1290
        je    no_window_sizing
1265
        mov   edx,edi
1291
        mov   edx,edi
1266
        sub   edx,window_data
1292
        sub   edx,window_data
1267
        shr   edx,5
1293
        shr   edx,5
1268
        shl   edx,8
1294
        shl   edx,8
1269
        add   edx,0x80000                 ; process base at 0x80000+
1295
        add   edx,SLOT_BASE                 ; process base at 0x80000+
Line 1270... Line 1296...
1270
 
1296
 
1271
        cmp   [do_resize],2               ; window shade ?
1297
        cmp   [do_resize],2               ; window shade ?
1272
        jne   no_window_shade
1298
        jne   no_window_shade
Line 1284... Line 1310...
1284
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1310
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1285
        jz      @f
1311
        jz      @f
1286
        mov     eax,[screen_workarea.bottom]
1312
        mov     eax,[screen_workarea.bottom]
1287
        sub     eax,[screen_workarea.top]
1313
        sub     eax,[screen_workarea.top]
1288
    @@: mov     [edi+WDATA.box.height],eax
1314
    @@: mov     [edi+WDATA.box.height],eax
-
 
1315
        call    set_window_clientbox
Line 1289... Line 1316...
1289
 
1316
 
Line 1290... Line 1317...
1290
      no_window_shade:
1317
      no_window_shade:
1291
 
1318
 
Line 1308... Line 1335...
1308
        jnz     @f
1335
        jnz     @f
1309
        sub     eax,[screen_workarea.bottom]
1336
        sub     eax,[screen_workarea.bottom]
1310
        neg     eax
1337
        neg     eax
1311
        mov     [edi+WDATA.box.height],eax
1338
        mov     [edi+WDATA.box.height],eax
1312
    @@:
1339
    @@:
1313
        jmp   no_fullscreen_restore
1340
        jmp     restore_from_fullscreen.clientbox
1314
      restore_from_fullscreen:
1341
      restore_from_fullscreen:
1315
        and     [edi+WDATA.fl_wstate],not WSTATE_MAXIMIZED
1342
        and     [edi+WDATA.fl_wstate],not WSTATE_MAXIMIZED
1316
        push    [edi+WDATA.box.height]
1343
        push    [edi+WDATA.box.height]
1317
        push  edi                         ; restore
1344
        push  edi                         ; restore
1318
        lea   esi, [edx + APPDATA.saved_box]
1345
        lea   esi, [edx + APPDATA.saved_box]
Line 1323... Line 1350...
1323
        pop     eax
1350
        pop     eax
1324
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1351
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
1325
        jz      @f
1352
        jz      @f
1326
        mov     [edi+WDATA.box.height],eax
1353
        mov     [edi+WDATA.box.height],eax
1327
    @@:
1354
    @@:
-
 
1355
    .clientbox:
-
 
1356
        call    set_window_clientbox
Line 1328... Line 1357...
1328
 
1357
 
Line 1329... Line 1358...
1329
      no_fullscreen_restore:
1358
      no_fullscreen_restore:
Line 1330... Line 1359...
1330
 
1359
 
Line 1331... Line 1360...
1331
      no_window_sizing:
1360
      no_window_sizing:
1332
 
1361
 
Line 1333... Line 1362...
1333
        popad
1362
        popad
1334
 
1363
 
Line 1335... Line 1364...
1335
        cmp   [reposition],0
1364
        cmp   [reposition],0
1336
        je    retwm
1365
        je    retwm
Line 1337... Line 1366...
1337
 
1366
 
Line 1338... Line 1367...
1338
        mov   [0xfff5],byte 1 ; no mouse
1367
        mov   [DONT_DRAW_MOUSE],byte 1 ; no mouse
1339
	call	[calc_clipping_rects]
1368
	call	[calc_clipping_rects]
1340
 
1369
 
1341
        mov   eax,edi
1370
        mov   eax,edi
1342
        call  redrawscreen
1371
        call  redrawscreen
1343
 
1372
 
1344
 
1373
 
Line 1345... Line 1374...
1345
        mov     [edi+WDATA.fl_redraw],1
1374
        mov     [edi+WDATA.fl_redraw],1
Line 1346... Line 1375...
1346
 
1375
 
1347
        mov   ecx,100         ; wait to avoid mouse residuals
1376
        mov   ecx,100         ; wait to avoid mouse residuals
1348
      waitre2:
1377
      waitre2:
Line 1349... Line 1378...
1349
        mov   [0xfff5],byte 1
1378
        mov   [DONT_DRAW_MOUSE],byte 1
1350
        call  checkidle
1379
        call  checkidle
Line 1351... Line 1380...
1351
        cmp     [edi+WDATA.fl_redraw],0
1380
        cmp     [edi+WDATA.fl_redraw],0
Line 1391... Line 1420...
1391
  mpy     dd 0x0
1420
  mpy     dd 0x0
1392
endg
1421
endg
Line 1393... Line 1422...
1393
 
1422
 
1394
 
-
 
1395
; draw negative window frames
1423
 
1396
 
-
 
1397
drawwindowframes:
1424
; draw negative window frames
-
 
1425
drawwindowframes:
-
 
1426
        pushad
-
 
1427
        cli
-
 
1428
 
Line 1398... Line 1429...
1398
 
1429
        mov   ecx,0x01000000
1399
        pushad
1430
        mov   edi,1
1400
 
1431
 
1401
        mov   eax,[npx]
1432
        mov   eax,[npx]
1402
        shl   eax,16
1433
        shl   eax,16
1403
        add   eax,[npx]
1434
        add   eax,[npx]
1404
        add   eax,[npxe]
1435
        add   eax,[npxe]
1405
        add   eax,65536*1-1
1436
        add   eax,65536*1-1
1406
        mov   ebx,[npy]
-
 
1407
        shl   ebx,16
-
 
1408
        add   ebx,[npy]
-
 
1409
        mov   ecx,0x01000000
1437
        mov   ebx,[npy]
1410
        push  edi
-
 
Line 1411... Line 1438...
1411
        mov   edi,1
1438
        shl   ebx,16
1412
        call  [draw_line]
1439
        add   ebx,[npy]
1413
        pop   edi
1440
        call  [draw_line]
1414
 
1441
 
Line 1420... Line 1447...
1420
        mov   ebx,[npy]
1447
        mov   ebx,[npy]
1421
        add   ebx,[npye]
1448
        add   ebx,[npye]
1422
        shl   ebx,16
1449
        shl   ebx,16
1423
        add   ebx,[npy]
1450
        add   ebx,[npy]
1424
        add   ebx,[npye]
1451
        add   ebx,[npye]
1425
        mov   ecx,0x01000000
-
 
1426
        push  edi
-
 
1427
        mov   edi,1
-
 
1428
        call  [draw_line]
1452
        call  [draw_line]
1429
        pop   edi
-
 
Line 1430... Line 1453...
1430
 
1453
 
1431
        mov   eax,[npx]
1454
        mov   eax,[npx]
1432
        shl   eax,16
1455
        shl   eax,16
1433
        add   eax,[npx]
1456
        add   eax,[npx]
1434
        mov   ebx,[npy]
1457
        mov   ebx,[npy]
1435
        shl   ebx,16
1458
        shl   ebx,16
1436
        add   ebx,[npy]
1459
        add   ebx,[npy]
1437
        add   ebx,[npye]
-
 
1438
        mov   ecx,0x01000000
-
 
1439
        push  edi
-
 
1440
        mov   edi,1
1460
        add   ebx,[npye]
1441
        call  [draw_line]
-
 
Line 1442... Line 1461...
1442
        pop   edi
1461
        call  [draw_line]
1443
 
1462
 
1444
        mov   eax,[npx]
1463
        mov   eax,[npx]
1445
        add   eax,[npxe]
1464
        add   eax,[npxe]
1446
        shl   eax,16
1465
        shl   eax,16
1447
        add   eax,[npx]
1466
        add   eax,[npx]
1448
        add   eax,[npxe]
1467
        add   eax,[npxe]
1449
        mov   ebx,[npy]
1468
        mov   ebx,[npy]
1450
        shl   ebx,16
1469
        shl   ebx,16
1451
        add   ebx,[npy]
-
 
1452
        add   ebx,[npye]
-
 
1453
        mov   ecx,0x01000000
-
 
1454
        push  edi
1470
        add   ebx,[npy]
1455
        mov   edi,1
-
 
1456
        call  [draw_line]
-
 
1457
        mov   edi,[0x3000]
-
 
1458
        shl   edi,5
-
 
1459
        add   edi,window_data
-
 
Line -... Line 1471...
-
 
1471
        add   ebx,[npye]
-
 
1472
        call  [draw_line]
1460
        mov   [edi+WDATA.fl_wdrawn],byte 1
1473
 
1461
        pop   edi
-
 
1462
 
1474
.ret:
Line 1463... Line 1475...
1463
        popad
1475
        sti
Line 1474... Line 1486...
1474
;  eax = 1    shape area scale
1486
;  eax = 1    shape area scale
1475
;      ebx    2^ebx scale
1487
;      ebx    2^ebx scale
Line 1476... Line 1488...
1476
 
1488
 
1477
     test eax, eax
1489
     test eax, eax
1478
     jne  rsw_no_address
1490
     jne  rsw_no_address
1479
     mov  eax,[0x3000]
1491
     mov  eax,[CURRENT_TASK]
Line 1480... Line 1492...
1480
     shl  eax,8
1492
     shl  eax,8
1481
 
1493
 
Line 1482... Line 1494...
1482
     mov  [eax+0x80000+APPDATA.wnd_shape],ebx
1494
     mov  [eax+SLOT_BASE+APPDATA.wnd_shape],ebx
1483
   rsw_no_address:
1495
   rsw_no_address:
1484
 
1496
 
1485
     cmp  eax,1
1497
     cmp  eax,1
1486
     jne  rsw_no_scale
1498
     jne  rsw_no_scale
1487
     mov  eax,[0x3000]
1499
     mov  eax,[CURRENT_TASK]
Line 1488... Line 1500...
1488
     shl  eax,8
1500
     shl  eax,8