Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 120
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                               ;;
2
;;                               ;;
3
;;          DEVICE SETUP         ;;
3
;;          DEVICE SETUP         ;;
4
;;                               ;;
4
;;                               ;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
 
6
 
7
; Authors: Ville       - original version
7
; Authors: Ville       - original version
8
;          A. Ivushkin - autostart (w launcher)
8
;          A. Ivushkin - autostart (w launcher)
9
;          M. Lisovin  - added many feauters (apply all, save all, set time...)
9
;          M. Lisovin  - added many feauters (apply all, save all, set time...)
10
;          I. Poddubny - fixed russian keymap
10
;          I. Poddubny - fixed russian keymap
11
 
11
 
12
;******************************************************************************
12
;******************************************************************************
13
  use32
13
  use32
14
  org      0x0
14
  org       0x0
15
  db      'MENUET01'   ; 8 byte identifier
15
  db      'MENUET01'   ; 8 byte identifier
16
  dd      0x01           ; header version
16
  dd      0x01         ; header version
17
  dd      START        ; pointer to program start
17
  dd      START        ; pointer to program start
18
  dd      I_END        ; size of image
18
  dd      I_END        ; size of image
19
  dd      0x4000      ; reguired amount of memory
19
  dd      0x4000      ; reguired amount of memory
20
  dd      0x4000      ; stack pointer (esp)
20
  dd      0x4000      ; stack pointer (esp)
21
  dd      I_PARAM,0    ; parameters, reserved
21
  dd      I_PARAM,0    ; parameters, reserved
22
  include 'lang.inc'
22
;  include 'lang.inc'
23
  include 'macros.inc'
23
  include 'macros.inc'
24
;******************************************************************************
24
;******************************************************************************
25
 
25
 
26
LLL equ (56+3)
26
LLL equ (56+3)
27
BBB equ 25
27
BBB equ 25
28
 
28
 
29
;******************************************************************************
29
;******************************************************************************
30
apply_all:
30
apply_all:
31
 
-
 
32
    mov  eax,6            ; load saved settings from SETUP.DAT
-
 
33
    mov  ebx,filename
-
 
34
    xor  ecx,ecx
-
 
35
    or     edx,-1
-
 
36
    mov  esi,keyboard
-
 
37
    int  0x40
-
 
38
 
31
 
39
    call _midibase    ;1
32
    call _midibase    ;1
40
    call _sound_dma    ;10
33
    call _sound_dma    ;10
41
    call _pci_acc    ;12
34
    call _pci_acc    ;12
42
    call _sb16        ;4
35
    call _sb16          ;4
43
    call _wssp        ;6
36
    call _wssp          ;6
44
    call _syslang    ;5
37
    call _syslang    ;5
45
    call _keyboard    ;2
38
    call _keyboard    ;2
46
 
39
    call _mouse
47
    call get_disk_info
40
    call get_disk_info
48
    cmp  [cd],0
41
    cmp  [cd],0
49
    jne  no_cd
42
    jne  no_cd
50
    call _cdbase    ;3
43
    call _cdbase    ;3
51
  no_cd:
44
  no_cd:
52
    cmp  [hd],0
45
    cmp  [hd],0
53
    jne  no_hd
46
    jne  no_hd
54
    call _lba_read    ;11
47
    call _lba_read    ;11
55
    call _hdbase    ;7
48
    call _hdbase    ;7
56
    call _f32p        ;8
49
    call _f32p          ;8
57
  no_hd:
50
  no_hd:
58
ret
51
ret
59
;-------------------------------------------------------------------------------
52
;-------------------------------------------------------------------------------
60
get_disk_info:
53
get_disk_info:
61
    mov  [hd],1
54
    mov  [hd],1
62
    mov  [cd],1
55
    mov  [cd],1
63
    mov  [hdbase],0
56
    mov  [hdbase],0
64
    mov  [cdbase],0
57
    mov  [cdbase],0
65
    mcall 18,11,1,table_area
58
    mcall 18,11,1,table_area
66
 
59
 
67
  ide_0:
60
  ide_0:
68
    mov  al,[table_area+1]
61
    mov  al,[table_area+1]
69
    shr  al,6
62
    shr  al,6
70
    cmp  al,0
63
    cmp  al,0
71
    je    ide_1
64
    je      ide_1
72
    cmp  al,01b
65
    cmp  al,01b
73
    jnz  ide_0_cd
66
    jnz  ide_0_cd
74
    mov  [hdbase],1
67
    mov  [hdbase],1
75
    mov  [hd],0
68
    mov  [hd],0
76
    jmp  ide_1
69
    jmp  ide_1
77
 
70
 
78
  ide_0_cd:
71
  ide_0_cd:
79
    cmp  al,10b
72
    cmp  al,10b
80
    jnz  ide_1
73
    jnz  ide_1
81
    mov  [cdbase],1
74
    mov  [cdbase],1
82
    mov  [cd],0
75
    mov  [cd],0
83
    cmp  [hd],0
76
    cmp  [hd],0
84
    je     all_device
77
    je       all_device
85
 
78
 
86
  ide_1:
79
  ide_1:
87
    mov  al,[table_area+1]
80
    mov  al,[table_area+1]
88
    shl  al,2
81
    shl  al,2
89
    shr  al,6
82
    shr  al,6
90
    cmp  al,0
83
    cmp  al,0
91
    je    ide_2
84
    je      ide_2
92
    cmp  al,01b
85
    cmp  al,01b
93
    jnz  ide_1_cd
86
    jnz  ide_1_cd
94
    cmp  [hd],0
87
    cmp  [hd],0
95
    je     ide_11
88
    je       ide_11
96
    mov  [hdbase],2
89
    mov  [hdbase],2
97
    mov  [hd],0
90
    mov  [hd],0
98
  ide_11:
91
  ide_11:
99
    cmp  [cd],0
92
    cmp  [cd],0
100
    je     all_device
93
    je       all_device
101
    jmp  ide_2
94
    jmp  ide_2
102
 
95
 
103
  ide_1_cd:
96
  ide_1_cd:
104
    cmp  al,10b
97
    cmp  al,10b
105
    jnz  ide_2
98
    jnz  ide_2
106
    cmp  [cd],0
99
    cmp  [cd],0
107
    je     ide_11_cd
100
    je       ide_11_cd
108
    mov  [cdbase],2
101
    mov  [cdbase],2
109
    mov  [cd],0
102
    mov  [cd],0
110
  ide_11_cd:
103
  ide_11_cd:
111
    cmp  [hd],0
104
    cmp  [hd],0
112
    je     all_device
105
    je       all_device
113
 
106
 
114
 ide_2:
107
 ide_2:
115
    mov  al,[table_area+1]
108
    mov  al,[table_area+1]
116
    shl  al,4
109
    shl  al,4
117
    shr  al,6
110
    shr  al,6
118
    cmp  al,0
111
    cmp  al,0
119
    je    ide_3
112
    je      ide_3
120
    cmp  al,01b
113
    cmp  al,01b
121
    jnz  ide_2_cd
114
    jnz  ide_2_cd
122
    cmp  [hd],0
115
    cmp  [hd],0
123
    je     ide_21
116
    je       ide_21
124
    mov  [hdbase],3
117
    mov  [hdbase],3
125
    mov  [hd],0
118
    mov  [hd],0
126
  ide_21:
119
  ide_21:
127
    cmp  [cd],0
120
    cmp  [cd],0
128
    je     all_device
121
    je       all_device
129
    jmp  ide_3
122
    jmp  ide_3
130
 
123
 
131
  ide_2_cd:
124
  ide_2_cd:
132
    cmp  al,10b
125
    cmp  al,10b
133
    jnz  ide_3
126
    jnz  ide_3
134
    cmp  [cd],0
127
    cmp  [cd],0
135
    je     ide_21_cd
128
    je       ide_21_cd
136
    mov  [cdbase],3
129
    mov  [cdbase],3
137
    mov  [cd],0
130
    mov  [cd],0
138
  ide_21_cd:
131
  ide_21_cd:
139
    cmp  [hd],0
132
    cmp  [hd],0
140
    je     all_device
133
    je       all_device
141
 
134
 
142
  ide_3:
135
  ide_3:
143
    mov  al,[table_area+1]
136
    mov  al,[table_area+1]
