Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 2... Line 2...
2
;    Ok, this is the sceleton that MENUET 0.01 understands.
2
;    Ok, this is the sceleton that MENUET 0.01 understands.
3
;    Do not change the header bits for now. Compile with nasm.
3
;    Do not change the header bits for now. Compile with nasm.
4
;
4
;
Line 5... Line 5...
5
 
5
 
6
include 'lang.inc'
6
include 'lang.inc'
Line 7... Line 7...
7
include 'macros.inc'
7
include '..\..\..\macros.inc'
8
 
-
 
9
use32
8
 
10
 
9
use32
11
    org   0x0
10
 org	0x0
12
    db    'MENUET00'     ; 8 byte id
11
 db	'MENUET01'    ; header
13
    dd    38             ; required os
12
 dd	0x01	      ; header version
14
    dd    START          ; program start
13
 dd	START	      ; entry point
15
    dd    I_END          ; program image size
14
 dd	I_END	      ; image size
16
    dd    0x1000         ; reguired amount of memory
15
 dd	0x1000        ; required memory
17
    dd    0x1000
-
 
Line 18... Line 16...
18
    dd    0x00000000     ; reserved=no extended header
16
 dd	0x1000        ; esp
Line -... Line 17...
-
 
17
 dd	0x0 , 0x0     ; I_Param , I_Path
19
 
18
 
Line 20... Line 19...
20
 
19
 
Line 21... Line 20...
21
 
20
START:
22
START:
21
 
Line 23... Line 22...
23
 
22
  red:
24
    call  draw_window
23
    call  draw_window
25
 
24
 
26
still:
25
still:
27
 
26
 
Line 28... Line -...
28
    mov       eax,10                 ; redraw ?
-
 
29
    int       0x40
-
 
30
 
-
 
31
    cmp    eax,1
-
 
32
    jz     red
27
    mov       eax,10                 ; redraw ?
33
    cmp    eax,3
28
    mcall
34
    jz     button
29
 
Line 35... Line 30...
35
    jmp    still
30
    cmp    eax,1
36
 
31
    jz     red
Line 37... Line 32...
37
  red:
32
    cmp    eax,3
38
    call   draw_window
33
    jz     button
Line 39... Line 34...
39
    jmp    still
34
    jmp    still
40
 
35
 
Line 41... Line 36...
41
  button:
36
  button:
Line 42... Line 37...
42
    mov  eax,17
37
    mov  eax,17
43
    int  0x40
38
    mcall
Line 44... Line 39...
44
 
39
 
45
    cmp  al,byte 0
40
    cmp  al,byte 0
46
    jnz  still
41
    jnz  still
47
 
42
 
Line 48... Line 43...
48
    cmp  ah,1
43
    cmp  ah,1
49
    jnz  noexit
44
    jnz  noexit
Line 50... Line 45...
50
 
45
 
Line 79... Line 74...
79
    mov  ebx,100
74
    mov  ebx,100
80
    call noteout
75
    call noteout
81
    pusha
76
    pusha
82
    mov  eax,5
77
    mov  eax,5
83
    mov  ebx,8
78
    mov  ebx,8
84
    int  0x40
79
    mcall
85
    popa
80
    popa
86
    mov  ebx,0
81
    mov  ebx,0
87
;    call noteout
82
;    call noteout
Line 88... Line 83...
88
 
83
 
Line 91... Line 86...
91
    mov  ebx,100
86
    mov  ebx,100
92
    call noteout
87
    call noteout
93
    pusha
88
    pusha
94
    mov  eax,5
89
    mov  eax,5
95
    mov  ebx,8
90
    mov  ebx,8
96
    int  0x40
91
    mcall
97
    popa
92
    popa
98
    mov  ebx,0
93
    mov  ebx,0
99
;    call noteout
94
;    call noteout
Line 100... Line 95...
100
 
95
 
Line 111... Line 106...
111
 
106
 
Line 112... Line 107...
112
    pusha
107
    pusha
113
 
108
 
114
    mov       eax,12                    ; tell os about redraw
109
    mov       eax,12                    ; tell os about redraw
Line 115... Line 110...
115
    mov       ebx,1
110
    mov       ebx,1
116
    int       0x40
111
    mcall
117
 
112
 
118
    mov       eax,0                     ; define and draw window
113
    mov       eax,0                     ; define and draw window
119
    mov       ebx,20*65536+250
-
 
120
    mov       ecx,20*65536+120
-
 
121
    mov       edx,0x02ffffff
-
 
122
    mov       esi,0x805070d0;88ccee
-
 
123
    mov       edi,0x005070d0;88ccee
-
 
124
    int       0x40
-
 
125
 
-
 
126
                                        ; CLOSE BUTTON
-
 
127
     mov       eax,8                     ; function 8 : define and draw
-
 
128
     mov       ebx,(250-19)*65536+12     ; [x start] *65536 + [x size]
-
 
129
    mov       ecx,5*65536+12            ; [y start] *65536 + [y size]
-
 
130
    mov       edx,1                     ; button id
-
 
131
    mov       esi,0x5577cc              ; button color RRGGBB
-
 
132
    int       0x40
-
 
133
 
114
    mov       ebx,20*65536+250
134
 
-
 
135
    mov       eax,4                     ; 4 = write text
-
 
136
    mov       ebx,8*65536+8
-
 
137
    mov       ecx,dword 0x00ffffff      ; 8b window nro - RR GG BB color
115
    mov       ecx,20*65536+120
Line 138... Line 116...
138
    mov       edx,labelt                ; pointer to text beginning
116
    mov       edx,0x13ffffff
139
    mov       esi,labellen-labelt       ; text length
117
    mov       edi,title
140
    int       0x40
118
    mcall
141
 
119
 
142
    mov       eax,8
120
    mov       eax,8
143
    mov       ebx,10*65536+200          ; button start x & size
121
    mov       ebx,10*65536+200          ; button start x & size
Line 144... Line -...
144
    mov       ecx,40 *65536+17          ; button start y & size
-
 
145
    mov       edx,2                     ; button number
-
 
146
    mov       esi,0x4060b0              ; button color
122
    mov       ecx,40 *65536+17          ; button start y & size
147
    int       0x40
123
    mov       edx,2                     ; button number
148
 
-
 
149
    mov       eax,8
124
    mov       esi,0x4060b0              ; button color
Line 150... Line 125...
150
    mov       ebx,10*65536+200          ; button start x & size
125
    mcall
151
    mov       ecx,60 *65536+17          ; button start y & size
126
 
152
    mov       edx,3                     ; button number
127
    mov       ecx,60 *65536+17          ; button start y & size
153
    mov       esi,0x4060b0              ; button color
128
    mov       edx,3                     ; button number
154
    int       0x40
129
    mcall
155
 
130
 
Line 156... Line -...
156
    mov       eax,dword 4
-
 
157
    mov       ebx,25*65536+45
131
    mov       eax,4
158
    mov       ecx,dword 0xffffff
-
 
159
    mov       edx,buttont
132
    mov       ebx,25*65536+45
160
    mov       esi,buttontlen-buttont
133
    mov       ecx,dword 0xffffff
161
    int       0x40
134
    mov       edx,buttont
Line 162... Line 135...
162
 
135
    mov       esi,buttontlen-buttont
163
    mov       eax,dword 4
136
    mcall
164
    mov       ebx,25*65536+65
137
 
Line 165... Line 138...
165
    mov       ecx,dword 0xffffff
138
    mov       ebx,25*65536+65
166
    mov       edx,buttont2
139
    mov       edx,buttont2
Line 183... Line 156...
183
    push eax
156
    push eax
Line 184... Line 157...
184
 
157
 
185
    mov  eax,20
158
    mov  eax,20
186
    mov  ebx,2
159
    mov  ebx,2
187
    mov  ecx,0x9f
160
    mov  ecx,0x9f
188
    int  0x40
161
    mcall
189
    mov  eax,20
162
    mov  eax,20
190
    mov  ebx,2
163
    mov  ebx,2
191
    pop  ecx
164
    pop  ecx
192
    int  0x40
165
    mcall
193
    mov  eax,20
166
    mov  eax,20
194
    mov  ebx,2
167
    mov  ebx,2
195
    pop  ecx
168
    pop  ecx
Line 196... Line 169...
196
    int  0x40
169
    mcall
197
 
170
 
Line 198... Line 171...
198
    cmp  eax,0
171
    cmp  eax,0
Line 210... Line 183...
210
    mov       eax,dword 4
183
    mov       eax,dword 4
211
    mov       ebx,15*65536+85
184
    mov       ebx,15*65536+85
212
     mov       ecx,0x000000
185
     mov       ecx,0x000000
213
     mov       edx,error1
186
     mov       edx,error1
214
    mov       esi,errorlen1-error1
187
    mov       esi,errorlen1-error1
215
    int       0x40
188
    mcall
Line 216... Line 189...
216
 
189
 
217
    mov       eax,dword 4
190
    mov       eax,dword 4
218
    mov       ebx,15*65536+95
191
    mov       ebx,15*65536+95
219
     mov       ecx,0x000000
192
     mov       ecx,0x000000
220
     mov       edx,error2
193
     mov       edx,error2
221
    mov       esi,errorlen2-error2
194
    mov       esi,errorlen2-error2
Line 222... Line 195...
222
    int       0x40
195
    mcall
Line 223... Line 196...
223
 
196
 
Line 224... Line -...
224
    ret
-
 
225
 
197
    ret
226
 
-
 
Line 227... Line 198...
227
; DATA AREA
198
 
228
 
199
 
229
 
200
; DATA AREA
230
labelt:
201
 
Line 246... Line 217...
246
    db   'USE SETUP AND RESET MIDI DEVICE.'
217
    db   'USE SETUP AND RESET MIDI DEVICE.'
247
errorlen2:
218
errorlen2:
Line 248... Line 219...
248
 
219
 
Line 249... Line -...
249
base db 0x0
-
 
250
 
220
base db 0x0