1 | ; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
|
---|
2 | ;
|
---|
3 | ; This file is part of AiR-BOOT
|
---|
4 | ;
|
---|
5 | ; AiR-BOOT is free software: you can redistribute it and/or modify it under
|
---|
6 | ; the terms of the GNU General Public License as published by the Free
|
---|
7 | ; Software Foundation, either version 3 of the License, or (at your option)
|
---|
8 | ; any later version.
|
---|
9 | ;
|
---|
10 | ; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
11 | ; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
12 | ; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
---|
13 | ; details.
|
---|
14 | ;
|
---|
15 | ; You should have received a copy of the GNU General Public License along with
|
---|
16 | ; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
|
---|
17 | ;
|
---|
18 | ;---------------------------------------------------------------------------
|
---|
19 | ; AiR-BOOT / BOOT-MENU
|
---|
20 | ;---------------------------------------------------------------------------
|
---|
21 |
|
---|
22 | IFDEF MODULE_NAMES
|
---|
23 | DB 'BOOTMENU',0
|
---|
24 | ENDIF
|
---|
25 |
|
---|
26 | BOOTMENU_BuildBackground Proc Near Uses es di
|
---|
27 | call VideoIO_CursorOff
|
---|
28 | ; -------------------------------------------
|
---|
29 | mov ax, VideoIO_Segment
|
---|
30 | mov es, ax
|
---|
31 | xor di, di
|
---|
32 | mov cx, 2000
|
---|
33 | mov ax, 0720h
|
---|
34 | rep stosw ; Clear Screen
|
---|
35 | ret
|
---|
36 | BOOTMENU_BuildBackground EndP
|
---|
37 |
|
---|
38 | CLR_COPYRIGHT_CLASSIC = 0f00h
|
---|
39 | CLR_COPYRIGHT_BM = 0700h
|
---|
40 |
|
---|
41 | BOOTMENU_BuildMain Proc Near Uses es di
|
---|
42 | ; 1st line with Copyright information...
|
---|
43 | mov cx, 0101h
|
---|
44 | call VideoIO_Locate
|
---|
45 | mov cx, CLR_COPYRIGHT_BM
|
---|
46 | call VideoIO_Color
|
---|
47 | mov si, offset Copyright
|
---|
48 | call VideoIO_Print ; Print Copyright Line...
|
---|
49 |
|
---|
50 |
|
---|
51 |
|
---|
52 | ; Boot-Window... -- background color -- still need to adjust item-bg
|
---|
53 | CLR_BOOT_WINDOW_CLASSIC = 0901h
|
---|
54 | CLR_BOOT_WINDOW_BM = 0701h
|
---|
55 | CLR_BOOT_WINDOW_TB = 0708h
|
---|
56 | IFDEF TESTBUILD
|
---|
57 | CLR_BOOT_WINDOW = CLR_BOOT_WINDOW_TB
|
---|
58 | ELSE
|
---|
59 | CLR_BOOT_WINDOW = CLR_BOOT_WINDOW_BM
|
---|
60 | ENDIF
|
---|
61 |
|
---|
62 | mov cx, CLR_BOOT_WINDOW
|
---|
63 | call VideoIO_Color
|
---|
64 | mov bx, 0201h
|
---|
65 | mov dx, 0550h
|
---|
66 | add dh, Menu_TotalLines
|
---|
67 | call VideoIO_MakeWindow
|
---|
68 | ; The little separator line...
|
---|
69 | mov cx, 0402h
|
---|
70 | call VideoIO_Locate
|
---|
71 | mov al, TextChar_WinLineRight
|
---|
72 | mov cl, 78
|
---|
73 | call VideoIO_Internal_MakeWinRight
|
---|
74 |
|
---|
75 | mov dl, 18h
|
---|
76 | cmp byte ptr [CFG_BootMenuActive], 2
|
---|
77 | jne BMBM_NoDetailed1
|
---|
78 | mov dl, 15h
|
---|
79 | BMBM_NoDetailed1:
|
---|
80 | mov Menu_AbsoluteX, dl
|
---|
81 |
|
---|
82 |
|
---|
83 |
|
---|
84 | ; Display Top-Infos (labels) in Boot-Window
|
---|
85 | CLR_TOP_INFOS_CLASSIC = 0b01h
|
---|
86 | CLR_TOP_INFOS_BM = 0301h
|
---|
87 | CLR_TOP_INFOS_TB = 0308h
|
---|
88 | IFDEF TESTBUILD
|
---|
89 | CLR_TOP_INFOS = CLR_TOP_INFOS_TB
|
---|
90 | ELSE
|
---|
91 | CLR_TOP_INFOS = CLR_TOP_INFOS_BM
|
---|
92 | ENDIF
|
---|
93 |
|
---|
94 | mov cx, CLR_TOP_INFOS
|
---|
95 | call VideoIO_Color
|
---|
96 | mov ch, 03h
|
---|
97 | mov cl, dl
|
---|
98 | call VideoIO_Locate
|
---|
99 | mov si, offset TXT_TopInfos_No
|
---|
100 | call VideoIO_Print
|
---|
101 | add cl, 5
|
---|
102 | call VideoIO_Locate
|
---|
103 | ; Dynamic change, if detailed view...
|
---|
104 | mov si, offset TXT_TopInfos_Hd
|
---|
105 | add cl, 5
|
---|
106 | cmp byte ptr [CFG_BootMenuActive], 2
|
---|
107 | jne BMBM_NoDetailed2
|
---|
108 | mov si, offset TXT_TopInfos_HdSize
|
---|
109 | add cl, 8
|
---|
110 | BMBM_NoDetailed2:
|
---|
111 | call VideoIO_Print
|
---|
112 | ; End of dynamic change
|
---|
113 | call VideoIO_Locate
|
---|
114 | mov si, offset TXT_TopInfos_Label
|
---|
115 | call VideoIO_Print
|
---|
116 | add cl, 14
|
---|
117 | call VideoIO_Locate
|
---|
118 | mov si, offset TXT_TopInfos_Type
|
---|
119 | call VideoIO_Print
|
---|
120 |
|
---|
121 |
|
---|
122 |
|
---|
123 | ; Now make the separating vertical lines...
|
---|
124 | CLR_SEP_VERT_LINES_CLASSIC = 0901h
|
---|
125 | CLR_SEP_VERT_LINES_BM = 0701h
|
---|
126 | CLR_SEP_VERT_LINES_TB = 0708h
|
---|
127 | IFDEF TESTBUILD
|
---|
128 | CLR_SEP_VERT_LINES = CLR_SEP_VERT_LINES_TB
|
---|
129 | ELSE
|
---|
130 | CLR_SEP_VERT_LINES = CLR_SEP_VERT_LINES_BM
|
---|
131 | ENDIF
|
---|
132 |
|
---|
133 | mov cx, CLR_SEP_VERT_LINES
|
---|
134 | call VideoIO_Color
|
---|
135 | mov ch, 03h
|
---|
136 | mov cl, Menu_AbsoluteX
|
---|
137 | add cl, 3
|
---|
138 | mov dx, cx
|
---|
139 | call VideoIO_Locate
|
---|
140 | mov cl, 2
|
---|
141 | add cl, Menu_TotalLines
|
---|
142 | mov al, TextChar_WinLineDown
|
---|
143 | call VideoIO_Internal_MakeWinDown ; Line between "No" and "Hd"
|
---|
144 | push cx
|
---|
145 | add dl, 5
|
---|
146 | cmp byte ptr [CFG_BootMenuActive], 2
|
---|
147 | jne BMBM_NoDetailed3
|
---|
148 | add dl, 8
|
---|
149 | BMBM_NoDetailed3:
|
---|
150 | mov cx, dx
|
---|
151 | call VideoIO_Locate
|
---|
152 | pop cx
|
---|
153 | call VideoIO_Internal_MakeWinDown ; Line between "Hd" and "Label"
|
---|
154 | push cx
|
---|
155 | add dl, 14
|
---|
156 | mov cx, dx
|
---|
157 | call VideoIO_Locate
|
---|
158 | pop cx
|
---|
159 | call VideoIO_Internal_MakeWinDown ; Line between "Label" and "Type"
|
---|
160 |
|
---|
161 | ; Finally the little tweaks to make it look good...
|
---|
162 | mov cl, Menu_AbsoluteX
|
---|
163 | add cl, 3
|
---|
164 | mov dl, 3 ; 3 Steps in Total
|
---|
165 | BMBM_BootWinTweakLoop:
|
---|
166 | mov ch, 02h
|
---|
167 | call VideoIO_Locate
|
---|
168 | mov al, TextChar_WinRep1
|
---|
169 | call VideoIO_PrintSingleChar
|
---|
170 | mov ch, 04h
|
---|
171 | call VideoIO_Locate
|
---|
172 | mov al, TextChar_WinRep2
|
---|
173 | call VideoIO_PrintSingleChar
|
---|
174 | mov ch, 05h
|
---|
175 | add ch, Menu_TotalLines
|
---|
176 | call VideoIO_Locate
|
---|
177 | mov al, TextChar_WinRep3
|
---|
178 | call VideoIO_PrintSingleChar
|
---|
179 | dec dl
|
---|
180 | jz BMBM_EndBootWinTweakLoop
|
---|
181 | cmp dl, 2
|
---|
182 | jb BMBM_3rdTweak
|
---|
183 | add cl, 5
|
---|
184 | cmp byte ptr [CFG_BootMenuActive], 2
|
---|
185 | jne BMBM_BootWinTweakLoop
|
---|
186 | add cl, 8
|
---|
187 | jmp BMBM_BootWinTweakLoop
|
---|
188 | BMBM_3rdTweak:
|
---|
189 | add cl, 14
|
---|
190 | jmp BMBM_BootWinTweakLoop
|
---|
191 | BMBM_EndBootWinTweakLoop:
|
---|
192 |
|
---|
193 | ; Display Boot-Information...
|
---|
194 | xor al, al
|
---|
195 | mov Menu_UpperPart, al
|
---|
196 | call BOOTMENU_RefreshPartitionText
|
---|
197 | ; Boot-Window is DONE
|
---|
198 |
|
---|
199 |
|
---|
200 |
|
---|
201 | CLR_INFO_WINDOW_CLASSIC = 0c04h
|
---|
202 | CLR_INFO_WINDOW_BM = 0701h
|
---|
203 | CLR_INFO_WINDOW_TB = 0708h
|
---|
204 | IFDEF TESTBUILD
|
---|
205 | CLR_INFO_WINDOW = CLR_INFO_WINDOW_TB
|
---|
206 | ELSE
|
---|
207 | CLR_INFO_WINDOW = CLR_INFO_WINDOW_BM
|
---|
208 | ENDIF
|
---|
209 |
|
---|
210 | mov cx, CLR_INFO_WINDOW
|
---|
211 | ;mov cx, 0C06h ; brown, main background
|
---|
212 | call VideoIO_Color ; Color info window
|
---|
213 |
|
---|
214 | mov bx, 1401h
|
---|
215 | mov dx, 1950h
|
---|
216 | call VideoIO_MakeWindow ; Information-Window
|
---|
217 | ; den kleinen Strich...
|
---|
218 | mov cx, 1602h
|
---|
219 | call VideoIO_Locate
|
---|
220 | mov al, TextChar_WinLineRight
|
---|
221 | mov cl, 78
|
---|
222 | call VideoIO_Internal_MakeWinRight
|
---|
223 |
|
---|
224 | call BOOTMENU_BuildTimedBootText
|
---|
225 |
|
---|
226 | mov cx, 1703h
|
---|
227 | call VideoIO_Locate
|
---|
228 |
|
---|
229 |
|
---|
230 |
|
---|
231 | CLR_INFO_TEXT_CLASSIC = 0f04h
|
---|
232 | CLR_INFO_TEXT_BM = 0701h
|
---|
233 | CLR_INFO_TEXT_TB = 0708h
|
---|
234 | IFDEF TESTBUILD
|
---|
235 | CLR_INFO_TEXT = CLR_INFO_TEXT_TB
|
---|
236 | ELSE
|
---|
237 | CLR_INFO_TEXT = CLR_INFO_TEXT_BM
|
---|
238 | ENDIF
|
---|
239 |
|
---|
240 | mov cx, CLR_INFO_TEXT ; Info text
|
---|
241 | call VideoIO_Color ; Color info text
|
---|
242 |
|
---|
243 | mov si, offset TXT_BootMenuHelpText1
|
---|
244 | call VideoIO_Print
|
---|
245 | mov cx, 1803h
|
---|
246 | call VideoIO_Locate
|
---|
247 | mov si, offset TXT_BootMenuHelpText2
|
---|
248 | call VideoIO_Print
|
---|
249 |
|
---|
250 |
|
---|
251 |
|
---|
252 | CLR_F10_SETUP_CLASSIC = 0c04h
|
---|
253 | CLR_F10_SETUP_BM = 0901h
|
---|
254 | CLR_F10_SETUP_TB = 0908h
|
---|
255 | IFDEF TESTBUILD
|
---|
256 | CLR_F10_SETUP = CLR_F10_SETUP_TB
|
---|
257 | ELSE
|
---|
258 | CLR_F10_SETUP = CLR_F10_SETUP_BM
|
---|
259 | ENDIF
|
---|
260 |
|
---|
261 | mov cx, CLR_F10_SETUP ; background F10 enter Setup
|
---|
262 | call VideoIO_Color
|
---|
263 |
|
---|
264 | ; Additional message how to power off system
|
---|
265 | mov si, offset TXT_BootMenuPowerOff
|
---|
266 | call GetLenOfString
|
---|
267 | mov dx, 1902h
|
---|
268 | ;~ sub dl, cl
|
---|
269 | mov cx, dx
|
---|
270 | call VideoIO_Locate
|
---|
271 | mov al, TextChar_WinRep4
|
---|
272 | call VideoIO_PrintSingleChar
|
---|
273 | call VideoIO_Print
|
---|
274 | mov al, TextChar_WinRep5
|
---|
275 | call VideoIO_PrintSingleChar
|
---|
276 |
|
---|
277 |
|
---|
278 | ; Additional message how to enter setup
|
---|
279 | mov si, offset TXT_BootMenuEnterSetup
|
---|
280 | call GetLenOfString
|
---|
281 | mov dx, 194Eh
|
---|
282 | sub dl, cl
|
---|
283 | mov cx, dx
|
---|
284 | call VideoIO_Locate
|
---|
285 | mov al, TextChar_WinRep4
|
---|
286 | call VideoIO_PrintSingleChar
|
---|
287 | call VideoIO_Print
|
---|
288 | mov al, TextChar_WinRep5
|
---|
289 | call VideoIO_PrintSingleChar
|
---|
290 |
|
---|
291 | ; HelpWindow done...
|
---|
292 |
|
---|
293 | ret
|
---|
294 | BOOTMENU_BuildMain EndP
|
---|
295 |
|
---|
296 |
|
---|
297 |
|
---|
298 | BOOTMENU_BuildGoodBye Proc Near Uses es di
|
---|
299 | mov ax, VideoIO_Segment
|
---|
300 | mov es, ax
|
---|
301 | xor di, di
|
---|
302 | mov cx, 2000
|
---|
303 | mov ax, 0720h
|
---|
304 | rep stosw
|
---|
305 | ; -------------------------------------------
|
---|
306 |
|
---|
307 |
|
---|
308 |
|
---|
309 | CLR_GOODBYE_WINDOW_CLASSIC = 0d05h
|
---|
310 | CLR_GOODBYE_WINDOW_BM = 0f01h
|
---|
311 | CLR_GOODBYE_WINDOW_TB = 0f01h
|
---|
312 | IFDEF TESTBUILD
|
---|
313 | CLR_GOODBYE_WINDOW = CLR_GOODBYE_WINDOW_TB
|
---|
314 | ELSE
|
---|
315 | CLR_GOODBYE_WINDOW = CLR_GOODBYE_WINDOW_BM
|
---|
316 | ENDIF
|
---|
317 |
|
---|
318 | mov cx, CLR_GOODBYE_WINDOW
|
---|
319 | call VideoIO_Color
|
---|
320 | mov bx, 0101h
|
---|
321 | mov dx, 0550h
|
---|
322 | call VideoIO_MakeWindow ; Information-Window
|
---|
323 | xor di, di
|
---|
324 | mov cx, 10
|
---|
325 | mov ax, 0720h
|
---|
326 | rep stosw
|
---|
327 | mov di, 162
|
---|
328 | mov cx, 9
|
---|
329 | mov al, WinCharRight
|
---|
330 |
|
---|
331 | ; Little part before version in goodbye-window
|
---|
332 | ; Does not use color-function
|
---|
333 | ;mov ah, 05Dh
|
---|
334 | mov ah, 01fh
|
---|
335 | rep stosw
|
---|
336 |
|
---|
337 | mov cx, 010Bh
|
---|
338 | call VideoIO_Locate
|
---|
339 | mov al, WinCharBB
|
---|
340 | call VideoIO_PrintSingleChar
|
---|
341 | mov cx, 0201h
|
---|
342 | call VideoIO_Locate
|
---|
343 | mov al, WinCharBB
|
---|
344 | call VideoIO_PrintSingleChar
|
---|
345 | mov cx, 000Bh
|
---|
346 | call VideoIO_Locate
|
---|
347 | mov al, WinCharEE
|
---|
348 | call VideoIO_PrintSingleChar
|
---|
349 | ; --------------------------------------- Window done
|
---|
350 | mov cx, 010Ch
|
---|
351 | call VideoIO_Locate
|
---|
352 | mov al, TextChar_WinRep4
|
---|
353 | call VideoIO_PrintSingleChar
|
---|
354 |
|
---|
355 |
|
---|
356 |
|
---|
357 | CLR_GOODBYE_AB_VERSION_CLASSIC = 0e01h
|
---|
358 | CLR_GOODBYE_AB_VERSION_BM = 0e03h
|
---|
359 | CLR_GOODBYE_AB_VERSION_TB = 0e03h
|
---|
360 | IFDEF TESTBUILD
|
---|
361 | CLR_GOODBYE_AB_VERSION = CLR_GOODBYE_AB_VERSION_TB
|
---|
362 | ELSE
|
---|
363 | CLR_GOODBYE_AB_VERSION = CLR_GOODBYE_AB_VERSION_BM
|
---|
364 | ENDIF
|
---|
365 |
|
---|
366 | mov cx, CLR_GOODBYE_AB_VERSION
|
---|
367 | call VideoIO_Color
|
---|
368 | mov si, offset Copyright
|
---|
369 | mov cl, 11+CopyrightVersionLen
|
---|
370 | call VideoIO_FixedPrint
|
---|
371 |
|
---|
372 | mov cx, CLR_GOODBYE_WINDOW_BM
|
---|
373 |
|
---|
374 | call VideoIO_Color
|
---|
375 | mov al, TextChar_WinRep5
|
---|
376 | call VideoIO_PrintSingleChar
|
---|
377 | mov cx, 020Dh
|
---|
378 | call VideoIO_Locate
|
---|
379 |
|
---|
380 |
|
---|
381 |
|
---|
382 | CLR_GOODBYE_WINDOW_CLASSIC_2 = 0f05h
|
---|
383 | CLR_GOODBYE_WINDOW_BM_2 = 0701h
|
---|
384 | CLR_GOODBYE_WINDOW_TB_2 = 0701h
|
---|
385 | IFDEF TESTBUILD
|
---|
386 | CLR_GOODBYE_WINDOW_2 = CLR_GOODBYE_WINDOW_TB_2
|
---|
387 | ELSE
|
---|
388 | CLR_GOODBYE_WINDOW_2 = CLR_GOODBYE_WINDOW_BM_2
|
---|
389 | ENDIF
|
---|
390 |
|
---|
391 | mov cx, CLR_GOODBYE_WINDOW_2
|
---|
392 | call VideoIO_Color
|
---|
393 | inc si
|
---|
394 | call VideoIO_Print ; Print Copyright to the end...
|
---|
395 | mov cx, 0303h
|
---|
396 | call VideoIO_Locate
|
---|
397 | mov si, offset BootEndMsg ; Print End-Message...
|
---|
398 | call VideoIO_Print
|
---|
399 | mov cx, 0403h
|
---|
400 | call VideoIO_Locate
|
---|
401 | mov si, offset BootEndMsg2 ; Print GPL-Message...
|
---|
402 | call VideoIO_Print
|
---|
403 | ; -------------------------------------------
|
---|
404 | mov ah, 02h
|
---|
405 | mov bh, 00h
|
---|
406 | mov dx, 0600h ; Sets cursor location to 7, 1
|
---|
407 | int 10h
|
---|
408 | call VideoIO_CursorOn
|
---|
409 | ret
|
---|
410 | BOOTMENU_BuildGoodBye EndP
|
---|
411 |
|
---|
412 |
|
---|
413 |
|
---|
414 | ; Must preserve AX!
|
---|
415 | BOOTMENU_BuildTimedBootText Proc Near Uses ax cx si es di
|
---|
416 | mov cx, 1503h ;
|
---|
417 | call VideoIO_Locate
|
---|
418 |
|
---|
419 |
|
---|
420 |
|
---|
421 | CLR_NON_TIMED_BAR_CLASSIC = 0e04h
|
---|
422 | CLR_NON_TIMED_BAR_BM = 0701h
|
---|
423 | CLR_NON_TIMED_BAR_TB = 0708h
|
---|
424 | IFDEF TESTBUILD
|
---|
425 | CLR_NON_TIMED_BAR = CLR_NON_TIMED_BAR_TB
|
---|
426 | ELSE
|
---|
427 | CLR_NON_TIMED_BAR = CLR_NON_TIMED_BAR_BM
|
---|
428 | ENDIF
|
---|
429 |
|
---|
430 | mov cx, CLR_NON_TIMED_BAR ; non-timed time bar
|
---|
431 | call VideoIO_Color
|
---|
432 | call VideoIO_Internal_SetRegs
|
---|
433 | mov cx, 76
|
---|
434 | mov al, 20h ; Space
|
---|
435 | rep stosw ; delete all at first
|
---|
436 | mov al, TimedBootEnable
|
---|
437 | or al, al
|
---|
438 | jz BMBTBT_NoTimed
|
---|
439 | jmp BMBTBT_TimedBoot
|
---|
440 | BMBTBT_NoTimed:
|
---|
441 | mov si, offset TXT_TimedBootDisabled
|
---|
442 | call VideoIO_Print
|
---|
443 | ret
|
---|
444 |
|
---|
445 | BMBTBT_TimedBoot:
|
---|
446 | mov cx, 1503h
|
---|
447 | call VideoIO_Locate
|
---|
448 |
|
---|
449 |
|
---|
450 |
|
---|
451 | CLR_TIMED_BAR_CLASSIC = 0e04h
|
---|
452 | CLR_TIMED_BAR_BM = 0e04h
|
---|
453 | CLR_TIMED_BAR_TB = 0e04h
|
---|
454 | IFDEF TESTBUILD
|
---|
455 | CLR_TIMED_BAR = CLR_TIMED_BAR_TB
|
---|
456 | ELSE
|
---|
457 | CLR_TIMED_BAR = CLR_TIMED_BAR_BM
|
---|
458 | ENDIF
|
---|
459 |
|
---|
460 | mov cx, CLR_TIMED_BAR ; timed time bar, yellow on red
|
---|
461 | call VideoIO_Color
|
---|
462 | mov si, offset TXT_TimedBootLine ; will print TimedBootEntryName too
|
---|
463 | call VideoIO_Print
|
---|
464 | mov si, offset TXT_TimedBootLine2
|
---|
465 | call VideoIO_Print
|
---|
466 | mov al, TimedSecondLeft
|
---|
467 | call VideoIO_PrintByteDynamicNumber
|
---|
468 | mov si, offset TXT_TimedBootSecond ; 'Second.'
|
---|
469 | cmp al, 1
|
---|
470 | je BMBTBT_JustOneLeft
|
---|
471 | mov si, offset TXT_TimedBootSeconds ; 'Seconds.'
|
---|
472 | BMBTBT_JustOneLeft:
|
---|
473 | call VideoIO_Print
|
---|
474 | ret
|
---|
475 | BOOTMENU_BuildTimedBootText EndP
|
---|
476 |
|
---|
477 | BOOTMENU_RefreshPartitionText Proc Near Uses cx dx
|
---|
478 | mov dl, Menu_UpperPart ; Current Partition to Display
|
---|
479 | mov ch, 5 ; Line On Screen
|
---|
480 | mov cl, Menu_TotalLines ; Total Lines to Display
|
---|
481 | BMRPT_Loop:
|
---|
482 | ; Write Partition-Info (partition DL) to Screen at CH
|
---|
483 | call BOOTMENU_BuildPartitionText
|
---|
484 | inc ch
|
---|
485 | inc dl
|
---|
486 | dec cl
|
---|
487 | jnz BMRPT_Loop
|
---|
488 | ret
|
---|
489 | BOOTMENU_RefreshPartitionText EndP
|
---|
490 |
|
---|
491 |
|
---|
492 |
|
---|
493 | CLR_VOLUME_INDEX_CLASSIC = 0f01h
|
---|
494 | CLR_VOLUME_INDEX_BM = 0f01h
|
---|
495 | CLR_VOLUME_INDEX_TB = 0f08h
|
---|
496 | IFDEF TESTBUILD
|
---|
497 | CLR_VOLUME_INDEX = CLR_VOLUME_INDEX_TB
|
---|
498 | ELSE
|
---|
499 | CLR_VOLUME_INDEX = CLR_VOLUME_INDEX_BM
|
---|
500 | ENDIF
|
---|
501 |
|
---|
502 | ; Writes Partition-Information to Screen (Boot-Menu)
|
---|
503 | ; In: CH - Line to print info
|
---|
504 | ; DL - Number of Partition (Base=0)
|
---|
505 | ; Destroyed: None
|
---|
506 | BOOTMENU_BuildPartitionText Proc Near Uses ax cx dx si
|
---|
507 | local PartPointer:word
|
---|
508 |
|
---|
509 | call PART_GetPartitionPointer ; Gets pointer to partition (DL) -> SI
|
---|
510 | mov [PartPointer], si ; SI now points to the IPT-entry
|
---|
511 |
|
---|
512 | ; === Display Boot-Number ===
|
---|
513 | mov cl, Menu_AbsoluteX
|
---|
514 | mov dh, cl
|
---|
515 | call VideoIO_Locate
|
---|
516 | mov cx, CLR_VOLUME_INDEX ; Bwhite, blue
|
---|
517 | call VideoIO_Color
|
---|
518 | mov al, dl
|
---|
519 | inc al
|
---|
520 | call VideoIO_PrintByteNumber
|
---|
521 |
|
---|
522 | ; === Display Drive-Number and Size (Size only in detailed view) ===
|
---|
523 | add dh, 5
|
---|
524 | ;movzx cx, dh
|
---|
525 | mov cl,dh
|
---|
526 | mov ch,0
|
---|
527 |
|
---|
528 | call VideoIO_Locate
|
---|
529 |
|
---|
530 |
|
---|
531 |
|
---|
532 | CLR_HD_INDEX_CLASSIC = 0d01h
|
---|
533 | CLR_HD_INDEX_BM = 0701h
|
---|
534 | CLR_HD_INDEX_TB = 0708h
|
---|
535 | IFDEF TESTBUILD
|
---|
536 | CLR_HD_INDEX = CLR_HD_INDEX_TB
|
---|
537 | ELSE
|
---|
538 | CLR_HD_INDEX = CLR_HD_INDEX_BM
|
---|
539 | ENDIF
|
---|
540 |
|
---|
541 | mov cx, CLR_HD_INDEX
|
---|
542 | call VideoIO_Color ; Violet, blue
|
---|
543 | mov si, [PartPointer]
|
---|
544 | mov al, [si+LocIPT_Drive]
|
---|
545 | sub al, 7Fh ; Will only display numbers up to 99,
|
---|
546 | call VideoIO_PrintByteNumber ; so only showing harddrives...
|
---|
547 | add dh, 5
|
---|
548 | cmp byte ptr [CFG_BootMenuActive], 2
|
---|
549 | jne BMBPT_NoDetailed
|
---|
550 | add dh, 8
|
---|
551 | cmp al, 99
|
---|
552 | jbe BMBPT_IsHarddrive
|
---|
553 | mov al, ' '
|
---|
554 | mov cl, 7
|
---|
555 | call VideoIO_PrintSingleMultiChar ; Fill up Size-Space with spaces
|
---|
556 | jmp BMBPT_NoDetailed
|
---|
557 | BMBPT_IsHarddrive:
|
---|
558 | ; Now display Size-Element...
|
---|
559 |
|
---|
560 |
|
---|
561 |
|
---|
562 | CLR_HD_SIZE_CLASSIC = 0501h
|
---|
563 | CLR_HD_SIZE_BM = 0701h
|
---|
564 | CLR_HD_SIZE_TB = 0708h
|
---|
565 | IFDEF TESTBUILD
|
---|
566 | CLR_HD_SIZE = CLR_HD_SIZE_TB
|
---|
567 | ELSE
|
---|
568 | CLR_HD_SIZE = CLR_HD_SIZE_BM
|
---|
569 | ENDIF
|
---|
570 |
|
---|
571 | mov cx, CLR_HD_SIZE
|
---|
572 | call VideoIO_Color ; Dark-Violet, Blue
|
---|
573 | mov al, '/'
|
---|
574 | call VideoIO_PrintSingleChar
|
---|
575 | mov cx, CLR_HD_SIZE
|
---|
576 | call VideoIO_Color ; Violet, Blue
|
---|
577 | mov ax, [PartPointer] ; Get Size-Element from PartPtr (AX)
|
---|
578 | call PART_GetSizeElementPointer ; DS:SI -> Size-Element...
|
---|
579 | mov cl, 4
|
---|
580 | call VideoIO_FixedPrint ; Display 4 chars from DS:SI
|
---|
581 | inc TextPosX ; Manual-Hackin to adjust TextPos
|
---|
582 | mov cl, 2
|
---|
583 | call VideoIO_FixedPrint ; Display 2 chars from DS:SI
|
---|
584 | BMBPT_NoDetailed:
|
---|
585 |
|
---|
586 | ; === Display Label ===
|
---|
587 | ;movzx cx, dh
|
---|
588 | mov cl,dh
|
---|
589 | mov ch,0
|
---|
590 |
|
---|
591 | call VideoIO_Locate
|
---|
592 |
|
---|
593 |
|
---|
594 |
|
---|
595 | CLR_LABEL_CLASSIC = 0e01h
|
---|
596 | CLR_LABEL_BM = 0f01h
|
---|
597 | CLR_LABEL_TB = 0f08h
|
---|
598 | IFDEF TESTBUILD
|
---|
599 | CLR_LABEL = CLR_LABEL_TB
|
---|
600 | ELSE
|
---|
601 | CLR_LABEL = CLR_LABEL_BM
|
---|
602 | ENDIF
|
---|
603 |
|
---|
604 | mov cx, CLR_LABEL
|
---|
605 | call VideoIO_Color ; Yellow, blue
|
---|
606 | mov si, [PartPointer]
|
---|
607 | add si, LocIPT_Name
|
---|
608 | mov cl, 11
|
---|
609 | call VideoIO_FixedPrint
|
---|
610 |
|
---|
611 | ; === Display Type ===
|
---|
612 | add dh, 14
|
---|
613 | ;movzx cx, dh
|
---|
614 | mov cl,dh
|
---|
615 | mov ch,0
|
---|
616 |
|
---|
617 | call VideoIO_Locate
|
---|
618 | mov si, [PartPointer]
|
---|
619 | mov al, [si+LocIPT_SystemID]
|
---|
620 | call PART_SearchFileSysName
|
---|
621 |
|
---|
622 |
|
---|
623 |
|
---|
624 | CLR_FS_NAME_CLASSIC = 0c01h
|
---|
625 | CLR_FS_NAME_BM = 0701h
|
---|
626 | CLR_FS_NAME_TB = 0708h
|
---|
627 | IFDEF TESTBUILD
|
---|
628 | CLR_FS_NAME = CLR_FS_NAME_TB
|
---|
629 | ELSE
|
---|
630 | CLR_FS_NAME = CLR_FS_NAME_BM
|
---|
631 | ENDIF
|
---|
632 |
|
---|
633 | mov cx, CLR_FS_NAME
|
---|
634 | call VideoIO_Color ; Hrot, Blau
|
---|
635 | mov cl, 8
|
---|
636 | call VideoIO_FixedPrint
|
---|
637 |
|
---|
638 |
|
---|
639 |
|
---|
640 | ; Color for drive-letter
|
---|
641 | CLR_DL_CLASSIC = 0f01h
|
---|
642 | CLR_DL_BM = 0f01h
|
---|
643 | CLR_DL_TB = 0f08h
|
---|
644 | IFDEF TESTBUILD
|
---|
645 | CLR_DL = CLR_DL_TB
|
---|
646 | ELSE
|
---|
647 | CLR_DL = CLR_DL_BM
|
---|
648 | ENDIF
|
---|
649 |
|
---|
650 |
|
---|
651 |
|
---|
652 | ; Color for hidden drive-letter
|
---|
653 | CLR_DL_HIDDEN_CLASSIC = 0701h
|
---|
654 | CLR_DL_HIDDEN_BM = 0701h
|
---|
655 | CLR_DL_HIDDEN_TB = 0708h
|
---|
656 | IFDEF TESTBUILD
|
---|
657 | CLR_DL_HIDDEN = CLR_DL_HIDDEN_TB
|
---|
658 | ELSE
|
---|
659 | CLR_DL_HIDDEN = CLR_DL_HIDDEN_BM
|
---|
660 | ENDIF
|
---|
661 |
|
---|
662 | DRIVELETTERS_ENABLE EQU
|
---|
663 |
|
---|
664 | IFDEF DRIVELETTERS_ENABLE
|
---|
665 |
|
---|
666 | ;
|
---|
667 | ; THIS IS WHERE WE CAN SHOW DRIVE-LETTERS !
|
---|
668 | ;
|
---|
669 |
|
---|
670 | pusha
|
---|
671 |
|
---|
672 | mov al,[CFG_MiscFlags]
|
---|
673 | and al,00000001b
|
---|
674 | jz skip_show_dl
|
---|
675 |
|
---|
676 |
|
---|
677 | ; Dirty hack to pad remaining line with spaces.
|
---|
678 | ; Should be implemented in scrolling routine.
|
---|
679 | push word ptr [TextPosY] ; Quick save X,Y position
|
---|
680 | mov al, ' ' ; Filler
|
---|
681 | mov cl, 79 ; Index of last column
|
---|
682 | sub cl, byte ptr [TextPosX] ; Calculate padding length
|
---|
683 | call VideoIO_PrintSingleMultiChar ; Do the padding
|
---|
684 | pop word ptr [TextPosY] ; Quick restore X,Y position
|
---|
685 |
|
---|
686 | ; Get AiR-BOOT system-ID to see if drive-letters need to be shown
|
---|
687 | mov si, [PartPointer]
|
---|
688 | mov ah, [si+LocIPT_SystemID]
|
---|
689 |
|
---|
690 | IFDEF AUX_DEBUG
|
---|
691 | IF 0
|
---|
692 | pushf
|
---|
693 | pusha
|
---|
694 | mov al, ' '
|
---|
695 | call VideoIO_PrintSingleChar
|
---|
696 | mov al, ah
|
---|
697 | call VideoIO_PrintHexByte
|
---|
698 | mov al, ' '
|
---|
699 | call VideoIO_PrintSingleChar
|
---|
700 | popa
|
---|
701 | popf
|
---|
702 | ENDIF
|
---|
703 | ENDIF
|
---|
704 |
|
---|
705 | ; Only show drive-letters when partition is HPFS or JFS
|
---|
706 | mov al, ah ; AiR-BOOT system-ID in AL
|
---|
707 | cmp al, 07h ; Is HPFS ?
|
---|
708 | je show_dl ; Yep, show drive-letters
|
---|
709 | cmp al, 0fch ; Is JFS ?
|
---|
710 | je show_dl ; Yep, show drive-letters
|
---|
711 |
|
---|
712 | jmp skip_show_dl ; No HPFS or JFS, skip show drive-letters
|
---|
713 |
|
---|
714 | show_dl:
|
---|
715 |
|
---|
716 | ;~ mov al, ' '
|
---|
717 | ;~ call VideoIO_PrintSingleChar
|
---|
718 |
|
---|
719 | mov dl, byte ptr [si+LocIPT_Drive]
|
---|
720 | mov ax, [si+LocIPT_AbsoluteBegin+00h]
|
---|
721 | mov bx, [si+LocIPT_AbsoluteBegin+02h]
|
---|
722 |
|
---|
723 | mov si, offset [TmpSector]
|
---|
724 | mov di,ds
|
---|
725 | call DriveIO_ReadSectorLBA
|
---|
726 | mov al, [si+25h]
|
---|
727 |
|
---|
728 | IFDEF AUX_DEBUG
|
---|
729 | IF 0
|
---|
730 | pushf
|
---|
731 | pusha
|
---|
732 | call VideoIO_PrintHexByte
|
---|
733 | popa
|
---|
734 | popf
|
---|
735 | ENDIF
|
---|
736 | ENDIF
|
---|
737 |
|
---|
738 | mov dh,al
|
---|
739 | sub dh,3dh
|
---|
740 |
|
---|
741 | mov si, [PartPointer]
|
---|
742 | call LVM_GetDriveLetter
|
---|
743 |
|
---|
744 | IF 0
|
---|
745 | ; Print values at start of LVM-record
|
---|
746 | pushf
|
---|
747 | pusha
|
---|
748 | mov si, offset [LVMSector]
|
---|
749 | lodsw
|
---|
750 | call VideoIO_PrintHexWord
|
---|
751 | lodsw
|
---|
752 | call VideoIO_PrintHexWord
|
---|
753 | popa
|
---|
754 | popf
|
---|
755 | ENDIF
|
---|
756 | jc skip_show_dl
|
---|
757 |
|
---|
758 | test al,al
|
---|
759 | jnz show_dl2
|
---|
760 |
|
---|
761 |
|
---|
762 |
|
---|
763 | mov si, offset [dl_hidden]
|
---|
764 | mov cx, CLR_DL
|
---|
765 | call VideoIO_Color
|
---|
766 | call VideoIO_Print
|
---|
767 |
|
---|
768 | mov cx, CLR_DL_HIDDEN
|
---|
769 | call VideoIO_Color
|
---|
770 |
|
---|
771 | mov al, dh
|
---|
772 | call VideoIO_PrintSingleChar
|
---|
773 | mov al, ':'
|
---|
774 | call VideoIO_PrintSingleChar
|
---|
775 |
|
---|
776 | jmp skip_show_dl
|
---|
777 |
|
---|
778 | show_dl2:
|
---|
779 |
|
---|
780 | mov si, offset [dl_text]
|
---|
781 |
|
---|
782 | call VideoIO_Print
|
---|
783 |
|
---|
784 | mov cx, CLR_DL
|
---|
785 | call VideoIO_Color
|
---|
786 |
|
---|
787 | call VideoIO_PrintSingleChar
|
---|
788 | mov al,':'
|
---|
789 | call VideoIO_PrintSingleChar
|
---|
790 |
|
---|
791 | skip_show_dl:
|
---|
792 | popa
|
---|
793 |
|
---|
794 | ENDIF
|
---|
795 |
|
---|
796 |
|
---|
797 | ret
|
---|
798 | BOOTMENU_BuildPartitionText EndP
|
---|
799 |
|
---|
800 | IF NOT BLD_LANG_TXT EQ 'es'
|
---|
801 | ; Drive-Letter indication for OS/2 partitions
|
---|
802 | dl_text db ' on drive ',0
|
---|
803 | dl_hidden db ' hidden ',0
|
---|
804 | ENDIF
|
---|
805 |
|
---|
806 | ; In: DL - Active Partition
|
---|
807 | ; DH - New Active Partition (may not be correct number)
|
---|
808 | ; Out: DX - will get returned (fixed, if needed)
|
---|
809 | BOOTMENU_BuildChoiceBar Proc near Uses ax es di
|
---|
810 |
|
---|
811 | ;call SOUND_Beep
|
---|
812 |
|
---|
813 | call VideoIO_WaitRetrace
|
---|
814 |
|
---|
815 |
|
---|
816 | ;call SOUND_Beep
|
---|
817 |
|
---|
818 |
|
---|
819 |
|
---|
820 | ; SELECTION BAR REDRAW
|
---|
821 | CLR_SELECTION_BAR_REDRAW_CLASSIC = 10h
|
---|
822 | CLR_SELECTION_BAR_REDRAW_BM = 10h
|
---|
823 | CLR_SELECTION_BAR_REDRAW_TB = 80h
|
---|
824 | IFDEF TESTBUILD
|
---|
825 | CLR_SELECTION_BAR_REDRAW = CLR_SELECTION_BAR_REDRAW_TB
|
---|
826 | ELSE
|
---|
827 | CLR_SELECTION_BAR_REDRAW = CLR_SELECTION_BAR_REDRAW_BM
|
---|
828 | ENDIF
|
---|
829 |
|
---|
830 | mov cl, CLR_SELECTION_BAR_REDRAW ; Color BROWN, Partition DL
|
---|
831 | call BOOTMENU_ReColorPart
|
---|
832 |
|
---|
833 | ;call SOUND_Beep
|
---|
834 |
|
---|
835 | ; Check, if clipping needed...
|
---|
836 | cmp dh, 0ffh
|
---|
837 | jne BMBCB_RightMin
|
---|
838 | xor dh, dh
|
---|
839 | BMBCB_RightMin:
|
---|
840 | cmp dh, Menu_TotalParts ; DH is base 0, TotalParts is counter
|
---|
841 | jb BMBCB_AfterClipping ; That's why JB and not JBE
|
---|
842 | mov dh, Menu_TotalParts
|
---|
843 | dec dh ; Now base 0
|
---|
844 | BMBCB_AfterClipping:
|
---|
845 | ; After Clipping
|
---|
846 | mov dl, dh
|
---|
847 | mov cl, Menu_UpperPart
|
---|
848 | ; Now check, if we need to Scroll
|
---|
849 | cmp dh, cl
|
---|
850 | jae BMBCB_NoScrollUp
|
---|
851 | BMBCB_ScrollingUp:
|
---|
852 | dec byte ptr [Menu_UpperPart] ; Adjusted for Wasm
|
---|
853 | cmp dh, Menu_UpperPart
|
---|
854 | jb BMBCB_ScrollingUp
|
---|
855 | call BOOTMENU_RefreshPartitionText
|
---|
856 | jmp BMBCB_AfterScrolling
|
---|
857 |
|
---|
858 | BMBCB_NoScrollUp:
|
---|
859 | add cl, Menu_TotalLines
|
---|
860 | cmp dh, cl
|
---|
861 | jb BMBCB_AfterScrolling
|
---|
862 | BMBCB_ScrollingDown:
|
---|
863 | inc cl
|
---|
864 | inc byte ptr [Menu_UpperPart] ; Adjusted for Wasm
|
---|
865 | cmp dh, cl
|
---|
866 | jae BMBCB_ScrollingDown
|
---|
867 | call BOOTMENU_RefreshPartitionText
|
---|
868 |
|
---|
869 |
|
---|
870 |
|
---|
871 | ; SELECTION BAR
|
---|
872 | CLR_SELECTION_BAR_CLASSIC = 50h
|
---|
873 | CLR_SELECTION_BAR_BM = 90h
|
---|
874 | CLR_SELECTION_BAR_WARNING = 40h
|
---|
875 | CLR_SELECTION_BAR_TB = 60h
|
---|
876 | IFDEF TESTBUILD
|
---|
877 | CLR_SELECTION_BAR = CLR_SELECTION_BAR_TB
|
---|
878 | ELSE
|
---|
879 | CLR_SELECTION_BAR = CLR_SELECTION_BAR_BM
|
---|
880 | ENDIF
|
---|
881 |
|
---|
882 |
|
---|
883 | BMBCB_AfterScrolling:
|
---|
884 | mov cl, CLR_SELECTION_BAR
|
---|
885 | test byte ptr [TooManyPartitions],0ffh ; Check for too many partitions.
|
---|
886 | jz BOOTMENU_BuildChoiceBar_normal
|
---|
887 | mov cl, CLR_SELECTION_BAR_WARNING ; Set red bar if so.
|
---|
888 | BOOTMENU_BuildChoiceBar_normal:
|
---|
889 | call BOOTMENU_ReColorPart
|
---|
890 | ret
|
---|
891 | BOOTMENU_BuildChoiceBar EndP
|
---|
892 |
|
---|
893 | ; In: CL - Color, DL - Partition
|
---|
894 | ; Destroyed: None, but Locate-Pointer gets set
|
---|
895 | BOOTMENU_ReColorPart Proc Near Uses bx cx es di
|
---|
896 |
|
---|
897 | ; call SOUND_Beep
|
---|
898 |
|
---|
899 | mov bh, cl ; Color to BH
|
---|
900 | ; First calculate location of bar
|
---|
901 | cmp Menu_UpperPart, dl
|
---|
902 | ja BMRCP_NotInWindowView
|
---|
903 | mov ch, dl
|
---|
904 | sub ch, Menu_UpperPart ; CH - Position relative to UpperPart
|
---|
905 | cmp ch, 14 ; 14 - Maximum Total in Window
|
---|
906 | ja BMRCP_NotInWindowView
|
---|
907 | add ch, 5 ; Y-Position add-on fixed 5
|
---|
908 | mov cl, 2 ; X-Position is always 2
|
---|
909 | call VideoIO_Locate ; geht zu CX
|
---|
910 | call VideoIO_Internal_SetRegs
|
---|
911 | inc di ; DI - Destination+1 -> Color-Byte
|
---|
912 | mov cl, 78 ; Length of Bar is always 78
|
---|
913 | BMRCP_ClearLoop:
|
---|
914 | mov al, es:[di]
|
---|
915 | and al, 0Fh
|
---|
916 | or al, bh ; Adds background color (from BH)
|
---|
917 |
|
---|
918 | ;mov al,97h
|
---|
919 |
|
---|
920 | mov es:[di], al
|
---|
921 | add di, 2
|
---|
922 | dec cl
|
---|
923 | jnz BMRCP_ClearLoop
|
---|
924 | BMRCP_NotInWindowView:
|
---|
925 | ret
|
---|
926 | BOOTMENU_ReColorPart EndP
|
---|
927 |
|
---|
928 |
|
---|
929 | ; Calculate Menu-Variables for Boot-Menu, these use the filtered Part-Pointers
|
---|
930 | BOOTMENU_ResetMenuVars Proc Near Uses dx
|
---|
931 | xor dl, dl ; Partition at Pos 0 == 1st
|
---|
932 | mov Menu_UpperPart, dl
|
---|
933 |
|
---|
934 | ; = TIMED BOOTING =
|
---|
935 | mov dl, CFG_TimedBoot
|
---|
936 | mov TimedBootEnable, dl
|
---|
937 | mov al, CFG_TimedSecs
|
---|
938 | mov TimedSecondLeft, al
|
---|
939 | call TIMER_TranslateSecToTic
|
---|
940 | add ax, 16 ; So that the required ammount will
|
---|
941 | mov CFG_TimedDelay, ax ; be shown and not Timer-1.
|
---|
942 | call BOOTMENU_ResetTimedBoot
|
---|
943 | ; = FLOPPY-GET-NAME TIMER =
|
---|
944 | call BOOTMENU_ResetGetFloppy
|
---|
945 |
|
---|
946 | ; Resettet die Base-Variablen...
|
---|
947 | mov dl, PartitionPointerCount
|
---|
948 | mov Menu_TotalParts, dl
|
---|
949 |
|
---|
950 | ; Copy device-name to the ContBIOSbootSeq-IPT entry
|
---|
951 | ; Normally this does not need to get done here, but is done for safety
|
---|
952 | ; reasons if e.g. IPT got changed by SETUP, but that setup was discarded.
|
---|
953 | call PART_UpdateResumeBIOSName
|
---|
954 |
|
---|
955 | ; Default-Partition -> Filtered View -> Menu_EntryDefault
|
---|
956 | mov dl, CFG_PartDefault
|
---|
957 | call PART_ConvertFromStraight
|
---|
958 | mov Menu_EntryDefault, dl
|
---|
959 |
|
---|
960 | ; Last-Booted-Partition -> Filtered View -> Menu_EntryLast
|
---|
961 | mov dl, CFG_PartLast
|
---|
962 | call PART_ConvertFromStraight
|
---|
963 | mov Menu_EntryLast, dl
|
---|
964 |
|
---|
965 | ; Automatic-Partition -> Filtered View -> Menu_EntryAutomatic
|
---|
966 | mov dl, CFG_PartAutomatic
|
---|
967 | call PART_ConvertFromStraight
|
---|
968 | mov Menu_EntryAutomatic, dl
|
---|
969 |
|
---|
970 | ; restlichen Variablen berechnen...
|
---|
971 | mov dl, Menu_TotalParts
|
---|
972 | cmp byte ptr [Menu_TotalParts], 14
|
---|
973 | jbe BMRMV_NotMoreThan14
|
---|
974 | mov dl, 14
|
---|
975 | BMRMV_NotMoreThan14:
|
---|
976 | mov Menu_TotalLines, dl
|
---|
977 |
|
---|
978 | ; Now copy the name of the Timed-Booted Partition to TimedBoot-Field
|
---|
979 | mov dl, Menu_EntryDefault
|
---|
980 | test byte ptr [CFG_TimedBootLast], 1
|
---|
981 | jz BMRMV_TimedBootDefault
|
---|
982 | mov dl, Menu_EntryLast
|
---|
983 | BMRMV_TimedBootDefault:
|
---|
984 | call PART_GetPartitionPointer ; Hold SI for Partition DL
|
---|
985 | add si, LocIPT_Name
|
---|
986 | mov cx, 11
|
---|
987 | call GetLenOfName
|
---|
988 | mov di, offset TXT_TimedBootEntryName
|
---|
989 | jz BMRMV_NoName
|
---|
990 | rep movsb
|
---|
991 | BMRMV_NoName:
|
---|
992 | xor al, al
|
---|
993 | stosb ; Ending Zero
|
---|
994 | ret
|
---|
995 | BOOTMENU_ResetMenuVars EndP
|
---|
996 |
|
---|
997 | ; Will Set some Vars after user selected entry to boot...
|
---|
998 | ; ...don't select Straight View !
|
---|
999 | BOOTMENU_SetVarsAfterMenu Proc Near
|
---|
1000 | ; No Straight View in here...we got filtered view since BootMenu-Startup...
|
---|
1001 | mov al, CFG_RememberTimed
|
---|
1002 | test byte ptr [TimedBootUsed], 1
|
---|
1003 | jnz BMSVAM_TimedBootUsed
|
---|
1004 | mov al, CFG_RememberBoot
|
---|
1005 | BMSVAM_TimedBootUsed:
|
---|
1006 | or al, al
|
---|
1007 | jz BMSVAM_DontRememberBoot
|
---|
1008 | mov dl, Menu_EntrySelected
|
---|
1009 | call PART_ConvertToStraight ; CFG_PartLast is non-filtered
|
---|
1010 | ;~ mov di, offset CFG_LinuxLastKernel
|
---|
1011 | ;~ mov cx, 11
|
---|
1012 | cmp dl, 0FDh ; Dont Remember on Floppy/CD-ROM/etc.
|
---|
1013 | ja BMSVAM_DontRememberBoot
|
---|
1014 | ; je BMSVAM_RememberKernelBoot ; but remember Kernel-Bootings...
|
---|
1015 | mov CFG_PartLast, dl ; Remember partition in CFG_PartLast
|
---|
1016 | ;~ mov al, ' '
|
---|
1017 | ;~ rep stosb ; SPACE out CFG_LinuxLastKernel
|
---|
1018 | BMSVAM_DontRememberBoot:
|
---|
1019 | ret
|
---|
1020 |
|
---|
1021 | ;~ BMSVAM_RememberKernelBoot:
|
---|
1022 | ;~ mov dl, Menu_EntrySelected
|
---|
1023 | ;~ call PART_GetPartitionPointer ; SI - Pointer to Kernel Entry...
|
---|
1024 | ;~ add si, LocIPT_Name
|
---|
1025 | ;~ rep movsb ; Copy KernelName 2 CFG_LinuxLastKernel
|
---|
1026 | ;~ ret
|
---|
1027 | BOOTMENU_SetVarsAfterMenu EndP
|
---|
1028 |
|
---|
1029 |
|
---|
1030 |
|
---|
1031 |
|
---|
1032 | ; Actually does the Boot-Menu Interaction
|
---|
1033 | ; Sets Carry-flag, if Setup is to be entered, otherwise system shall get booted
|
---|
1034 | ; On boot: Fills out some variables (like Menu_EntrySelected), when Booting
|
---|
1035 | BOOTMENU_Execute Proc Near Uses es di
|
---|
1036 | ; Finds out, where to place the bar at first...
|
---|
1037 | mov dl, Menu_EntryDefault
|
---|
1038 | test byte ptr [CFG_RememberBoot], 1
|
---|
1039 | jnz BME_RememberMode
|
---|
1040 | test byte ptr [CFG_RememberTimed], 1
|
---|
1041 | jz BME_ForgetMode
|
---|
1042 | BME_RememberMode:
|
---|
1043 | mov dl, Menu_EntryLast
|
---|
1044 | BME_ForgetMode:
|
---|
1045 | ; Got it, so display bar...
|
---|
1046 | mov dh, dl
|
---|
1047 |
|
---|
1048 | ;~ call SOUND_Beep
|
---|
1049 |
|
---|
1050 | call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active
|
---|
1051 |
|
---|
1052 | ;~ call SOUND_Beep
|
---|
1053 |
|
---|
1054 | call SOUND_PreBootMenu
|
---|
1055 |
|
---|
1056 |
|
---|
1057 | BME_MainLoop:
|
---|
1058 |
|
---|
1059 | test byte ptr [TimedBootEnable], 1
|
---|
1060 | jz BME_NoTimedBoot
|
---|
1061 | ; ------------------------------------------------ TIMED BOOT
|
---|
1062 | push ax
|
---|
1063 | push dx
|
---|
1064 | call TIMER_GetTicCount
|
---|
1065 | mov dx, word ptr [TimedTimeOut]
|
---|
1066 | sub dx, ax
|
---|
1067 | mov ax, dx
|
---|
1068 | call TIMER_TranslateTicToSec ; DX - Timertics till ByeBye
|
---|
1069 | cmp al, TimedSecondLeft ; -> AL - Seconds till ByeBye
|
---|
1070 | je BME_NoFixSecond
|
---|
1071 | mov TimedSecondLeft, al
|
---|
1072 | call BOOTMENU_BuildTimedBootText ; Display Timed-Boot-Text
|
---|
1073 | BME_NoFixSecond:
|
---|
1074 | cmp al, 0
|
---|
1075 | jne BME_NoTimeOut
|
---|
1076 | pop dx
|
---|
1077 | pop ax
|
---|
1078 | mov dl, Menu_EntryDefault
|
---|
1079 | and byte ptr [CFG_TimedBootLast], 1
|
---|
1080 | jz BME_TimedBootDefault
|
---|
1081 | mov dl, Menu_EntryLast
|
---|
1082 | BME_TimedBootDefault:
|
---|
1083 | mov Menu_EntrySelected, dl ; Just boot default partition
|
---|
1084 | mov byte ptr [TimedBootUsed], 1 ; set flag...
|
---|
1085 | clc ; Boot-Now!
|
---|
1086 | ret
|
---|
1087 |
|
---|
1088 | BME_NoTimeOut:
|
---|
1089 | pop dx
|
---|
1090 | pop ax
|
---|
1091 | BME_NoTimedBoot:
|
---|
1092 | ; ------------------------------------------------ FLOPPY-NAME TIMER
|
---|
1093 | test byte ptr [CFG_FloppyBootGetTimer], 1
|
---|
1094 | jz BME_NoFloppyNameTimer
|
---|
1095 | ; Wait 2 Seconds everytime
|
---|
1096 | push ax
|
---|
1097 | push dx
|
---|
1098 | call TIMER_GetTicCount
|
---|
1099 | cmp dx, word ptr [FloppyGetNameTimer+2]
|
---|
1100 | ja BME_ExpiredGetFloppy
|
---|
1101 | cmp ax, word ptr [FloppyGetNameTimer+0]
|
---|
1102 | jb BME_NoFloppyNameExpired
|
---|
1103 | BME_ExpiredGetFloppy:
|
---|
1104 | call BOOTMENU_ResetGetFloppy
|
---|
1105 | pop dx
|
---|
1106 | pop ax
|
---|
1107 | jmp BME_RefreshFloppyName
|
---|
1108 | BME_NoFloppyNameExpired:
|
---|
1109 | pop dx
|
---|
1110 | pop ax
|
---|
1111 | BME_NoFloppyNameTimer:
|
---|
1112 | ; ------------------------------------------------ KEYBOARD
|
---|
1113 | push dx
|
---|
1114 | mov ah, 1
|
---|
1115 | int 16h
|
---|
1116 | pop dx
|
---|
1117 | jnz BME_KeyAvailable
|
---|
1118 | jmp BME_MainLoop
|
---|
1119 |
|
---|
1120 | BME_RefreshFloppyName:
|
---|
1121 | test byte ptr [CFG_IncludeFloppy], 1
|
---|
1122 | jz BME_NoRefreshFloppyName
|
---|
1123 | test byte ptr [CFG_FloppyBootGetName], 1
|
---|
1124 | jz BME_NoRefreshFloppyName
|
---|
1125 | call DriveIO_UpdateFloppyName
|
---|
1126 | call BOOTMENU_RefreshPartitionText
|
---|
1127 | call BOOTMENU_BuildChoiceBar ; Redisplay the selection-bar
|
---|
1128 | BME_NoRefreshFloppyName:
|
---|
1129 | jmp BME_MainLoop
|
---|
1130 |
|
---|
1131 | BME_KeyAvailable:
|
---|
1132 | push dx
|
---|
1133 | mov ah, 0
|
---|
1134 | int 16h
|
---|
1135 | pop dx
|
---|
1136 |
|
---|
1137 | ;!
|
---|
1138 | ;! DEBUG_BLOCK
|
---|
1139 | ;! Handle keys to activate debugging routines.
|
---|
1140 | ;!
|
---|
1141 | IFDEF AUX_DEBUG
|
---|
1142 | call DEBUG_HandleKeypress
|
---|
1143 | ENDIF
|
---|
1144 |
|
---|
1145 | cmp ah, Keys_ENTER
|
---|
1146 | je BME_KeyEnter
|
---|
1147 | cmp ah, Keys_F10
|
---|
1148 | je BME_KeyF10
|
---|
1149 | cmp ah, Keys_Delete
|
---|
1150 | je BME_KeyDelete
|
---|
1151 | cmp ah, Keys_ESC
|
---|
1152 | je BME_KeyESC
|
---|
1153 | ; Upper Keys do not fall under Timed Boot Key Handling
|
---|
1154 | test byte ptr [TimedBootEnable], 1
|
---|
1155 | je BME_NoTimedKeyHandling
|
---|
1156 | cmp byte ptr [CFG_TimedKeyHandling], 1
|
---|
1157 | jb BME_NoTimedKeyHandling ; = 0
|
---|
1158 | je BME_ResetTimedBoot ; = 1
|
---|
1159 | mov al, TimedBootEnable ; = 2
|
---|
1160 | xor al, 1 ; Flip Flop Switch :]
|
---|
1161 | mov [TimedBootEnable], al
|
---|
1162 | BME_ResetTimedBoot:
|
---|
1163 | push dx
|
---|
1164 | call BOOTMENU_ResetTimedBoot ; Reset Timer
|
---|
1165 | call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
|
---|
1166 | pop dx
|
---|
1167 | BME_NoTimedKeyHandling:
|
---|
1168 | cmp ah, Keys_TAB
|
---|
1169 | je BME_KeyTAB
|
---|
1170 | cmp ah, Keys_Up
|
---|
1171 | je BME_KeyUp
|
---|
1172 | cmp ah, Keys_Down
|
---|
1173 | je BME_KeyDown
|
---|
1174 | jmp BME_MainLoop
|
---|
1175 |
|
---|
1176 | BME_KeyUp:
|
---|
1177 | dec dh
|
---|
1178 | call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active
|
---|
1179 | jmp BME_MainLoop
|
---|
1180 |
|
---|
1181 | BME_KeyDown:
|
---|
1182 | inc dh
|
---|
1183 | call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active
|
---|
1184 | jmp BME_MainLoop
|
---|
1185 |
|
---|
1186 | BME_KeyEnter:
|
---|
1187 | mov Menu_EntrySelected, dl
|
---|
1188 | mov byte ptr [TimedBootUsed], 0 ; reset flag...
|
---|
1189 | clc ; Boot-Now!
|
---|
1190 | ret
|
---|
1191 |
|
---|
1192 | BME_KeyF10:
|
---|
1193 | mov al, Keys_Flags_EnterSetup
|
---|
1194 | mov byte ptr [SETUP_KeysOnEntry], al ; Simulate user wants to enter setup
|
---|
1195 | stc ; Go Re-Enter Setup
|
---|
1196 | ret
|
---|
1197 |
|
---|
1198 | BME_KeyDelete:
|
---|
1199 | call SOUND_ExecuteBoot
|
---|
1200 | call APM_TurnOffComputer
|
---|
1201 | jmp BME_MainLoop
|
---|
1202 |
|
---|
1203 | BME_KeyESC:
|
---|
1204 | mov al, [TimedBootEnable]
|
---|
1205 | xor al, 1 ; Flip Flop Switch :]
|
---|
1206 | mov [TimedBootEnable], al
|
---|
1207 | push dx
|
---|
1208 | call BOOTMENU_ResetTimedBoot ; Reset Timer
|
---|
1209 | call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
|
---|
1210 | pop dx
|
---|
1211 | jmp BME_MainLoop
|
---|
1212 |
|
---|
1213 | BME_KeyTAB:
|
---|
1214 | push dx
|
---|
1215 |
|
---|
1216 | ; While the FX-module is excluded from newer versions, we want to retain
|
---|
1217 | ; the option of enabling it.
|
---|
1218 | IFDEF FX_ENABLED
|
---|
1219 | test byte ptr [CFG_CooperBars], 1
|
---|
1220 | jnz BME_KeyTAB_ShowFX
|
---|
1221 | ENDIF
|
---|
1222 |
|
---|
1223 | mov ax, 0501h ; Go To Page 1 -> BIOS POST crap
|
---|
1224 | int 10h
|
---|
1225 | mov ah, 0
|
---|
1226 | int 16h ; Wait for any key
|
---|
1227 | call BOOTMENU_ResetTimedBoot ; Reset Timer
|
---|
1228 | call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
|
---|
1229 | mov ax, 0500h ; Go Back to Page 0
|
---|
1230 | int 10h
|
---|
1231 | pop dx
|
---|
1232 | jmp BME_MainLoop
|
---|
1233 | BME_KeyTAB_ShowFX:
|
---|
1234 | pusha
|
---|
1235 | mov ax, VideoIO_Page1
|
---|
1236 | mov bx, VideoIO_Page0
|
---|
1237 | mov dx, 160
|
---|
1238 | xor di, di
|
---|
1239 |
|
---|
1240 | IFDEF FX_ENABLED
|
---|
1241 | call FX_InterleaveCopy
|
---|
1242 | call FX_ScrollScreenLeft
|
---|
1243 | ENDIF
|
---|
1244 |
|
---|
1245 | mov ah, 0
|
---|
1246 | int 16h ; Wait for any key
|
---|
1247 | call BOOTMENU_ResetTimedBoot ; Reset Timer
|
---|
1248 | call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
|
---|
1249 |
|
---|
1250 | IFDEF FX_ENABLED
|
---|
1251 | call FX_ScrollScreenRight
|
---|
1252 | call FX_EndScreenInternalCleanUp
|
---|
1253 | ENDIF
|
---|
1254 |
|
---|
1255 | call BOOTMENU_ResetTimedBoot ; Reset Timer again...
|
---|
1256 | popa
|
---|
1257 | pop dx
|
---|
1258 | jmp BME_MainLoop
|
---|
1259 | BOOTMENU_Execute EndP
|
---|
1260 |
|
---|
1261 | ; Resettet den TimedBoot Timer...
|
---|
1262 | BOOTMENU_ResetTimedBoot Proc Near Uses ax
|
---|
1263 | call TIMER_GetTicCount
|
---|
1264 | add ax, CFG_TimedDelay
|
---|
1265 | adc dx, 0
|
---|
1266 | mov word ptr [TimedTimeOut], ax
|
---|
1267 | mov word ptr [TimedTimeOut+2], dx
|
---|
1268 | ret
|
---|
1269 | BOOTMENU_ResetTimedBoot EndP
|
---|
1270 |
|
---|
1271 | ; Resettet den Floppy-Get-Name Timer...
|
---|
1272 | BOOTMENU_ResetGetFloppy Proc Near Uses ax
|
---|
1273 | call TIMER_GetTicCount
|
---|
1274 | add ax, 36 ; 18*2 -> 2 seconds
|
---|
1275 | adc dx, 0
|
---|
1276 | mov word ptr [FloppyGetNameTimer], ax
|
---|
1277 | mov word ptr [FloppyGetNameTimer+2], dx
|
---|
1278 | ret
|
---|
1279 | BOOTMENU_ResetGetFloppy EndP
|
---|