Subversion Repositories Kolibri OS

Rev

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

Rev 114 Rev 115
Line 642... Line 642...
642
; SET UP OS TASK
642
; SET UP OS TASK
Line 643... Line 643...
643
 
643
 
644
        mov  esi,boot_setostask
644
        mov  esi,boot_setostask
645
        call boot_log
645
        call boot_log
646
        ; name for OS/IDLE process
646
        ; name for OS/IDLE process
647
        mov  [0x80000+256+0],dword 'OS/I'
647
		mov  dword [0x80000+256+APPDATA.app_name],   dword 'OS/I'
648
        mov  [0x80000+256+4],dword 'DLE '
648
		mov  dword [0x80000+256+APPDATA.app_name+4], dword 'DLE '
649
        ; task list
649
        ; task list
650
        mov  [0x3020+0xE],byte  1     ; on screen number
650
        mov  [0x3020+TASKDATA.wnd_number], 1 ; on screen number
651
        mov  [0x3020+0x4],dword 1     ; process id number
651
        mov  [0x3020+TASKDATA.pid], 1        ; process id number
Line 652... Line 652...
652
        mov  [0x3020+0x10], dword 0   ; process base address
652
        mov  [0x3020+TASKDATA.mem_start], 0  ; process base address
653
 
653
 
654
        ; set default flags & stacks
654
        ; set default flags & stacks
655
        mov  [l.eflags],dword 0x11202 ; sti and resume
655
        mov  [l.eflags],dword 0x11202 ; sti and resume
Line 1440... Line 1440...
1440
     pushad
1440
     pushad
Line 1441... Line 1441...
1441
 
1441
 
1442
     cmp   al,1                  ; ecx is a pointer ?
1442
     cmp   al,1                  ; ecx is a pointer ?
1443
     jne   displnl1
1443
     jne   displnl1
1444
     mov   edi,[0x3010]
1444
     mov   edi,[0x3010]
1445
     mov   edi,[edi+0x10]
1445
     mov   edi,[edi+TASKDATA.mem_start]
1446
     mov   ebx,[edi+ebx]
1446
     mov   ebx,[edi+ebx]
1447
   displnl1:
1447
   displnl1:
Line 1448... Line 1448...
1448
     sub   esp,64
1448
     sub   esp,64
1449
 
1449
 
1450
     cmp   ah,0                  ; DECIMAL
1450
     cmp   ah,0                  ; DECIMAL
1451
     jne   no_display_desnum
1451
     jne   no_display_desnum
1452
     shr   eax,16
1452
     shr   eax,16
1453
     and   eax,0x3f
-
 
1454
     push  eax
-
 
1455
     ;mov   edi,[0x3010]
1453
     and   eax,0x3f
1456
     ;mov   edi,[edi+0x10]
1454
     push  eax
1457
     mov   edi,esp
1455
     mov   edi,esp
1458
     add   edi,4+64
1456
     add   edi,4+64
1459
     mov   ecx,eax
1457
     mov   ecx,eax
Line 1476... Line 1474...
1476
     cmp   ah,0x01               ; HEXADECIMAL
1474
     cmp   ah,0x01               ; HEXADECIMAL
1477
     jne   no_display_hexnum
1475
     jne   no_display_hexnum
1478
     shr   eax,16
1476
     shr   eax,16
1479
     and   eax,0x3f
1477
     and   eax,0x3f
1480
     push  eax
1478
     push  eax
1481
     ;mov   edi,[0x3010]
-
 
1482
     ;mov   edi,[edi+0x10]
-
 
1483
     mov   edi,esp
1479
     mov   edi,esp
1484
     add   edi,4+64
1480
     add   edi,4+64
1485
     mov   ecx,eax
1481
     mov   ecx,eax
1486
     mov   eax,ebx
1482
     mov   eax,ebx
1487
     mov   ebx,16
1483
     mov   ebx,16
Line 1503... Line 1499...
1503
     cmp   ah,0x02               ; BINARY
1499
     cmp   ah,0x02               ; BINARY
1504
     jne   no_display_binnum
1500
     jne   no_display_binnum
1505
     shr   eax,16
1501
     shr   eax,16
1506
     and   eax,0x3f
1502
     and   eax,0x3f
1507
     push  eax
1503
     push  eax
1508
     ;mov   edi,[0x3010]
-
 
1509
     ;mov   edi,[edi+0x10]
-
 
1510
     mov   edi,esp
1504
     mov   edi,esp
1511
     add   edi,4+64
1505
     add   edi,4+64
1512
     mov   ecx,eax
1506
     mov   ecx,eax
1513
     mov   eax,ebx
1507
     mov   eax,ebx
1514
     mov   ebx,2
1508
     mov   ebx,2
Line 1549... Line 1543...
1549
     mov   eax,[esp+64+32-8+4]
1543
     mov   eax,[esp+64+32-8+4]
1550
     mov   ebx,[esp+64+32-12+4]
1544
     mov   ebx,[esp+64+32-12+4]
1551
     push  edx                       ; add window start x & y
1545
     push  edx                       ; add window start x & y
1552
     push  ebx
1546
     push  ebx
1553
     mov   edx,[0x3010]
1547
     mov   edx,[0x3010]
1554
     mov   ebx,[edx-twdw]
1548
     mov   ebx,[edx-twdw+WDATA.box.left]
1555
     shl   ebx,16
1549
     shl   ebx,16
1556
     add   ebx,[edx-twdw+4]
1550
     add   ebx,[edx-twdw+WDATA.box.top]
1557
     add   eax,ebx
1551
     add   eax,ebx
1558
     pop   ebx
1552
     pop   ebx
1559
     pop   edx
1553
     pop   edx
1560
     mov   edi,0
1554
     mov   edi,0
1561
     call  dtext
1555
     call  dtext
Line 1613... Line 1607...
1613
     cmp  eax,2                      ; KEYBOARD
1607
     cmp  eax,2                      ; KEYBOARD
1614
     jnz  nsyse2
1608
     jnz  nsyse2
1615
     cmp  ebx,1
1609
     cmp  ebx,1
1616
     jnz  kbnobase
1610
     jnz  kbnobase
1617
     mov  edi,[0x3010]
1611
     mov  edi,[0x3010]
1618
     add  ecx,[edi+0x10]
1612
     add  ecx,[edi+TASKDATA.mem_start]
1619
     mov  eax,ecx
1613
     mov  eax,ecx
1620
     mov  ebx,keymap
1614
     mov  ebx,keymap
1621
     mov  ecx,128
1615
     mov  ecx,128
1622
     call memmove
1616
     call memmove
1623
     ret
1617
     ret
1624
   kbnobase:
1618
   kbnobase:
1625
     cmp  ebx,2
1619
     cmp  ebx,2
1626
     jnz  kbnoshift
1620
     jnz  kbnoshift
1627
     mov  edi,[0x3010]
1621
     mov  edi,[0x3010]
1628
     add  ecx,[edi+0x10]
1622
     add  ecx,[edi+TASKDATA.mem_start]
1629
     mov  eax,ecx
1623
     mov  eax,ecx
1630
     mov  ebx,keymap_shift
1624
     mov  ebx,keymap_shift
1631
     mov  ecx,128
1625
     mov  ecx,128
1632
     call memmove
1626
     call memmove
1633
     ret
1627
     ret
1634
   kbnoshift:
1628
   kbnoshift:
1635
     cmp  ebx,3
1629
     cmp  ebx,3
