Subversion Repositories Kolibri OS

Rev

Rev 485 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 485 Rev 551
1
;
1
;
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
;
5
 
5
 
6
include 'lang.inc'
6
include 'lang.inc'
7
include '..\..\..\macros.inc'
7
include '..\..\..\macros.inc'
8
 
8
 
9
use32
9
use32
10
 org	0x0
10
 org	0x0
11
 db	'MENUET01'    ; header
11
 db	'MENUET01'    ; header
12
 dd	0x01	      ; header version
12
 dd	0x01	      ; header version
13
 dd	START	      ; entry point
13
 dd	START	      ; entry point
14
 dd	I_END	      ; image size
14
 dd	I_END	      ; image size
15
 dd	0x1000        ; required memory
15
 dd	0x1000        ; required memory
16
 dd	0x1000        ; esp
16
 dd	0x1000        ; esp
17
 dd	0x0 , 0x0     ; I_Param , I_Path
17
 dd	0x0 , 0x0     ; I_Param , I_Path
18
 
18
 
19
 
19
 
20
START:
20
START:
21
 
21
 
22
  red:
22
  red:
23
    call  draw_window
23
    call  draw_window
24
 
24
 
25
still:
25
still:
26
 
26
 
27
    mov       eax,10                 ; redraw ?
27
    mov       eax,10                 ; redraw ?
28
    mcall
28
    mcall
29
 
29
 
30
    cmp    eax,1
30
    cmp    eax,1
31
    jz     red
31
    jz     red
32
    cmp    eax,3
32
    cmp    eax,3
33
    jz     button
33
    jz     button
34
    jmp    still
34
    jmp    still
35
 
35
 
36
  button:
36
  button:
37
    mov  eax,17
37
    mov  eax,17
38
    mcall
38
    mcall
39
 
39
 
40
    cmp  al,byte 0
40
    cmp  al,byte 0
41
    jnz  still
41
    jnz  still
42
 
42
 
43
    cmp  ah,1
43
    cmp  ah,1
44
    jnz  noexit
44
    jnz  noexit
45
 
45
 
46
    mov  eax,0xffffffff
46
    mov  eax,0xffffffff
47
    mcall
47
    mcall
48
 
48
 
49
  noexit:
49
  noexit:
50
 
50
 
51
    cmp  ah,2
51
    cmp  ah,2
52
    jz   note1
52
    jz   note1
53
 
53
 
54
    mov  eax,20   ; reset midi device
54
    mov  eax,20   ; reset midi device
55
    mov  ebx,1
55
    mov  ebx,1
56
    mov  ecx,0
56
    mov  ecx,0
57
    mcall
57
    mcall
58
 
58
 
59
    cmp  eax,0
59
    cmp  eax,0
60
    jz   noe1
60
    jz   noe1
61
 
61
 
62
    call printerror
62
    call printerror
63
 
63
 
64
  noe1:
64
  noe1:
65
 
65
 
66
    jmp  still
66
    jmp  still
67
 
67
 
68
  note1:
68
  note1:
69
 
69
 
70
    mov  eax,50
70
    mov  eax,50
71
 
71
 
72
  nn:
72
  nn:
73
 
73
 
74
    mov  ebx,100
74
    mov  ebx,100
75
    call noteout
75
    call noteout
76
    pusha
76
    pusha
77
    mov  eax,5
77
    mov  eax,5
78
    mov  ebx,8
78
    mov  ebx,8
79
    mcall
79
    mcall
80
    popa
80
    popa
81
    mov  ebx,0
81
    mov  ebx,0
82
;    call noteout
82
;    call noteout
83
 
83
 
84
    add  eax,3
84
    add  eax,3
85
 
85
 
86
    mov  ebx,100
86
    mov  ebx,100
87
    call noteout
87
    call noteout
88
    pusha
88
    pusha
89
    mov  eax,5
89
    mov  eax,5
90
    mov  ebx,8
90
    mov  ebx,8
91
    mcall
91
    mcall
92
    popa
92
    popa
93
    mov  ebx,0
93
    mov  ebx,0
94
;    call noteout
94
;    call noteout
95
 
95
 
96
    add  eax,4
96
    add  eax,4
97
 
97
 
98
    inc  eax
98
    inc  eax
99
    cmp  eax,90
99
    cmp  eax,90
100
    jbe  nn
100
    jbe  nn
101
 
101
 
102
    jmp  still
102
    jmp  still
103
 
103
 
104
 
104
 
105
draw_window:
105
draw_window:
106
 
106
 
107
    pusha
107
    pusha
108
 
108
 
109
    mov       eax,12                    ; tell os about redraw
109
    mov       eax,12                    ; tell os about redraw
110
    mov       ebx,1
110
    mov       ebx,1
111
    mcall
111
    mcall
112
 
112
 
113
    mov       eax,0                     ; define and draw window
113
    mov       eax,0                     ; define and draw window
114
    mov       ebx,20*65536+250
114
    mov       ebx,20*65536+250
115
    mov       ecx,20*65536+120
115
    mov       ecx,20*65536+120
116
    mov       edx,0x13ffffff
116
    mov       edx,0x14ffffff
117
    mov       edi,title
117
    mov       edi,title
118
    mcall
118
    mcall
119
 
119
 