144
    shl  al,6
137
    shl  al,6
145
    shr  al,6
138
    shr  al,6
146
    cmp  al,0
139
    cmp  al,0
147
    je    not_device
140
    je      not_device
148
    cmp  al,01b
141
    cmp  al,01b
149
    jnz  ide_3_cd
142
    jnz  ide_3_cd
150
    cmp  [hd],0
143
    cmp  [hd],0
151
    je     ide_31
144
    je       ide_31
152
    mov  [hdbase],4
145
    mov  [hdbase],4
153
    mov  [hd],0
146
    mov  [hd],0
154
  ide_31:
147
  ide_31:
155
    cmp  [cd],0
148
    cmp  [cd],0
156
    jmp   all_device
149
    jmp   all_device
157
 
150
 
158
  ide_3_cd:
151
  ide_3_cd:
159
    cmp  al,10b
152
    cmp  al,10b
160
    jnz  not_device
153
    jnz  not_device
161
    cmp  [cd],0
154
    cmp  [cd],0
162
    je     all_device
155
    je       all_device
163
    mov  [cdbase],4
156
    mov  [cdbase],4
164
    mov  [cd],0
157
    mov  [cd],0
165
 
158
 
166
  all_device:
159
  all_device:
167
  not_device:
160
  not_device:
168
    ret
161
    ret
169
 
162
 
170
hd db 0
163
hd db 0
171
cd db 0
164
cd db 0
172
;******************************************************************************
165
;******************************************************************************
173
apply_all_and_exit:
166
apply_all_and_exit:
-
 
167
    mcall 70,read_fileinfo
174
    call apply_all
168
    call apply_all
175
    jmp  close
169
    jmp  close
176
 
170
 
177
;******************************************************************************
171
;******************************************************************************
178
set_language_and_exit:
172
set_language_and_exit:
179
    mov  eax,26
173
    mov  eax,26
180
    mov  ebx,2
174
    mov  ebx,2
181
    mov  ecx,9
175
    mov  ecx,9
182
    int  0x40
176
    int  0x40
183
;    cmp  eax,5
177
;    cmp  eax,5
184
;    jne  @f
178
;    jne  @f
185
;    xor  eax,eax
179
;    xor  eax,eax
186
;@@: mov  [keyboard],eax
180
;@@: mov  [keyboard],eax
187
    cmp  eax,1
181
    cmp  eax,1
188
    je    russian
182
    je      russian
189
    xor  eax,eax
183
    xor  eax,eax
190
set_lang_now:
184
set_lang_now:
191
    mov  [keyboard],eax
185
    mov  [keyboard],eax
192
    call _keyboard
186
    call _keyboard
193
    jmp  close
187
    jmp  close
194
russian:
188
russian:
195
    mov  eax,3
189
    mov  eax,3
196
    jmp  set_lang_now
190
    jmp  set_lang_now
197
 
191
 
198
set_syslanguage_and_exit:
192
set_syslanguage_and_exit:
199
    mov  eax,26
193
    mov  eax,26
200
    mov  ebx,5
194
    mov  ebx,5
201
;    mov  ecx,9
195
;    mov  ecx,9
202
    int  0x40
196
    int  0x40
203
    cmp  eax,4
197
    cmp  eax,4
204
    jne  temp    ;@f
198
    jne  temp     ;@f
205
    xor  eax,eax
199
    xor  eax,eax
206
;@@: inc  eax
200
;@@: inc  eax
207
temp: inc  eax
201
temp: inc  eax
208
    mov  [syslang],eax
202
    mov  [syslang],eax
209
    call _syslang
203
    call _syslang
210
    jmp  close
204
    jmp  close
211
 
205
 
212
get_setup_values:
206
get_setup_values:
213
    mcall 26,1
207
    mcall 26,1
214
    mov [midibase],eax
208
    mov [midibase],eax
215
    mcall 26,2,9
209
    mcall 26,2,9
216
    dec  eax
210
    dec  eax
217
    mov [keyboard],eax
211
    mov [keyboard],eax
218
    mcall 26,3
212
    mcall 26,3
219
    mov [cdbase],eax
213
    mov [cdbase],eax
220
    mcall 26,4
214
    mcall 26,4