1636
     jne  kbnoalt
1630
     jne  kbnoalt
1637
     mov  edi,[0x3010]
1631
     mov  edi,[0x3010]
1638
     add  ecx,[edi+0x10]
1632
     add  ecx,[edi+TASKDATA.mem_start]
1639
     mov  eax,ecx
1633
     mov  eax,ecx
1640
     mov  ebx,keymap_alt
1634
     mov  ebx,keymap_alt
1641
     mov  ecx,128
1635
     mov  ecx,128
1642
     call memmove
1636
     call memmove
1643
     ret
1637
     ret
Line 1825... Line 1819...
1825
     cmp  eax,2
1819
     cmp  eax,2
1826
     jne  ngsyse2
1820
     jne  ngsyse2
1827
     cmp  ebx,1
1821
     cmp  ebx,1
1828
     jnz  kbnobaseret
1822
     jnz  kbnobaseret
1829
     mov  edi,[0x3010]
1823
     mov  edi,[0x3010]
1830
     add  ecx,[edi+0x10]
1824
     add  ecx,[edi+TASKDATA.mem_start]
1831
     mov  ebx,ecx
1825
     mov  ebx,ecx
1832
     mov  eax,keymap
1826
     mov  eax,keymap
1833
     mov  ecx,128
1827
     mov  ecx,128
1834
     call memmove
1828
     call memmove
1835
     ret
1829
     ret
1836
   kbnobaseret:
1830
   kbnobaseret:
1837
     cmp  ebx,2
1831
     cmp  ebx,2
1838
     jnz  kbnoshiftret
1832
     jnz  kbnoshiftret
1839
     mov  edi,[0x3010]
1833
     mov  edi,[0x3010]
1840
     add  ecx,[edi+0x10]
1834
     add  ecx,[edi+TASKDATA.mem_start]
1841
     mov  ebx,ecx
1835
     mov  ebx,ecx
1842
     mov  eax,keymap_shift
1836
     mov  eax,keymap_shift
1843
     mov  ecx,128
1837
     mov  ecx,128
1844
     call memmove
1838
     call memmove
1845
     ret
1839
     ret
1846
   kbnoshiftret:
1840
   kbnoshiftret:
1847
     cmp  ebx,3
1841
     cmp  ebx,3
1848
     jne  kbnoaltret
1842
     jne  kbnoaltret
1849
     mov  edi,[0x3010]
1843
     mov  edi,[0x3010]
1850
     add  ecx,[edi+0x10]
1844
     add  ecx,[edi+TASKDATA.mem_start]
1851
     mov  ebx,ecx
1845
     mov  ebx,ecx
1852
     mov  eax,keymap_alt
1846
     mov  eax,keymap_alt
1853
     mov  ecx,128
1847
     mov  ecx,128
1854
     call memmove
1848
     call memmove
1855
     ret
1849
     ret
Line 1948... Line 1942...
1948
    jnz  nowr
1942
    jnz  nowr
1949
    mov  eax,[0xfb0a]
1943
    mov  eax,[0xfb0a]
1950
    shl  eax,16
1944
    shl  eax,16
1951
    mov  ax,[0xfb0c]
1945
    mov  ax,[0xfb0c]
1952
    mov  esi,[0x3010]
1946
    mov  esi,[0x3010]
1953
    sub  esi,twdw
-
 
1954
    mov  bx,[esi]
1947
    mov  bx, word [esi-twdw+WDATA.box.left]
1955
    shl  ebx,16
1948
    shl  ebx,16
1956
    mov  bx,[esi+4]
1949
    mov  bx, word [esi-twdw+WDATA.box.top]
1957
    sub  eax,ebx
1950
    sub  eax,ebx
1958
    mov  [esp+36],eax
1951
    mov  [esp+36],eax
1959
    ret
1952
    ret
1960
  nowr:
1953
  nowr:
Line 2079... Line 2072...
2079
 
2072
 
Line 2080... Line 2073...
2080
 
2073
 
2081
sys_end:
-
 
2082
 
2074
sys_end:
Line 2083... Line 2075...
2083
     mov   eax,[0x3010]
2075
 
2084
     add   eax,0xa
2076
     mov   eax,[0x3010]
2085
     mov   [eax],byte 3  ; terminate this program
2077
     mov   [eax+TASKDATA.state], 3  ; terminate this program
2086
 
2078
 
Line 2139... Line 2131...
2139
     mov  edx,[0x3004]
2131
     mov  edx,[0x3004]
2140
     cmp  ebx,edx
2132
     cmp  ebx,edx
2141
     ja   noprocessterminate
2133
     ja   noprocessterminate
2142
     mov  eax,[0x3004]
2134
     mov  eax,[0x3004]
2143
     shl  ebx,5
2135
     shl  ebx,5
2144
     mov  edx,[ebx+0x3000+4]
2136
     mov  edx,[ebx+0x3000+TASKDATA.pid]
2145
     add  ebx,0x3000+0xa
2137
     add  ebx,0x3000+TASKDATA.state
2146
     cmp  byte [ebx], 9
2138
     cmp  byte [ebx], 9
2147
     jz   noprocessterminate
2139
     jz   noprocessterminate
Line 2148... Line 2140...
2148
 
2140
 
2149
     ;call MEM_Heap_Lock      ;guarantee that process isn't working with heap
2141
     ;call MEM_Heap_Lock      ;guarantee that process isn't working with heap
Line 2260... Line 2252...
2260
     mov ecx,10
2252
     mov ecx,10
2261
     cld
2253
     cld
2262
     rep movsb
2254
     rep movsb
2263
     ret
2255
     ret
2264
   for_all_tables:
2256
   for_all_tables:
2265
     mov edi,[3010h]
2257
     mov edi,[0x3010]
2266
     mov edi,[edi+10h]
2258
     mov edi,[edi+TASKDATA.mem_start]
2267
     add edi,ecx
2259
     add edi,ecx
2268
     mov esi,0x40000
2260
     mov esi,0x40000
2269
     ret
2261
     ret
2270
  full_table:
2262
  full_table:
2271
     cmp  ebx,2
2263
     cmp  ebx,2
Line 2279... Line 2271...
2279
sysfn_lastkey:          ; 18.12 = return 0 (backward compatibility)
2271
sysfn_lastkey:          ; 18.12 = return 0 (backward compatibility)
2280
        and     dword [esp+36], 0
2272
        and     dword [esp+36], 0
2281
        ret
2273
        ret
Line 2282... Line 2274...
2282
 
2274
 
2283
sysfn_getversion:       ; 18.13 = get kernel ID and version
2275
sysfn_getversion:       ; 18.13 = get kernel ID and version
2284
     mov edi,[3010h]
2276
     mov edi,[0x3010]
2285
     mov edi,[edi+10h]
2277
     mov edi,[edi+TASKDATA.mem_start]
2286
     add edi,ebx
2278
     add edi,ebx
2287
     mov esi,version_inf
2279
     mov esi,version_inf
2288
     mov ecx,version_end-version_inf
2280
     mov ecx,version_end-version_inf
2289
     cld
2281
     cld
Line 2445... Line 2437...
2445
 
2437
 
2446
    cmp   eax,5                            ; BLOCK MOVE TO BGR
2438
    cmp   eax,5                            ; BLOCK MOVE TO BGR
2447
    jnz   nosb5
2439
    jnz   nosb5
2448
  ; bughere
2440
  ; bughere
2449
    mov   edi, [0x3010]
2441
    mov   edi, [0x3010]
2450
    add   ebx, [edi+0x10]
2442
    add   ebx, [edi+TASKDATA.mem_start]
2451
 ;   mov   esi, ebx
2443
 ;   mov   esi, ebx
2452
 ;   mov   edi, ecx
2444
 ;   mov   edi, ecx
2453
    mov   eax, ebx
2445
    mov   eax, ebx
2454
    mov   ebx, ecx
2446
    mov   ebx, ecx
Line 2587... Line 2579...
2587
;  +26 dword     used mem
2579
;  +26 dword     used mem
2588
;  +30 dword     PID , process idenfification number
2580
;  +30 dword     PID , process idenfification number
2589
;
2581
;
Line 2590... Line 2582...
2590
 
2582
 
2591
    mov  edi,[0x3010]   ; eax = return area
-
 
2592
    add  edi,0x10
2583
    mov  edi,[0x3010]   ; eax = return area
Line 2593... Line 2584...
2593
    add  eax,[edi]
2584
    add  eax,[edi + TASKDATA.mem_start]
2594
 
2585
 
2595
    cmp  ebx,-1         ; who am I ?
2586
    cmp  ebx,-1         ; who am I ?
2596
    jne  no_who_am_i
2587
    jne  no_who_am_i
Line 2607... Line 2598...
2607
    ; return memory usage
2598
    ; return memory usage
Line 2608... Line 2599...
2608
 
2599
 
2609
    xor  edx,edx
2600
    xor  edx,edx
2610
    mov  eax,0x20
2601
    mov  eax,0x20
2611
    mul  ebx
2602
    mul  ebx
2612
    add  eax,0x3000+0x1c
2603
    add  eax,0x3000+TASKDATA.cpu_usage
2613
    mov  ebx,eax
2604
    mov  ebx,eax
2614
    pop  eax
2605
    pop  eax
2615
    mov  ecx,[ebx]
2606
    mov  ecx,[ebx]
2616
    mov  [eax],ecx
2607
    mov  [eax],ecx
2617
    pop  ebx
-
 
2618
;    mov  ebx,[esp]
-
 
2619
;    shl  ebx,1
-
 
2620
;    add  ebx,0xc000
2608
    pop  ebx
2621
    mov  cx, [0xC000 + ebx * 2]
2609
    mov  cx, [0xC000 + ebx * 2]
2622
    mov  [eax+4],cx
-
 
2623
;    mov  ebx,[esp]
-
 
2624
;    shl  ebx,1
-
 
2625
;    add  ebx,0xc400
2610
    mov  [eax+4],cx
2626
    mov  cx, [0xC400 + ebx * 2]
2611
    mov  cx, [0xC400 + ebx * 2]
2627
    mov  [eax+6],cx
-
 
2628
;    pop  ebx
2612
    mov  [eax+6],cx
2629
    push eax
2613
    push eax
2630
    mov  eax,ebx
2614
    mov  eax,ebx
2631
    shl  eax,8
2615
    shl  eax,8
2632
    add  eax,0x80000
2616
    add  eax,0x80000+APPDATA.app_name
2633
    pop  ebx
2617
    pop  ebx
2634
    add  ebx,10
2618
    add  ebx,10
2635
    mov  ecx,11
2619
    mov  ecx,11
Line 2641... Line 2625...
2641
    mov    edx,0x100000*16
2625
    mov    edx,0x100000*16
2642
    pop    ecx                                   ; get gdt of tss
2626
    pop    ecx                                   ; get gdt of tss
2643
    cmp    ecx,1
2627
    cmp    ecx,1
2644
    je     os_mem
2628
    je     os_mem
2645
    shl    ecx,8
2629
    shl    ecx,8
2646
    mov    edx,[0x80000+ecx+0x8c]
2630
    mov    edx,[0x80000+ecx+APPDATA.mem_size] ;0x8c
2647
    mov    eax,std_application_base_address
2631
    mov    eax,std_application_base_address
2648
    ;add    ecx,0x80000+0x88
-
 
2649
    ;mov    ecx,[ecx]
-
 
2650
;    shl    ecx,3
-
 
2651
    ; eax run base -> edx used memory
2632
    ; eax run base -> edx used memory
2652
;    mov    al,[ecx+gdts+ app_code-3 +4]        ;  base  23:16
-
 
2653
;    mov    ah,[ecx+gdts+ app_code-3 +7]        ;  base  31:24
-
 
2654
;    shl    eax,16
-
 
2655
;    mov    ax,[ecx+gdts+ app_code-3 +2]        ;  base  0:15
-
 
2656
;    movzx  edx,word [ecx+gdts+ app_code-3 +0]
-
 
2657
;    shl    edx,12
-
 
2658
 
-
 
2659
  os_mem:
2633
  os_mem:
2660
    dec    edx
2634
    dec    edx
2661
    mov    [ebx+12],eax
2635
    mov    [ebx+12],eax
2662
    mov    [ebx+16],edx
2636
    mov    [ebx+16],edx
Line 2663... Line 2637...
2663
 
2637
 
Line 2664... Line 2638...
2664
    ; PID (+30)
2638
    ; PID (+30)
2665
 
2639
 
2666
    mov    eax,[esp]
2640
    mov    eax,[esp]
2667
    shl    eax,5
2641
    shl    eax,5
2668
    add    eax,0x3000+0x4
2642
    add    eax,0x3000+TASKDATA.pid
Line 2669... Line 2643...
2669
    mov    eax,[eax]
2643
    mov    eax,[eax]
Line 2670... Line 2644...
2670
    mov    [ebx+20],eax
2644
    mov    [ebx+20],eax
2671
 
2645
 
2672
    ; window position and size
2646
    ; window position and size
2673
 
2647
 
2674
    mov    esi,[esp]
2648
    mov    esi,[esp]
2675
    shl    esi,5
2649
    shl    esi,5
2676
    add    esi,window_data
2650
    add    esi,window_data + WDATA.box
2677
    mov    edi,[esp+4]
2651
    mov    edi,[esp+4]
Line 2678... Line 2652...
2678
    add    edi,34
2652
    add    edi,34
Line 2679... Line 2653...
2679
    mov    ecx,4*4
2653
    mov    ecx,4
2680
    cld
2654
    cld
2681
    rep    movsb
2655
    rep    movsd
2682
 
2656
 
2683
    ; Process state (+50)
2657
    ; Process state (+50)
Line 2684... Line 2658...
2684
 
2658
 
Line 2824... Line 2798...
2824
    cmp   eax,2
2798
    cmp   eax,2
2825
    jnz   srl1
2799
    jnz   srl1
Line 2826... Line 2800...
2826
 
2800
 
2827
    mov   edx,[0x3010]      ; return whole screen draw area for this app
2801
    mov   edx,[0x3010]      ; return whole screen draw area for this app
2828
    add   edx,draw_data-0x3000
2802
    add   edx,draw_data-0x3000
2829
    mov   [edx+0],dword 0
2803
    mov   [edx+RECT.left], 0
2830
    mov   [edx+4],dword 0
2804
    mov   [edx+RECT.top], 0
2831
    mov   eax,[0xfe00]
2805
    mov   eax,[0xfe00]
2832
    mov   [edx+8],eax
2806
    mov   [edx+RECT.right],eax
2833
    mov   eax,[0xfe04]
2807
    mov   eax,[0xfe04]
Line 2834... Line 2808...
2834
    mov   [edx+12],eax