120
    mov       eax,8
120
    mov       eax,8
121
    mov       ebx,10*65536+200          ; button start x & size
121
    mov       ebx,10*65536+200          ; button start x & size
122
    mov       ecx,40 *65536+17          ; button start y & size
122
    mov       ecx,40 *65536+17          ; button start y & size
123
    mov       edx,2                     ; button number
123
    mov       edx,2                     ; button number
124
    mov       esi,0x4060b0              ; button color
124
    mov       esi,0x4060b0              ; button color
125
    mcall
125
    mcall
126
 
126
 
127
    mov       ecx,60 *65536+17          ; button start y & size
127
    mov       ecx,60 *65536+17          ; button start y & size
128
    mov       edx,3                     ; button number
128
    mov       edx,3                     ; button number
129
    mcall
129
    mcall
130
 
130
 
131
    mov       eax,4
131
    mov       eax,4
132
    mov       ebx,25*65536+45
132
    mov       ebx,25*65536+45
133
    mov       ecx,dword 0xffffff
133
    mov       ecx,dword 0xffffff
134
    mov       edx,buttont
134
    mov       edx,buttont
135
    mov       esi,buttontlen-buttont
135
    mov       esi,buttontlen-buttont
136
    mcall
136
    mcall
137
 
137
 
138
    mov       ebx,25*65536+65
138
    mov       ebx,25*65536+65
139
    mov       edx,buttont2
139
    mov       edx,buttont2
140
    mov       esi,buttontlen2-buttont2
140
    mov       esi,buttontlen2-buttont2
141
    mcall
141
    mcall
142
 
142
 
143
    mov       eax,12                    ; tell os about redraw end
143
    mov       eax,12                    ; tell os about redraw end
144
    mov       ebx,2
144
    mov       ebx,2
145
    mcall
145
    mcall
146
 
146
 
147
    popa
147
    popa
148
    ret
148
    ret
149
 
149
 
150
 
150
 
151
noteout:
151
noteout:
152
 
152
 
153
    pusha
153
    pusha
154
 
154
 
155
    push ebx
155
    push ebx
156
    push eax
156
    push eax
157
 
157
 
158
    mov  eax,20
158
    mov  eax,20
159
    mov  ebx,2
159
    mov  ebx,2
160
    mov  ecx,0x9f
160
    mov  ecx,0x9f
161
    mcall
161
    mcall
162
    mov  eax,20
162
    mov  eax,20
163
    mov  ebx,2
163
    mov  ebx,2
164
    pop  ecx
164
    pop  ecx
165
    mcall
165
    mcall
166
    mov  eax,20
166
    mov  eax,20
167
    mov  ebx,2
167
    mov  ebx,2
168
    pop  ecx
168
    pop  ecx
169
    mcall
169
    mcall
170
 
170
 
171
    cmp  eax,0
171
    cmp  eax,0
172
    jz   noe2
172
    jz   noe2
173
 
173
 
174
    call printerror
174
    call printerror
175
 
175
 
176
  noe2:
176
  noe2:
177
 
177
 
178
    popa
178
    popa
179
    ret
179
    ret
180
 
180
 
181
printerror:
181
printerror:
182
 
182
 
183
    mov       eax,dword 4
183
    mov       eax,dword 4
184
    mov       ebx,15*65536+85
184
    mov       ebx,15*65536+85
185
     mov       ecx,0x000000
185
     mov       ecx,0x000000
186
     mov       edx,error1
186
     mov       edx,error1
187
    mov       esi,errorlen1-error1
187
    mov       esi,errorlen1-error1
188
    mcall
188
    mcall
189
 
189
 
190
    mov       eax,dword 4
190
    mov       eax,dword 4
191
    mov       ebx,15*65536+95
191
    mov       ebx,15*65536+95
192
     mov       ecx,0x000000
192
     mov       ecx,0x000000
193
     mov       edx,error2
193
     mov       edx,error2
194
    mov       esi,errorlen2-error2
194
    mov       esi,errorlen2-error2
195
    mcall
195
    mcall
196
 
196
 
197
    ret
197
    ret
198
 
198
 
199
 
199
 
200
; DATA AREA
200
; DATA AREA
201
 
201
 
202
 
202
 
203
title    db   'MIDI TEST',0
203
title    db   'MIDI TEST',0
204
 
204
 
205
buttont:
205
buttont:
206
    db   'PLAY A FEW NOTES'
206
    db   'PLAY A FEW NOTES'
207
buttontlen:
207
buttontlen:
208
buttont2:
208
buttont2:
209
    db   'RESET MIDI DEVICE'
209
    db   'RESET MIDI DEVICE'
210
buttontlen2:
210
buttontlen2:
211
 
211
 
212
error1:
212
error1:
213
    db   'NO BASE DEFINED FOR MPU-401'
213
    db   'NO BASE DEFINED FOR MPU-401'
214
errorlen1:
214
errorlen1:
215
 
215
 
216
error2:
216
error2:
217
    db   'USE SETUP AND RESET MIDI DEVICE.'
217
    db   'USE SETUP AND RESET MIDI DEVICE.'
218
errorlen2:
218
errorlen2:
219
 
219
 
220
base db 0x0
220
base db 0x0
221
 
221
 
222
I_END:
222
I_END: