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     0x1000           ; memory for app
15
    dd     0x1000           ; memory for app
16
    dd     0x1000           ; esp
16
    dd     0x1000           ; 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  eax, 40
23
    mov  eax, 40
Line 24... Line 24...
24
    mov  ebx, 101b
24
    mov  ebx, 101b
25
    int  0x40
25
    mcall
Line 26... Line 26...
26
 
26
 
Line 27... Line 27...
27
red:
27
red:
28
    call draw_window
28
    call draw_window
29
 
29
 
Line 30... Line 30...
30
still:
30
still:
31
 
31
 
32
    mov  eax,23                 ; wait here for event
32
    mov  eax,23                 ; wait here for event
33
    mov  ebx,50
33
    mov  ebx,50
Line 43... Line 43...
43
    jmp  still
43
    jmp  still
Line 44... Line 44...
44
 
44
 
45
 
45
 
46
  button:                       ; button
46
  button:                       ; button
Line 47... Line 47...
47
    or   eax,-1                 ; close this program
47
    or   eax,-1                 ; close this program
48
    int  0x40
48
    mcall
49
 
49
 
Line 50... Line 50...
50
 
50
 
Line 51... Line 51...
51
;   *********************************************
51
;   *********************************************
52
;   *******  WINDOW DEFINITIONS AND DRAW ********
52
;   *******  WINDOW DEFINITIONS AND DRAW ********
53
;   *********************************************
53
;   *********************************************
Line 54... Line 54...
54
 
54
 
55
draw_clock:
55
draw_clock:
56
 
56
 
Line 81... Line 81...
81
  mov  esi,[sc.work_text]
81
  mov  esi,[sc.work_text]
82
  or   esi,0x50000000
82
  or   esi,0x50000000
83
  mov  edi,[sc.work]
83
  mov  edi,[sc.work]
84
  mov  ebx,0x00020000
84
  mov  ebx,0x00020000
85
  mov  edx,15*65536+5
85
  mov  edx,15*65536+5
86
  int  0x40
86
  mcall
Line 87... Line 87...
87
 
87
 
88
  pop  eax              ; MM
88
  pop  eax              ; MM
89
  imul ecx,ecx,60
89
  imul ecx,ecx,60
90
  sub  eax,ecx
90
  sub  eax,ecx
91
  mov  ecx,eax
91
  mov  ecx,eax
92
  mov  eax,47
92
  mov  eax,47
93
  add  edx,20*65536
93
  add  edx,20*65536
Line 94... Line 94...
94
  int  0x40
94
  mcall
95
 
95
 
Line 96... Line 96...
96
  pop  ecx
96
  pop  ecx
97
  pop  eax
97
  pop  eax
Line 98... Line 98...
98
 
98
 
99
  imul ecx,ecx,60
99
  imul ecx,ecx,60
100
  sub  eax,ecx
100
  sub  eax,ecx
101
 
101
 
Line 102... Line 102...
102
  mov  ecx,eax          ; SS
102
  mov  ecx,eax          ; SS
Line 103... Line 103...
103
  mov  eax,47
103
  mov  eax,47
104
  add  edx,20*65536
104
  add  edx,20*65536
105
  int  0x40
105
  mcall
106
 
106
 
107
  ret
107
  ret
108
 
108
 
Line 109... Line 109...
109
draw_window:
109
draw_window:
110
    mov  eax,48
110
    mov  eax,48
111
    mov  ebx,3
111
    mov  ebx,3
Line 112... Line 112...
112
    mov  ecx,sc
112
    mov  ecx,sc
113
    mov  edx,sizeof.system_colors
113
    mov  edx,sizeof.system_colors
114
    int  0x40
114
    mcall
115
 
115
 
116
    mov  eax,12                    ; function 12:tell os about windowdraw
116
    mov  eax,12                    ; function 12:tell os about windowdraw
117
    mov  ebx,1                     ; 1, start of draw
117
    mov  ebx,1                     ; 1, start of draw
118
    int  0x40
118
    mcall
119
 
119
 
Line 120... Line 120...
120
                                   ; DRAW WINDOW
120
                                   ; DRAW WINDOW
Line 121... Line 121...
121
    xor  eax,eax                   ; function 0 : define and draw window
121
    xor  eax,eax                   ; function 0 : define and draw window
122
    mov  ebx,100*65536+100         ; [x start] *65536 + [x size]
122
    mov  ebx,100*65536+100         ; [x start] *65536 + [x size]
123
    mov  ecx,100*65536+40          ; [y start] *65536 + [y size]
123
    mov  ecx,100*65536+40          ; [y start] *65536 + [y size]
Line 124... Line 124...
124
    mov  edx,[sc.work]             ; color of work area RRGGBB,8->color gl
124
    mov  edx,[sc.work]             ; color of work area RRGGBB,8->color gl
Line 125... Line 125...
125
    or   edx,0x33000000
125
    or   edx,0x33000000
Line 126... Line 126...
126
    mov  edi,header
126
    mov  edi,title
127
    int  0x40
127
    mcall
128
 
128
 
129
    call draw_clock
129
    call draw_clock
130
 
130
 
Line 131... Line 131...
131
    mov  eax,12                    ; function 12:tell os about windowdraw
131
    mov  eax,12                    ; function 12:tell os about windowdraw