Subversion Repositories Kolibri OS

Rev

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

Rev 316 Rev 485
Line 15... Line 15...
15
               dd     0x30000                 ; memory for app
15
               dd     0x30000                 ; memory for app
16
               dd     0x30000                 ; esp
16
               dd     0x30000                 ; esp
17
               dd     0x0 , 0x0               ; I_Param , I_Icon
17
               dd     0x0 , 0x0               ; I_Param , I_Icon
Line 18... Line 18...
18
 
18
 
19
include 'lang.inc'
19
include 'lang.inc'
Line 20... Line 20...
20
include 'macros.inc'
20
include '..\..\..\macros.inc'
21
 
21
 
22
START:                          ; start of execution
22
START:                          ; start of execution
23
    mov  [procinfo.x_start], 100
23
    mov  [procinfo.box.left], 100
24
    mov  [procinfo.x_size],  200
24
    mov  [procinfo.box.width],  200
25
    mov  [procinfo.y_start], 80
25
    mov  [procinfo.box.top], 80
26
    mov  [procinfo.y_size],  300
26
    mov  [procinfo.box.height],  300
27
    call draw_window
27
    call draw_window
28
red:    
28
red:    
Line 29... Line 29...
29
    call get_transparent
29
    call get_transparent
Line 30... Line 30...
30
    call draw_window            ; at first, draw the window
30
    call draw_window            ; at first, draw the window
31
 
31
 
Line 32... Line 32...
32
still:
32
still:
33
 
33
 
34
    mov  eax,10                 ; wait here for event
34
    mov  eax,10                 ; wait here for event
35
    int  0x40
35
    mcall
Line 42... Line 42...
42
    je   button
42
    je   button
43
    jmp  still
43
    jmp  still
Line 44... Line 44...
44
 
44
 
45
  key:                          ; key
45
  key:                          ; key
46
    mov  al,2                  ; just read it and ignore
46
    mov  al,2                  ; just read it and ignore
47
    int  0x40
47
    mcall
Line 48... Line 48...
48
    jmp  still
48
    jmp  still
49
 
49
 
50
  button:                       ; button
50
  button:                       ; button
Line 51... Line 51...
51
    mov  al,17                 ; get id
51
    mov  al,17                 ; get id
52
    int  0x40
52
    mcall
53
 
53
 
54
    cmp  ah,1                   ; button id=1 ?
54
    cmp  ah,1                   ; button id=1 ?
55
    jne  noclose
55
    jne  noclose
Line 56... Line 56...
56
    or   eax,-1                 ; close this program
56
    or   eax,-1                 ; close this program
Line 67... Line 67...
67
 
67
 
Line 68... Line 68...
68
draw_window:
68
draw_window:
69
 
69
 
70
    mov  eax,12                    ; function 12:tell os about windowdraw
70
    mov  eax,12                    ; function 12:tell os about windowdraw
71
    mov  ebx,1                     ; 1, start of draw
71
    mov  ebx,1                     ; 1, start of draw
72
    int  0x40
72
    mcall
73
                                   ; DRAW WINDOW
73
                                   ; DRAW WINDOW
74
    xor  eax,eax                   ; function 0 : define and draw window
74
    xor  eax,eax                   ; function 0 : define and draw window
75
    mov  ebx,[procinfo.x_start]
75
    mov  ebx,[procinfo.box.left]
76
    shl  ebx,16
76
    shl  ebx,16
77
    add  ebx,[procinfo.x_size]
77
    add  ebx,[procinfo.box.width]
78
    mov  ecx,[procinfo.y_start]
78
    mov  ecx,[procinfo.box.top]
79
    shl  ecx,16
79
    shl  ecx,16
80
    add  ecx,[procinfo.y_size]
80
    add  ecx,[procinfo.box.height]
81
    mov  edx,0x33000000            ; color of work area RRGGBB,8->color gl
81
    mov  edx,0x33000000            ; color of work area RRGGBB,8->color gl
Line 82... Line 82...
82
    mov  edi,header                ; WINDOW LABEL
82
    mov  edi,title                ; WINDOW LABEL
Line 83... Line 83...
83
    int  0x40
83
    mcall
84
 
84
 
85
    call draw_transparent
85
    call draw_transparent
Line 86... Line 86...
86
                                   
86
                                   
Line 97... Line 97...
97
 
97
 
Line 98... Line 98...
98
    pusha
98
    pusha
99
 
99
 
100
    mov  eax,7
100
    mov  eax,7
101
    mov  ebx,0x1000
101
    mov  ebx,0x1000
102
    mov  ecx,[procinfo.x_size]
102
    mov  ecx,[procinfo.box.width]
103
    shl  ecx,16
103
    shl  ecx,16
104
    add  ecx,[procinfo.y_size]
104
    add  ecx,[procinfo.box.height]
Line 105... Line 105...
105
    xor  edx,edx
105
    xor  edx,edx
106
    int  0x40
106
    mcall
Line 114... Line 114...
114
    pusha
114
    pusha
Line 115... Line 115...
115
 
115
 
116
    mov  eax,9
116
    mov  eax,9
117
    mov  ebx,I_END
117
    mov  ebx,I_END
118
    mov  ecx,-1
118
    mov  ecx,-1
Line 119... Line 119...
119
    int  0x40
119
    mcall
120
 
120
 
Line 121... Line 121...
121
    mov  eax,14
121
    mov  eax,14
122
    int  0x40
122
    mcall
123
 
123
 
Line 124... Line 124...
124
    shr  eax,16
124
    shr  eax,16
125
    inc  eax
125
    inc  eax
126
    mov  [scx],eax
126
    mov  [scx],eax
127
 
127
 
Line 128... Line 128...
128
    add  [procinfo.x_start], 4
128
    add  [procinfo.box.left], 4
129
    sub  [procinfo.x_size],  4+4
129
    sub  [procinfo.box.width],  4+4
130
    add  [procinfo.y_start], 22
130
    add  [procinfo.box.top], 22
131
    sub  [procinfo.y_size],  22+4
131
    sub  [procinfo.box.height],  22+4
132
 
132
 
133
    mov  eax,[procinfo.x_start]
133
    mov  eax,[procinfo.box.left]
Line 134... Line 134...
134
    add  eax,[procinfo.x_size]
134
    add  eax,[procinfo.box.width]
135
    mov  [x_end],eax
135
    mov  [x_end],eax
Line 136... Line 136...
136
    mov  eax,[procinfo.y_start]
136
    mov  eax,[procinfo.box.top]
Line 137... Line 137...
137
    add  eax,[procinfo.y_size]
137
    add  eax,[procinfo.box.height]
138
    mov  [y_end],eax
138
    mov  [y_end],eax
Line 139... Line 139...
139
 
139
 
140
    mov  eax,[procinfo.x_start]
140
    mov  eax,[procinfo.box.left]
141
    mov  ebx,[procinfo.y_start]
141
    mov  ebx,[procinfo.box.top]
142
 
142
 
Line 143... Line 143...
143
  dtpl1:
143
  dtpl1:
Line 144... Line 144...
144
 
144
 
145
    push  eax
145
    push  eax
146
    push  ebx
146
    push  ebx
147
 
147
 
148
    imul  ebx,[scx]
148
    imul  ebx,[scx]
149
    add   ebx,eax
149
    add   ebx,eax
150
    mov   eax,35
150
    mov   eax,35
151
    int   0x40
151
    mcall
152
 
152
 
Line 166... Line 166...
166
    pop   eax
166
    pop   eax
Line 167... Line 167...
167
 
167
 
168
    inc   eax
168
    inc   eax
169
    cmp   eax,[x_end]
169
    cmp   eax,[x_end]
170
    jb    dtpl1
170
    jb    dtpl1
171
    mov   eax,[procinfo.x_start]
171
    mov   eax,[procinfo.box.left]
172
    inc   ebx
172
    inc   ebx
173
    cmp   ebx,[y_end]
173
    cmp   ebx,[y_end]
Line 174... Line 174...
174
    jb    dtpl1
174
    jb    dtpl1
Line 180... Line 180...
180
 
180
 
Line 181... Line -...
181
 
-
 
182
 
-
 
183
; DATA AREA
-
 
184
 
-
 
185
;x_start  dd 100
-
 
Line 186... Line 181...
186
;y_start  dd 80
181
 
187
 
182
 
Line 188... Line 183...
188
;x_size   dd 160
183
; DATA AREA
Line 189... Line 184...
189
;y_size   dd 200
184
 
Line 190... Line 185...
190
 
185
 
191
x_end    dd 0
186
x_end    dd 0