2808
    mov   [edx+RECT.bottom],eax
2835
 
-
 
2836
    mov   edi,[0x3010]
2809
 
Line 2837... Line 2810...
2837
    sub   edi,twdw
2810
    mov   edi,[0x3010]
Line 2838... Line 2811...
2838
    mov   [edi+30],byte 1   ; no new position & buttons from app
2811
    mov   [edi-twdw+WDATA.fl_wdrawn], 1   ; no new position & buttons from app
Line 2959... Line 2932...
2959
        test    [edi+window_data+WDATA.fl_wstyle],WSTYLE_HASCAPTION
2932
        test    [edi+window_data+WDATA.fl_wstyle],WSTYLE_HASCAPTION
2960
        jz      @f
2933
        jz      @f
2961
        mov     ecx,[edi*8+0x80000+APPDATA.wnd_caption]
2934
        mov     ecx,[edi*8+0x80000+APPDATA.wnd_caption]
2962
        or      ecx,ecx
2935
        or      ecx,ecx
2963
        jz      @f
2936
        jz      @f
2964
        add     ecx,[edi+twdw+0x10]
2937
        add     ecx,[edi+twdw+TASKDATA.mem_start]
Line 2965... Line 2938...
2965
 
2938
 
2966
        movzx   eax,[edi+window_data+WDATA.fl_wstyle]
2939
        movzx   eax,[edi+window_data+WDATA.fl_wstyle]
2967
        and     al,0x0F
2940
        and     al,0x0F
2968
        cmp     al,3
2941
        cmp     al,3
Line 3116... Line 3089...
3116
 
3089
 
Line 3117... Line 3090...
3117
        mov     cl,[edi+WDATA.fl_wstyle]
3090
        mov     cl,[edi+WDATA.fl_wstyle]
3118
 
3091
 
3119
    sub   edi,window_data
3092
    sub   edi,window_data
Line 3120... Line 3093...
3120
    shl   edi,3
3093
    shl   edi,3
3121
    add   edi,0x80000+0x90
3094
    add   edi,0x80000
3122
 
3095
 
3123
        and     cl,0x0F
3096
        and     cl,0x0F
3124
        mov     [edi-0x90+APPDATA.wnd_caption],0
3097
        mov     [edi+APPDATA.wnd_caption],0
3125
        cmp     cl,3
3098
        cmp     cl,3
Line -... Line 3099...
-
 
3099
        jne     @f
3126
        jne     @f
3100
        mov     [edi+APPDATA.wnd_caption],esi
3127
        mov     [edi-0x90+APPDATA.wnd_caption],esi
3101
    @@: mov     esi,[esp+0]
3128
    @@: mov     esi,[esp+0]
3102
 
3129
 
3103
    add   edi, APPDATA.saved_box
Line 3130... Line 3104...
3130
    mov   ecx,4
3104
    mov   ecx,4
3131
    cld
3105
    cld
3132
    rep   movsd
3106
    rep   movsd
3133
    pop   edi esi ecx
3107
    pop   edi esi ecx
3134
 
3108
 
3135
    push  eax ebx ecx edx
3109
    push  eax ebx ecx edx
3136
;;;    mov   eax, 1
3110
;;;    mov   eax, 1
3137
;;;    call  delay_hs
3111
;;;    call  delay_hs
3138
    movzx eax, word [edi+00]
3112
    mov   eax, [edi+WDATA.box.left]
3139
    movzx ebx, word [edi+04]
3113
    mov   ebx, [edi+WDATA.box.top]
3140
    movzx ecx, word [edi+8]
3114
    mov   ecx, [edi+WDATA.box.width]
Line 3141... Line 3115...
3141
    movzx edx, word [edi+12]
3115
    mov   edx, [edi+WDATA.box.height]
3142
    add   ecx, eax
3116
    add   ecx, eax
Line 3143... Line 3117...
3143
    add   edx, ebx
3117
    add   edx, ebx
3144
    call  calculatescreen
3118
    call  calculatescreen
3145
    pop   edx ecx ebx eax
3119
    pop   edx ecx ebx eax
Line 3146... Line 3120...
3146
 
3120
 
Line 3147... Line 3121...
3147
    mov   [0xf400],byte 0           ; empty keyboard buffer
3121
    mov   [0xf400],byte 0           ; empty keyboard buffer
Line 3193... Line 3167...
3193
        ret
3167
        ret
Line 3194... Line 3168...
3194
 
3168
 
Line 3195... Line 3169...
3195
 
3169
 
3196
sys_window_move:
3170
sys_window_move:
3197
 
3171
 
Line 3198... Line 3172...
3198
        mov     edi,[0x00003000]
3172
        mov     edi,[0x3000]
3199
        shl     edi,5
3173
        shl     edi,5
Line 3200... Line 3174...
3200
        add     edi,window_data
3174
        add     edi,window_data
3201
 
3175
 
