Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 353
Line 14... Line 14...
14
                dd      I_END                   ; program image size
14
                dd      I_END                   ; program image size
15
                dd      0x1000                  ; required amount of memory
15
                dd      0x1000                  ; required amount of memory
16
                dd      0x1000                  ; esp
16
                dd      0x1000                  ; esp
17
                dd      0x00000000              ; reserved=no extended header
17
                dd      0x00000000              ; reserved=no extended header
Line 18... Line -...
18
 
-
 
19
include 'lang.inc'
18
 
Line 20... Line 19...
20
include 'macros.inc'
19
include 'macros.inc'
Line 21... Line 20...
21
 
20
 
22
 
21
 
23
 
22
 
Line 24... Line 23...
24
START:                          ; start of execution
23
START:                          ; start of execution
Line 25... Line 24...
25
 
24
 
26
    call shape_window           ; function for shaping
25
    call shape_window           ; function for shaping
Line 27... Line 26...
27
 
26
  red:
28
    call draw_window            ; at first, draw the window
27
    call draw_window            ; at first, draw the window
29
 
28
 
30
still:
29
still:
31
 
-
 
32
    mov  eax,10                 ; wait here for event
-
 
33
    int  0x40
-
 
34
 
-
 
Line 35... Line -...
35
    cmp  eax,1                  ; redraw request ?
-
 
36
    je   red
-
 
37
    cmp  eax,2                  ; key in buffer ?
-
 
38
    je   key
-
 
39
    cmp  eax,3                  ; button in buffer ?
-
 
40
    je   button
-
 
41
 
30
 
42
    jmp  still
-
 
43
 
-
 
44
  red:                          ; redraw
-
 
45
    call draw_window
31
    mov  eax,10                 ; wait here for event
46
    jmp  still
32
    int  0x40
Line 47... Line 33...
47
 
33
 
48
  key:                          ; key
34
    dec  eax                    ; redraw request ?
49
    mov  eax,2                  ; just read it and ignore
35
    jz   red
-
 
36
    dec  eax                    ; key in buffer ?
-
 
37
    jz   key
-
 
38
 
-
 
39
  button:
50
    int  0x40
40
    mov  al,17                 ; get id
-
 
41
    int  0x40
51
    jmp  still
42
 
Line 52... Line 43...
52
 
43
    cmp  ah,1                   ; button id=1 ?
Line 128... Line 119...
128
    mov  eax,12                    ; function 12:tell os about windowdraw
119
    mov  eax,12                    ; function 12:tell os about windowdraw
129
    mov  ebx,1                     ; 1, start of draw
120
    mov  ebx,1                     ; 1, start of draw
130
    int  0x40
121
    int  0x40
Line 131... Line 122...
131
 
122
 
132
                                   ; DRAW WINDOW
123
                                   ; DRAW WINDOW
133
    mov  eax,0                     ; function 0 : define and draw window
124
    xor  eax,eax                     ; function 0 : define and draw window
134
    mov  ebx,100*65536             ; [x start] *65536 + [x size]
125
    mov  ebx,100*65536             ; [x start] *65536 + [x size]
135
    mov  ecx,100*65536             ; [y start] *65536 + [y size]
126
    mov  ecx,100*65536             ; [y start] *65536 + [y size]
136
    mov  bx,word [x_size]
127
    mov  bx,word [x_size]
137
    mov  cx,word [y_size]
128
    mov  cx,word [y_size]