3202
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
3176
        test    [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
3203
        jnz     .window_move_return
3177
        jnz     .window_move_return
Line 3204... Line 3178...
3204
 
3178
 
3205
        push  dword [edi+0]           ; save old coordinates
3179
        push    dword [edi + WDATA.box.left]  ; save old coordinates
3206
        push  dword [edi+4]
3180
        push    dword [edi + WDATA.box.top]
3207
        push  dword [edi+8]
3181
        push    dword [edi + WDATA.box.width]
3208
        push  dword [edi+12]
3182
        push    dword [edi + WDATA.box.height]
3209
 
3183
 
3210
        cmp   eax,-1                  ; set new position and size
3184
        cmp   eax,-1                  ; set new position and size
3211
        je    .no_x_reposition
3185
        je    .no_x_reposition
Line 3212... Line 3186...
3212
        mov   [edi+0],eax
3186
        mov     [edi + WDATA.box.left], eax
3213
      .no_x_reposition:
3187
      .no_x_reposition:
Line 3214... Line 3188...
3214
        cmp   ebx,-1
3188
        cmp   ebx,-1
3215
        je    .no_y_reposition
3189
        je    .no_y_reposition
3216
        mov   [edi+4],ebx
3190
        mov     [edi + WDATA.box.top], ebx
3217
      .no_y_reposition:
3191
      .no_y_reposition:
3218
 
3192
 
3219
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
3193
        test    [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
3220
        jnz     .no_y_resizing
3194
        jnz     .no_y_resizing
3221
 
3195
 
Line 3222... Line 3196...
3222
        cmp   ecx,-1
3196
        cmp   ecx,-1
Line 3223... Line 3197...
3223
        je    .no_x_resizing
3197
        je    .no_x_resizing
3224
        mov   [edi+8],ecx
3198
        mov     [edi + WDATA.box.width], ecx
3225
      .no_x_resizing:
3199
      .no_x_resizing:
3226
        cmp   edx,-1
3200
        cmp   edx,-1
3227
        je    .no_y_resizing
3201
        je    .no_y_resizing
3228
        mov   [edi+12],edx
3202
        mov     [edi + WDATA.box.height], edx
3229
      .no_y_resizing:
3203
      .no_y_resizing:
3230
 
3204
 
3231
        call  check_window_position
3205
        call  check_window_position
3232
 
3206
 
Line 3233... Line 3207...
3233
        pushad                       ; save for window fullscreen/resize
3207
        pushad                       ; save for window fullscreen/resize
3234
        mov   esi,edi
3208
        mov   esi,edi
3235
        sub   edi,window_data
3209
        sub   edi,window_data
3236
        shr   edi,5
3210
        shr   edi,5
3237
        shl   edi,8
3211
        shl   edi,8
3238
        add   edi,0x80000+0x90
3212
        add   edi, 0x80000 + APPDATA.saved_box
3239
        mov   ecx,4
3213
        mov   ecx,4
3240
        cld
3214
        cld
3241
        rep   movsd
3215
        rep   movsd
Line 3261... Line 3235...
3261
        mov   [dly],ebx
3235
        mov   [dly],ebx
3262
        mov   [dlxe],ecx
3236
        mov   [dlxe],ecx
3263
        mov   [dlye],edx
3237
        mov   [dlye],edx
3264
        call  calculatescreen
3238
        call  calculatescreen
Line 3265... Line 3239...
3265
 
3239
 
Line 3266... Line 3240...
3266
        mov   [edi+31],byte 1       ; flag the process as redraw
3240
        mov   [edi + WDATA.fl_redraw], 1 ; flag the process as redraw
3267
 
3241
 
3268
        mov   eax,edi               ; redraw screen at old position
3242
        mov   eax,edi               ; redraw screen at old position
Line 3461... Line 3435...
3461
    mov   [mouse_active], 0
3435
    mov   [mouse_active], 0
3462
    xor   edi, edi
3436
    xor   edi, edi
3463
    mov   ecx, [0x3004]
3437
    mov   ecx, [0x3004]
3464
   set_mouse_event:
3438
   set_mouse_event:
3465
    add   edi, 256
3439
    add   edi, 256
3466
    or    [edi+0x80000+0xA8], dword 00100000b
3440
    or    [edi+0x80000+APPDATA.event_mask], dword 00100000b
3467
    loop  set_mouse_event
3441
    loop  set_mouse_event
3468
  mouse_not_active:
3442
  mouse_not_active:
Line 3469... Line 3443...
3469
 
3443
 
3470
 
3444
 
3471
    cmp   [0xfff0],byte 0               ; background update ?
3445
    cmp   [0xfff0],byte 0               ; background update ?
3472
    jz    nobackgr
3446
    jz    nobackgr
3473
    cmp    [background_defined], 0
3447
    cmp    [background_defined], 0
3474
    jz    nobackgr
3448
    jz    nobackgr
3475
    mov   [0xfff0],byte 2
3449
    mov   [0xfff0],byte 2
3476
    call  change_task
3450
    call  change_task
3477
    mov   [draw_data+32+0],dword 0
3451
	mov   [draw_data+32 + RECT.left],dword 0
3478
    mov   [draw_data+32+4],dword 0
3452
	mov   [draw_data+32 + RECT.top],dword 0
3479
    mov   eax,[0xfe00]
3453
    mov   eax,[0xfe00]
3480
    mov   ebx,[0xfe04]
3454
    mov   ebx,[0xfe04]
3481
    mov   [draw_data+32+8],eax
3455
	mov   [draw_data+32 + RECT.right],eax
3482
    mov   [draw_data+32+12],ebx
3456
	mov   [draw_data+32 + RECT.bottom],ebx
3483
    call  drawbackground
3457
    call  drawbackground
Line 3484... Line 3458...
3484
    mov   [0xfff0],byte 0
3458
    mov   [0xfff0],byte 0
Line 3500... Line 3474...
3500
 
3474
 
3501
    mov   edx,0x3040
3475
    mov   edx,0x3040
3502
    movzx ecx,byte [0xff00]
3476
    movzx ecx,byte [0xff00]
3503
    add   ecx,5
3477
    add   ecx,5
3504
  markz:
3478
  markz:
3505
    mov   [edx+0xa],byte 3
3479
    mov   [edx+TASKDATA.state],byte 3
3506
    add   edx,0x20
3480
    add   edx,0x20
Line 3507... Line 3481...
3507
    loop  markz
3481
    loop  markz
Line 3517... Line 3491...
3517
 
3491
 
Line 3518... Line 3492...
3518
  noshutdown:
3492
  noshutdown:
3519
 
3493
 
3520
 
3494
 
Line 3521... Line 3495...
3521
    mov   eax,[0x3004]                  ; termination
3495
    mov   eax,[0x3004]                  ; termination
3522
    mov   ebx,0x3020+0xa
3496
    mov   ebx,0x3020+TASKDATA.state
3523
    mov   esi,1
3497
    mov   esi,1
Line 3568... Line 3542...
3568
         mov   edi,eax
3542
         mov   edi,eax
Line 3569... Line 3543...
3569
 
3543
 
3570
         cmp   ecx,1               ; limit for background
3544
         cmp   ecx,1               ; limit for background
Line 3571... Line 3545...
3571
         jz    bgli
3545
         jz    bgli
3572
 
3546
 
3573
         mov   eax,[edi+0]
3547
         mov   eax, [edi + WDATA.box.left]
3574
         mov   ebx,[edi+4]
3548
         mov   ebx, [edi + WDATA.box.top]
3575
         mov   ecx,[edi+8]
3549
         mov   ecx, [edi + WDATA.box.width]
3576
         mov   edx,[edi+12]
3550
         mov   edx, [edi + WDATA.box.height]
Line 3577... Line 3551...
3577
         add   ecx,eax
3551
         add   ecx, eax
3578
         add   edx,ebx
3552
         add   edx, ebx
Line 3583... Line 3557...
3583
 
3557
 
3584
         mov   ecx,[dlxe]   ; ecx = area x end     eax = window x start
3558
         mov   ecx,[dlxe]   ; ecx = area x end     eax = window x start
3585
         cmp   ecx,eax
3559
         cmp   ecx,eax
Line 3586... Line 3560...
3586
         jb    ricino
3560
         jb    ricino
3587
 
3561
 
3588
         mov   eax,[edi+0]
3562
         mov   eax, [edi + WDATA.box.left]
3589
         mov   ebx,[edi+4]
3563
         mov   ebx, [edi + WDATA.box.top]
3590
         mov   ecx,[edi+8]
3564
         mov   ecx, [edi + WDATA.box.width]
3591
         mov   edx,[edi+12]
3565
         mov   edx, [edi + WDATA.box.height]
Line 3592... Line 3566...
3592
         add   ecx,eax
3566
         add   ecx, eax
3593
         add   edx,ebx
3567
         add   edx, ebx
Line 3607... Line 3581...
3607
 
3581
 
3608
         mov   eax,edi
3582
         mov   eax,edi
Line 3609... Line 3583...
3609
         add   eax,draw_data-window_data
3583
         add   eax,draw_data-window_data
3610
 
3584
 
3611
         mov   ebx,[dlx]          ; set limits
3585
         mov   ebx,[dlx]          ; set limits
3612
         mov   [eax+0],ebx
3586
         mov   [eax + RECT.left], ebx
3613
         mov   ebx,[dly]
3587
         mov   ebx,[dly]
3614
         mov   [eax+4],ebx
3588
         mov   [eax + RECT.top], ebx
3615
         mov   ebx,[dlxe]
3589
         mov   ebx,[dlxe]
3616
         mov   [eax+8],ebx
3590
         mov   [eax + RECT.right], ebx
Line 3617... Line 3591...
3617
         mov   ebx,[dlye]
3591
         mov   ebx,[dlye]
Line 3618... Line 3592...
3618
         mov   [eax+12],ebx
3592
         mov   [eax + RECT.bottom], ebx
3619
 
3593
 
Line 3626... Line 3600...
3626
         call  drawbackground
3600
         call  drawbackground
Line 3627... Line 3601...
3627
 
3601
 
3628
       newdw8:
3602
       newdw8:
Line 3629... Line 3603...
3629
       nobgrd:
3603
       nobgrd:
Line 3630... Line 3604...
3630
 
3604
 
Line 3631... Line 3605...
3631
         mov   [eax+31],byte 1    ; mark as redraw
3605
         mov   [eax + WDATA.fl_redraw],byte 1    ; mark as redraw
Line 3705... Line 3679...
3705
 
3679
 
3706
set_app_param:
3680
set_app_param:
Line 3707... Line 3681...
3707
        push edi
3681
        push edi
3708
 
3682
 
Line 3709... Line 3683...
3709
        mov  edi,[0x3010]
3683
        mov  edi,[0x3010]
3710
        mov  [edi],eax
3684
        mov  [edi+TASKDATA.event_mask],eax
Line 3717... Line 3691...
3717
delay_hs:     ; delay in 1/100 secs
3691
delay_hs:     ; delay in 1/100 secs
3718
        push  eax
3692
        push  eax
3719
        push  ecx
3693
        push  ecx
3720
        push  edx
3694
        push  edx
Line 3721... Line 3695...
3721
 
3695
 
3722
        mov   edx,[timer_ticks];[0xfdf0]
3696
        mov   edx,[timer_ticks]
Line 3723... Line 3697...
3723
        add   edx,eax
3697
        add   edx,eax
3724
 
3698
 
3725
      newtic:
3699
      newtic:
3726
        mov   ecx,[timer_ticks];[0xfdf0]
3700
        mov   ecx,[timer_ticks]
Line 3727... Line 3701...
3727
        cmp   edx,ecx
3701
        cmp   edx,ecx
Line 3822... Line 3796...
3822
align 4
3796
align 4
Line 3823... Line 3797...
3823
 
3797
 
Line 3824... Line 3798...
3824
sys_programirq:
3798
sys_programirq:
3825
 
-
 
3826
    mov   edi,[0x3010]
3799
 
Line 3827... Line 3800...
3827
    add   edi,0x10
3800
    mov   edi,[0x3010]
3828
    add   eax,[edi]
3801
    add   eax,[edi+TASKDATA.mem_start]
3829
 
3802
 
3830
    cmp   ebx,16
3803
    cmp   ebx,16
3831
    jae   .not_owner
3804
    jae   .not_owner
3832
    mov   edi,[0x3010]
3805
    mov   edi,[0x3010]
3833
    mov   edi,[edi+0x4]
3806
    mov   edi,[edi+TASKDATA.pid]
3834
    cmp   edi,[irq_owner+ebx*4]
3807
    cmp   edi,[irq_owner+ebx*4]
3835
    je    spril1
3808
    je    spril1
Line 3857... Line 3830...
3857
     mov   edx,eax           ; check for correct owner
3830
     mov   edx,eax           ; check for correct owner
3858
     shl   edx,2
3831
     shl   edx,2
3859
     add   edx,irq_owner
3832
     add   edx,irq_owner
3860
     mov   edx,[edx]
3833
     mov   edx,[edx]
3861
     mov   edi,[0x3010]
3834
     mov   edi,[0x3010]
3862
     mov   edi,[edi+0x4]
3835
     mov   edi,[edi+TASKDATA.pid]
3863
     cmp   edx,edi
3836
     cmp   edx,edi
3864
     je    gidril1
3837
     je    gidril1
3865
.not_owner:
3838
.not_owner:
3866
     mov   [esp+32],dword 2     ; ecx=2
3839
     mov   [esp+32],dword 2     ; ecx=2
3867
     ret
3840
     ret
Line 4009... Line 3982...
4009
     add   edi,1
3982
     add   edi,1
4010
     mov   [0x2d0000],edi
3983
     mov   [0x2d0000],edi
4011
     shl   edi,4
3984
     shl   edi,4
4012
     add   edi,0x2d0000
3985
     add   edi,0x2d0000
4013
     mov   esi,[0x3010]
3986
     mov   esi,[0x3010]
4014
     mov   esi,[esi+0x4]
3987
     mov   esi,[esi+TASKDATA.pid]
4015
     mov   [edi],esi
3988
     mov   [edi],esi
4016
     mov   [edi+4],ebx
3989
     mov   [edi+4],ebx
4017
     mov   [edi+8],ecx
3990
     mov   [edi+8],ecx
Line 4018... Line 3991...
4018
 
3991
 
Line 4028... Line 4001...
4028
 
4001
 
4029
     mov   esi,[0x2d0000]     ; no reserved areas ?
4002
     mov   esi,[0x2d0000]     ; no reserved areas ?
4030
     test  esi,esi
4003
     test  esi,esi
4031
     je    frpal2
4004
     je    frpal2
4032
     mov   edx,[0x3010]
4005
     mov   edx,[0x3010]
4033
     mov   edx,[edx+4]
4006
     mov   edx,[edx+TASKDATA.pid]
4034
   frpal3:
4007
   frpal3:
4035
     mov   edi,esi
4008
     mov   edi,esi
4036
     shl   edi,4
4009
     shl   edi,4
4037
     add   edi,0x2d0000
4010
     add   edi,0x2d0000
Line 4102... Line 4075...
4102
     jz    reserve_irq
4075
     jz    reserve_irq
Line 4103... Line 4076...
4103
 
4076
 
4104
     lea   edi,[irq_owner+ebx*4]
4077
     lea   edi,[irq_owner+ebx*4]
4105
     mov   edx,[edi]
4078
     mov   edx,[edi]
4106
     mov   eax,[0x3010]
4079
     mov   eax,[0x3010]
4107
     cmp   edx,[eax+0x4]
4080
     cmp   edx,[eax+TASKDATA.pid]
4108
     jne   fril1
4081
     jne   fril1
4109
     dec   ecx
4082
     dec   ecx
4110
     mov   [edi],ecx
4083
     mov   [edi],ecx
4111
   fril1:
4084
   fril1:
Line 4117... Line 4090...
4117
     lea   edi,[irq_owner+ebx*4]
4090
     lea   edi,[irq_owner+ebx*4]
4118
     cmp   dword [edi], 0
4091
     cmp   dword [edi], 0
4119
     jnz   ril1
4092
     jnz   ril1
Line 4120... Line 4093...
4120
 
4093
 
4121
     mov   edx,[0x3010]
4094
     mov   edx,[0x3010]
4122
     mov   edx,[edx+0x4]
4095
     mov   edx,[edx+TASKDATA.pid]
4123
     mov   [edi],edx
4096
     mov   [edi],edx
4124
     dec   ecx
4097
     dec   ecx
4125
   ril1:
4098
   ril1:
4126
     mov   [esp+36],ecx ; return in eax
4099
     mov   [esp+36],ecx ; return in eax
Line 4595... Line 4568...
4595
     test eax, eax                  ; get event data
4568
     test eax, eax                  ; get event data
4596
     jnz  no_get_sys_events
4569
     jnz  no_get_sys_events
Line 4597... Line 4570...
4597
 
4570
 
4598
     mov  esi,save_syscall_data     ; data
4571
     mov  esi,save_syscall_data     ; data
4599
     mov  edi,[0x3010]
4572
     mov  edi,[0x3010]
4600
     mov  edi,[edi+0x10]
4573
     mov  edi,[edi+TASKDATA.mem_start]
4601
     add  edi,ebx
4574
     add  edi,ebx
4602
     cld
4575
     cld
Line 4603... Line 4576...
4603
     rep  movsb
4576
     rep  movsb
Line 4617... Line 4590...
4617
 
4590
 
4618
        dec     eax             ; 1 = set keyboard mode
4591
        dec     eax             ; 1 = set keyboard mode
Line 4619... Line 4592...
4619
     jne   no_set_keyboard_setup
4592
     jne   no_set_keyboard_setup
4620
 
4593
 
Line 4621... Line 4594...
4621
     shl   edi,8
4594
     shl   edi,8
Line 4622... Line 4595...
4622
     mov   [edi+0x800B4],bl
4595
     mov   [edi+0x80000 + APPDATA.keyboard_mode],bl
Line 4623... Line 4596...
4623
 
4596
 
4624
     ret
4597
     ret
Line 4625... Line 4598...
4625
 
4598
 
4626
   no_set_keyboard_setup:
4599
   no_set_keyboard_setup:
Line 4627... Line 4600...
4627
 
4600
 
Line 4628... Line 4601...
4628
        dec     eax             ; 2 = get keyboard mode
4601
        dec     eax             ; 2 = get keyboard mode
Line 4732... Line 4705...
4732
     cmp  eax,1                      ; DEFINE IPC MEMORY
4705
     cmp  eax,1                      ; DEFINE IPC MEMORY
4733
     jne  no_ipc_def
4706
     jne  no_ipc_def
4734
     mov  edi,[0x3000]
4707
     mov  edi,[0x3000]
4735
     shl  edi,8
4708
     shl  edi,8
4736
     add  edi,0x80000
4709
     add  edi,0x80000
4737
     mov  [edi+0xA0],ebx
4710
     mov  [edi + APPDATA.ipc_start], ebx
4738
     mov  [edi+0xA4],ecx
4711
     mov  [edi + APPDATA.ipc_size], ecx
4739
     mov  [esp+36],dword 0
4712
     mov  [esp+36],dword 0
4740
     ret
4713
     ret
4741
   no_ipc_def:
4714
   no_ipc_def:
Line 4742... Line 4715...
4742
 
4715
 
4743
     cmp  eax,2                      ; SEND IPC MESSAGE
4716
     cmp  eax,2                      ; SEND IPC MESSAGE
4744
     jne  no_ipc_send
4717
     jne  no_ipc_send
4745
     mov  esi,1
4718
     mov  esi,1
4746
     mov  edi,0x3020
4719
     mov  edi,0x3020
4747
    ipcs1:
4720
    ipcs1:
4748
     cmp  [edi+4],ebx
4721
     cmp  [edi+TASKDATA.pid], ebx
4749
     je   ipcs2
4722
     je   ipcs2
4750
     add  edi,0x20
4723
     add  edi,0x20
4751
     inc  esi
4724
     inc  esi
4752
     cmp  esi,[0x3004]
4725
     cmp  esi,[0x3004]
Line 4758... Line 4731...
4758
     cli
4731
     cli
Line 4759... Line 4732...
4759
 
4732
 
4760
     push esi
4733
     push esi
4761
     mov  eax,esi
4734
     mov  eax,esi
4762
     shl  eax,8
4735
     shl  eax,8
4763
     mov  ebx,[eax+0x80000+0xa0]
4736
     mov  ebx,[eax+0x80000 + APPDATA.ipc_start]
4764
     test ebx,ebx                  ; ipc area not defined ?
4737
     test ebx,ebx                  ; ipc area not defined ?
Line 4765... Line 4738...
4765
     je   ipc_err1
4738
     je   ipc_err1
4766
 
4739
 
4767
     add  ebx,[eax+0x80000+0xa4]
4740
     add  ebx,[eax+0x80000 + APPDATA.ipc_size]
4768
     mov  eax,esi
4741
     mov  eax,esi
Line 4769... Line 4742...
4769
     shl  eax,5
4742
     shl  eax,5
4770
     add  ebx,[eax+0x3000+0x10]    ; ebx <- max data position
4743
     add  ebx,[eax+0x3000 + TASKDATA.mem_start]    ; ebx <- max data position
4771
 
4744
 
4772
     mov  eax,esi                  ; to
4745
     mov  eax,esi                  ; to
4773
     shl  esi,8
4746
     shl  esi,8
4774
     add  esi,0x80000
4747
     add  esi,0x80000
4775
     mov  edi,[esi+0xa0]
4748
     mov  edi,[esi+APPDATA.ipc_start]
Line 4776... Line 4749...
4776
     shl  eax,5
4749
     shl  eax,5
4777
     add  eax,0x3000
4750
     add  eax,0x3000
Line 4778... Line 4751...
4778
     add  edi,[eax+0x10]
4751
     add  edi,[eax+TASKDATA.mem_start]
4779
 
4752
 
4780
     cmp  [edi],byte 0             ; overrun ?
4753
     cmp  [edi],byte 0             ; overrun ?
Line 4781... Line 4754...
4781
     jne  ipc_err2
4754
     jne  ipc_err2
4782
 
4755
 
4783
     mov  ebp,edi
4756
     mov  ebp,edi
4784
     add  edi,[edi+4]
4757
     add  edi,[edi+4]
Line 4785... Line 4758...
4785
     add  edi,8
4758
     add  edi,8
Line 4786... Line 4759...
4786
 
4759
 
Line 4797... Line 4770...
4797
     jg   ipc_err3                 ; not enough room ?
4770
     jg   ipc_err3                 ; not enough room ?
Line 4798... Line 4771...
4798
 
4771
 
Line 4799... Line 4772...
4799
     push ecx
4772
     push ecx
4800
 
4773
 
4801
     mov  eax,[0x3010]
4774
     mov  eax,[0x3010]
4802
     mov  eax,[eax+4]
4775
     mov  eax,[eax+TASKDATA.pid]
4803
     mov  [edi-8],eax
4776
     mov  [edi-8],eax
4804
     mov  [edi-4],ecx
4777
     mov  [edi-4],ecx
Line 4811... Line 4784...
4811
     mov  edi,ebp                  ; increase memory position
4784
     mov  edi,ebp                  ; increase memory position
4812
     add  dword [edi+4],ecx
4785
     add  dword [edi+4],ecx
Line 4813... Line 4786...
4813
 
4786
 
4814
     mov  edi,[esp]
4787
     mov  edi,[esp]
4815
     shl  edi,8
4788
     shl  edi,8
Line 4816... Line 4789...
4816
     or   dword [edi+0x80000+0xA8],dword 01000000b ; ipc message
4789
     or   dword [edi+0x80000+APPDATA.event_mask],dword 01000000b ; ipc message
4817
 
4790
 
4818
     cmp  [check_idle_semaphore],dword 20
4791
     cmp  [check_idle_semaphore],dword 20
4819
     jge  ipc_no_cis
4792
     jge  ipc_no_cis
Line 4895... Line 4868...
4895
 
4868
 
Line 4896... Line 4869...
4896
syscall_setpixel:                       ; SetPixel
4869
syscall_setpixel:                       ; SetPixel
4897
 
4870
 
4898
 
4871
 
4899
     mov   edx,[0x3010]
4872
     mov   edx,[0x3010]
4900
     add   eax,[edx-twdw]
4873
     add   eax,[edx-twdw+WDATA.box.left]
4901
     add   ebx,[edx-twdw+4]
4874
     add   ebx,[edx-twdw+WDATA.box.top]
4902
        mov     edi,[0x3000]
4875
        mov     edi,[0x3000]
4903
        shl     edi,8
4876
        shl     edi,8
Line 4911... Line 4884...
4911
align 4
4884
align 4
Line 4912... Line 4885...
4912
 
4885
 
Line 4913... Line 4886...
4913
syscall_writetext:                      ; WriteText
4886
syscall_writetext:                      ; WriteText
4914
 
4887
 
4915
     mov   edi,[0x3010]
4888
     mov   edi,[0x3010]
4916
     mov   ebp,[edi-twdw]
4889
     mov   ebp,[edi-twdw+WDATA.box.left]
4917
        mov     esi,[0x3000]
4890
        mov     esi,[0x3000]
4918
        shl     esi,8
4891
        shl     esi,8
4919
        add     ebp,[esi+0x80000+APPDATA.wnd_clientbox.left]
4892
        add     ebp,[esi+0x80000+APPDATA.wnd_clientbox.left]
4920
     shl   ebp,16
4893
     shl   ebp,16
4921
     add   ebp,[edi-twdw+4]
-
 
4922
        add     bp,word[esi+0x80000+APPDATA.wnd_clientbox.top]
4894
     add   ebp,[edi-twdw+WDATA.box.top]
4923
     add   edi,0x10
4895
        add     bp,word[esi+0x80000+APPDATA.wnd_clientbox.top]
4924
     add   ecx,[edi]
4896
	 add   ecx,[edi+TASKDATA.mem_start]
4925
     add   eax,ebp
4897
     add   eax,ebp
Line 4926... Line 4898...
4926
     xor   edi,edi
4898
     xor   edi,edi
Line 4927... Line 4899...
4927
     jmp   dtext
4899
     jmp   dtext
Line 4928... Line 4900...
4928
 
4900
 
4929
align 4
4901
align 4
4930
 
4902
 
4931
syscall_openramdiskfile:                ; OpenRamdiskFile
4903
syscall_openramdiskfile:                ; OpenRamdiskFile
4932
 
4904
 
4933
 
4905
 
4934
     mov   edi,[0x3010]
4906
     mov   edi,[0x3010]
Line 4976... Line 4948...
4976
 
4948
 
Line 4977... Line 4949...
4977
align 4
4949
align 4
4978
 
4950
 
4979
syscall_startapp:                       ; StartApp
4951
syscall_startapp:                       ; StartApp
4980
     mov   edi,[0x3010]
4952
     mov   edi,[0x3010]
4981
     add   edi,0x10
4953
     add   edi, TASKDATA.mem_start
4982
     add   eax,[edi]
4954
     add   eax,[edi]
4983
     test  ebx,ebx
4955
     test  ebx,ebx
4984
     jz    noapppar
4956
     jz    noapppar
Line 5030... Line 5002...
5030
align 4
5002
align 4
Line 5031... Line 5003...
5031
 
5003
 
Line 5032... Line 5004...
5032
syscall_delramdiskfile:                 ; DelRamdiskFile
5004
syscall_delramdiskfile:                 ; DelRamdiskFile
5033
 
5005
 
5034
     mov   edi,[0x3010]
5006
     mov   edi,[0x3010]
5035
     add   edi,0x10
5007
     add   edi, TASKDATA.mem_start
5036
     add   eax,[edi]
5008
     add   eax,[edi]
5037
     call  filedelete
5009
     call  filedelete
Line 5038... Line 5010...
5038
     mov   [esp+36],eax
5010
     mov   [esp+36],eax
Line 5039... Line 5011...
5039
     ret
5011
     ret
Line 5040... Line 5012...
5040
 
5012
 
5041
align 4
5013
align 4
5042
 
5014
 
5043
syscall_writeramdiskfile:               ; WriteRamdiskFile
5015
syscall_writeramdiskfile:               ; WriteRamdiskFile
5044
 
5016
 
5045
     mov   edi,[0x3010]
5017
     mov   edi,[0x3010]
5046
     add   edi,0x10
5018
     add   edi, TASKDATA.mem_start
Line 5067... Line 5039...
5067
align 4
5039
align 4
Line 5068... Line 5040...
5068
 
5040
 
Line 5069... Line 5041...
5069
syscall_readstring:                     ; ReadString
5041
syscall_readstring:                     ; ReadString
5070
 
5042
 
5071
     mov   edi,[0x3010]
5043
     mov   edi,[0x3010]
5072
     add   edi,0x10
5044
     add   edi, TASKDATA.mem_start
5073
     add   eax,[edi]
5045
     add   eax,[edi]
5074
     call  read_string
5046
     call  read_string
Line 5075... Line 5047...
5075
     mov   [esp+36],eax
5047
     mov   [esp+36],eax
Line 5076... Line 5048...
5076
     ret
5048
     ret
Line 5077... Line 5049...
5077
 
5049
 
5078
align 4
5050
align 4
5079
 
5051
 
5080
syscall_drawline:                       ; DrawLine
5052
syscall_drawline:                       ; DrawLine
5081
 
5053
 
5082
     mov   edi,[0x3010]
5054
     mov   edi,[0x3010]
5083
     movzx edx,word[edi-twdw]
5055
     movzx edx,word[edi-twdw+WDATA.box.left]
5084
     mov   ebp,edx
5056
     mov   ebp,edx
5085
        mov     esi,[0x3000]
5057
        mov     esi,[0x3000]
5086
        shl     esi,8
5058
        shl     esi,8
5087
        add     ebp,[esi+0x80000+APPDATA.wnd_clientbox.left]
5059
        add     ebp,[esi+0x80000+APPDATA.wnd_clientbox.left]
5088
        add     dx,word[esi+0x80000+APPDATA.wnd_clientbox.left]
5060
        add     dx,word[esi+0x80000+APPDATA.wnd_clientbox.left]
5089
     shl   edx,16
5061
     shl   edx,16
5090
     add   ebp,edx
5062
     add   ebp,edx
5091
     movzx edx,word[edi-twdw+4]
5063
     movzx edx,word[edi-twdw+WDATA.box.top]
Line 5165... Line 5137...
5165
align 4
5137
align 4
Line 5166... Line 5138...
5166
 
5138
 
Line 5167... Line 5139...
5167
read_from_hd:                           ; Read from hd - fn not in use
5139
read_from_hd:                           ; Read from hd - fn not in use
5168
 
5140
 
5169
     mov   edi,[0x3010]
5141
     mov   edi,[0x3010]
5170
     add   edi,0x10
5142
     add   edi,TASKDATA.mem_start
5171
     add   eax,[edi]
5143
     add   eax,[edi]
5172
     add   ecx,[edi]
5144
     add   ecx,[edi]
Line 5182... Line 5154...
5182
align 4
5154
align 4
Line 5183... Line 5155...
5183
 
5155
 
Line 5184... Line 5156...
5184
write_to_hd:                            ; Write a file to hd
5156
write_to_hd:                            ; Write a file to hd
5185
 
5157
 
5186
     mov   edi,[0x3010]
5158
     mov   edi,[0x3010]
5187
     add   edi,0x10
5159
     add   edi,TASKDATA.mem_start
5188
     add   eax,[edi]
5160
     add   eax,[edi]
5189
     add   ecx,[edi]
5161
     add   ecx,[edi]
5190
     add   edx,[edi]
5162
     add   edx,[edi]