source: trunk/bootcode/setup/main.asm@ 164

Last change on this file since 164 was 162, checked in by Ben Rietbroek, 8 years ago

Removed some ancient debugging stuff [v1.1.1-testing]

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

File size: 47.3 KB
Line 
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 SETUP / GENERIC & GENERAL SETUP ROUTINES
20;---------------------------------------------------------------------------
21
22IFDEF MODULE_NAMES
23DB 'MAIN',0
24ENDIF
25
26;~ LocMENU_RoutinePtr equ 0
27;~ LocMENU_VariablePtr equ 2
28;~ LocMENU_ItemNamePtr equ 4
29;~ LocMENU_ItemHelpPtr equ 6
30;~ LocMENU_ItemPack equ 8 ; only if VariablePtr>0
31
32SETUP_UpperFixString db 'SETUP ',0 ; AddOn for "AiR-BOOT SETUP vX.XX"
33
34include setup/menus.asm ; Menu structures
35include setup/part_set.asm ; Partition Setup (in extra file)
36
37; CH - Current Item Number
38; Out: SI - Pointer to Item Location
39; Destroyed: None
40SETUP_SwitchToSelectedItem Proc Near Uses ax cx
41 cmp ch, 7
42 jne SSTSI_ValidSize
43 stc ; Invalid Item
44 ret
45 SSTSI_ValidSize:
46 test ch, 1000b
47 jz SSTSI_NoRightSide
48 and ch, 111b
49 add ch, 7 ; fix Item-number to Real-Location
50 SSTSI_NoRightSide:
51 inc ch ; So we will get a zero at the JZ
52 mov si, bp
53 add si, 3 ; Skip FrontHeader for Menu
54 SSTSI_Loop:
55 dec ch
56 jz SSTSI_LoopEnd
57
58 mov ax, word ptr ds:[si+LocMENU_VariablePtr]
59 or ax, ax
60 jz SSTSI_NoItemPack
61 add si, LocMENU_LenOfItemPack ; Add ItemPack size
62 SSTSI_NoItemPack:
63 add si, LocMENU_LenOfMenuPtrBlock ; Skip Ptr-Block (+3 deshalb, weil danach INC!)
64 jmp SSTSI_Loop
65
66 SSTSI_LoopEnd:
67 clc
68 ret ; Exit is here :)
69SETUP_SwitchToSelectedItem EndP
70
71SETUP_CheckEnterSETUP Proc Near
72
73 ; Rousseau: added
74 ;mov SETUP_ExitEvent, 0
75 ;xor al, al ; -PARTITION SETUP PreDefines-
76 ;mov PartSetup_UpperPart, al ; Upper-Partition == 0
77 ;mov PartSetup_ActivePart, al ; Active-Partition == 0
78
79 ; Setup PartitionPointers-Table...again (needed when re-entering setup)
80 ;call PART_CalculateStraightPartPointers
81 ; Rousseau: end added
82
83 test byte ptr [CFG_AutoEnterSetup], 1
84 jnz SCES_ForceEnter
85 mov al, [SETUP_KeysOnEntry]
86 test al, Keys_Flags_EnterSetup
87 jz SCES_NoEnterSETUP
88 SCES_ForceEnter:
89 call SETUP_Main
90 SCES_NoEnterSETUP:
91 ret
92SETUP_CheckEnterSETUP EndP
93
94SETUP_Main Proc Near Uses si es bp
95 mov byte ptr [SETUP_ExitEvent], 0
96 xor al, al ; -PARTITION SETUP PreDefines-
97 mov [PartSetup_UpperPart], al ; Upper-Partition == 0
98 mov [PartSetup_ActivePart], al ; Active-Partition == 0
99
100 ; Setup PartitionPointers-Table...again (needed when re-entering setup)
101 call PART_CalculateStraightPartPointers
102
103 IFDEF FX_ENABLED
104 call FX_StartScreen ; Start of new screen...
105 ENDIF
106
107 call SETUP_DrawMenuBase
108 mov bp, offset SETUP_MainMenu
109 call SETUP_MenuTask ; calls Menu!
110 ret
111SETUP_Main EndP
112
113; In: BP - Pointer to Menu
114; CurMenu: Left Side 0-6, Right Side 8-14 (Bit 3!)
115SETUP_MenuTask Proc Near ; the main-menu routine
116 cmp byte ptr [SETUP_ExitEvent], 1
117 jne SMT_NoImmediateExit
118 ret
119
120 SMT_NoImmediateExit:
121 call SETUP_FillUpItemPacks
122 call SETUP_DrawMenuOnScreen
123 mov si, ds:[bp+1] ; Ptr to Help-Text
124 call SETUP_DrawMenuHelp
125
126 mov ax, ds:[bp+1] ; Help Pointer
127 cmp ax, offset TXT_SETUPHELP_Main ; ask only in main-menu...
128 jne SMT_NotMainMenu
129
130 IFDEF FX_ENABLED
131 call FX_EndScreenLeft ; Do FX, if requested...
132 ENDIF
133
134 test byte ptr [CFG_PasswordSetup], 1
135 jz SMT_NotMainMenu
136 mov ax, 0ABABh
137 mov si, offset TXT_ProtectedSetup ; why bother again ?
138 mov di, offset CFG_MasterPassword ; Only Access Using MASTER Pwd
139 call PASSWORD_AskSpecifiedPassword
140 SMT_NotMainMenu:
141
142 mov dl, dh
143 SMT_KeyBored:
144 ; Keyboard-Process Loop
145 push dx
146 mov ah, 0
147 int 16h
148 pop dx
149
150;!
151;! DEBUG_PROBE
152;!
153IFDEF AUX_DEBUGx
154 push 1234h
155 call DEBUG_Probe
156 call DEBUG_DumpIPT
157 call DEBUG_DumpRegisters
158ENDIF
159
160
161
162 cmp ah, Keys_Up
163 je SMT_KeyUp
164 cmp ah, Keys_Down
165 je SMT_KeyDown
166 cmp ah, Keys_Left
167 je SMT_KeyLeftRight
168 cmp ah, Keys_Right
169 je SMT_KeyLeftRight
170 cmp ah, Keys_ENTER
171 je SMT_KeyENTER
172 cmp ah, Keys_Plus
173 je SMT_KeyPlus
174 cmp ah, Keys_Minus
175 je SMT_KeyMinus
176 cmp ah, Keys_GrayPlus
177 je SMT_KeyPlus
178 cmp ah, Keys_GrayMinus
179 je SMT_KeyMinus
180 cmp ah, Keys_PageDown
181 je SMT_KeyPlus
182 cmp ah, Keys_PageUp
183 je SMT_KeyMinus
184 cmp ah, Keys_ESC
185 je SMT_KeyEsc
186 cmp ah, Keys_F1
187 jne skip_xx
188 jmp SMT_KeyHelp
189 skip_xx:
190 cmp ah, Keys_F10
191 jne skip_yy
192 jmp SMT_SaveAndExitNOW
193 skip_yy:
194 ; ASCII values...
195 cmp al, Keys_Space
196 je SMT_KeyPlus
197 jmp SMT_KeyBored
198
199 SMT_KeyUp:
200 dec dh ; Current Item -1
201 mov bx, offset SMT_KeyUp
202 jmp SMT_FixUpModify
203
204 SMT_KeyDown:
205 inc dh ; Current Item +1
206 mov bx, offset SMT_KeyDown
207 jmp SMT_FixUpModify
208
209 SMT_KeyLeftRight:
210 xor dh, 1000b ; Little Trick Flip-Flop Left/Right
211 mov bx, offset SMT_KeyLeftRight
212 jmp SMT_FixUpModify
213
214 SMT_KeyENTER: ; Enters Menu, if no ItemPack available
215 mov ch, dh
216 call SETUP_SwitchToSelectedItem ; Calculates SI for Item-No (CH)
217 mov ax, ds:[si+LocMENU_RoutinePtr]
218 mov bx, ds:[si+LocMENU_VariablePtr]
219 or bx, bx ; VarPtr ?
220 jnz SMT_DoNotExecute
221 SMT_DirectExecute:
222 mov ds:[bp+0], dh ; Saves current menu
223 call ax ; Call to CodePtr
224 call SETUP_DrawMenuOnScreen ; Redraw after return
225 cmp byte ptr [SETUP_ExitEvent], 1
226 je SMT_ExitEvent
227 SMT_DoNotExecute:
228 jmp SMT_KeyBored
229
230 SMT_ExitEvent:
231 ret ; just return, to easy uh ?
232
233 SMT_KeyPlus: ; Changes ItemPack
234 mov cl, 1
235 jmp SMT_KeyChangeEvent
236 SMT_KeyMinus:
237 xor cl, cl
238 SMT_KeyChangeEvent:
239 mov ch, dh
240 call SETUP_SwitchToSelectedItem ; Calculates SI for Item-No (CH)
241 mov ax, ds:[si+LocMENU_RoutinePtr]
242 mov bx, ds:[si+LocMENU_VariablePtr]
243 or bx, bx ; VarPtr ? =0 No ItemPack
244 jnz SMT_DoItemPack
245 jmp SMT_KeyBored
246 SMT_DoItemPack:
247 clc ; Modify this Item !
248 call ax ; Call to Item-Code-Ptr
249 jmp SMT_OkayReDisplay
250
251 SMT_KeyEsc:
252 mov ax, ds:[bp+1] ; Help Pointer
253 cmp ax, offset TXT_SETUPHELP_Main ; embarassing? ;-)
254 jne SMT_ReturnPrev
255 jmp SMT_ExitWithoutSaving
256 SMT_ReturnPrev:
257 mov ds:[bp+0], dh ; Saves current menu
258 ret ; just return to go to prev menu...
259
260 SMT_FixUpModify:
261 cmp dh, 0FFh ; = 255 ?
262 jne SMT_NoAdjustMin
263 mov dh, 14 ; Overflow -> 14!
264 SMT_NoAdjustMin:
265 cmp dh, 14 ; bigger as 14 ?
266 jbe SMT_NoAdjustMax
267 xor dh, dh ; Reset to 0
268 SMT_NoAdjustMax:
269 mov ch, dh
270 call SETUP_SwitchToSelectedItem ; Calculates SI for Item-No (CH)
271 jnc SMT_ValidItem
272 jmp bx
273 SMT_ValidItem:
274 mov ax, word ptr ds:[si]
275 or ax, ax
276 jnz SMT_OkayReDisplay
277 jmp bx ; Do it again... :)
278 SMT_OkayReDisplay:
279 call SETUP_DrawDeSelectItem
280 call SETUP_DrawSelectItem
281 mov dl, dh
282 jmp SMT_KeyBored
283
284 SMT_KeyHelp: ; Shows help for selected Item...
285 mov ch, dh
286 call SETUP_SwitchToSelectedItem ; Calculates SI for Item-No (CH)
287 mov bx, ds:[si+LocMENU_ItemHelpPtr]
288 or bx, bx ; Help-Ptr available ?
289 jz SMT_NoHelpAvailable
290 call SETUP_ShowHelp ; Shows help...
291 SMT_NoHelpAvailable:
292 jmp SMT_KeyBored
293
294 SMT_SaveAndExitNOW: ; Direct HackIn
295
296;!
297;! DEBUG_PROBE
298;!
299IFDEF AUX_DEBUGx
300 push 1235h
301 call DEBUG_Probe
302ENDIF
303
304 mov ax, offset SETUP_EnterMenu_SaveAndExitSetup
305 jmp SMT_DirectExecute
306
307 SMT_ExitWithoutSaving: ; Direct HackIn
308;!
309;! DEBUG_PROBE
310;!
311IFDEF AUX_DEBUGx
312 push 1236h
313 call DEBUG_Probe
314ENDIF
315
316 mov ax, offset SETUP_EnterMenu_ExitWithoutSaving
317 jmp SMT_DirectExecute
318SETUP_MenuTask EndP
319
320
321; Initial bg-colors on setup-items -- revert to item-bg when cursor moved
322CLR_MENU_WINDOW_CLASSIC = 0e01h
323CLR_MENU_WINDOW_BM = 0e01h
324CLR_MENU_WINDOW_TB = 0e08h
325IFDEF TESTBUILD
326CLR_MENU_WINDOW = CLR_MENU_WINDOW_TB
327ELSE
328CLR_MENU_WINDOW = CLR_MENU_WINDOW_BM
329ENDIF
330
331; In: BP - Pointer to Menu
332; Out: DH - Active Item on Screen
333SETUP_DrawMenuOnScreen Proc Near
334 call SETUP_DrawMenuWindow
335 mov cx, CLR_MENU_WINDOW
336 call VideoIO_Color
337 xor ch, ch
338 SDMOS_Loop:
339 call SETUP_DrawItemOnScreen
340 inc ch ; Total of 14 items to display
341 cmp ch, 14
342 jbe SDMOS_Loop
343 mov dh, ds:[bp+0]
344 mov dl, dh ; Active = Last
345 call SETUP_DrawSelectItem ; Marks active Item
346 mov si, ds:[bp+1] ; Ptr to Item-Help-Text
347 call SETUP_DrawMenuHelp
348 ret
349SETUP_DrawMenuOnScreen EndP
350
351SETUP_FillUpItemPacks Proc Near Uses cx
352 xor ch, ch
353 SFUIP_Loop:
354 call SETUP_FillUpItemPack_Now
355 inc ch ; Total of 14 items to display
356 cmp ch, 14
357 jbe SFUIP_Loop
358 ret
359SETUP_FillUpItemPacks EndP
360
361
362CLR_SELECTED_ITEM_CLASSIC = 0f04h
363CLR_SELECTED_ITEM_BM = 0f04h
364CLR_SELECTED_ITEM_TB = 0f04h
365IFDEF TESTBUILD
366CLR_SELECTED_ITEM = CLR_SELECTED_ITEM_TB
367ELSE
368CLR_SELECTED_ITEM = CLR_SELECTED_ITEM_BM
369ENDIF
370
371; Displays selected Item on screen
372; In: DH - Active Item
373; Destroyed: None
374SETUP_DrawSelectItem Proc Near Uses cx
375 mov cx, CLR_SELECTED_ITEM
376 call VideoIO_Color
377 mov ch, dh
378 call SETUP_DrawItemOnScreen
379 ret
380SETUP_DrawSelectItem EndP
381
382
383CLR_DESELECTED_ITEM_CLASSIC = 0e01h
384CLR_DESELECTED_ITEM_BM = 0e01h
385CLR_DESELECTED_ITEM_TB = 0e08h
386IFDEF TESTBUILD
387CLR_DESELECTED_ITEM = CLR_DESELECTED_ITEM_TB
388ELSE
389CLR_DESELECTED_ITEM = CLR_DESELECTED_ITEM_BM
390ENDIF
391
392; Display last-selected Item on screen (De-Select)
393; In: DL - Active Item
394; Destroyed: None
395SETUP_DrawDeSelectItem Proc Near Uses cx
396 mov cx, CLR_DESELECTED_ITEM
397 call VideoIO_Color
398 mov ch, dl
399 call SETUP_DrawItemOnScreen
400 ret
401SETUP_DrawDeSelectItem EndP
402
403; Actually displays Item on screen, Out of bounce checking included
404; In: CH - CurItemNo
405; Destroyed: None
406SETUP_DrawItemOnScreen Proc Near Uses ax cx dx si es
407 call SETUP_SwitchToSelectedItem ; Calculates SI for Item-No (CH)
408 jnc SDIOS_ValidItem
409 ret ; Ignore all Invalid Items
410
411 SDIOS_ValidItem:
412 mov dx, word ptr TextColorFore ; BackUps TextColor for later
413 mov cl, 3 ; Left side: 3
414 test ch, 1000b
415 jz SDIOS_NoRightSide
416 and ch, 111b
417 mov cl, 42 ; Right side: 42
418 SDIOS_NoRightSide:
419 mov ax, ds:[si+LocMENU_VariablePtr] ; if available, we got ItemPack
420 or ax, ax
421 jnz SDIOS_ItemPackDraw
422 ; ------------------------------------------------------ Draw NAME
423 mov ax, ds:[si+LocMENU_RoutinePtr] ; no Item-Code-Ptr? -> no name
424 or ax, ax
425 jnz SDIOS_Name_CodePtrAvailable
426 mov TextColorFore, 0Fh ; display in white letters
427 sub cl, 2 ; not optimized, i know :]
428 SDIOS_Name_CodePtrAvailable:
429 add cl, 2 ; Fix X-coordinate (for name)
430 add ch, 6 ; Fix Y-coordinate
431 cmp cl, 40
432 jb SDIOS_Name_NoFixUpName
433 inc cl
434 SDIOS_Name_NoFixUpName:
435 call VideoIO_Locate
436 mov si, ds:[si+LocMENU_ItemNamePtr] ; SI - Name of Item
437 or si, si
438 jz SDIOS_Name_NoItemName
439 call VideoIO_Print ; ...and print it.
440 SDIOS_Name_NoItemName:
441 mov word ptr [TextColorFore], dx
442 ret
443
444 ; ------------------------------------------------------ Draw ITEMPACK
445 SDIOS_ItemPackDraw:
446 add ch, 6 ; Fix coordinate...
447 ; Display the Name and a double-point first
448 ; BackUp Coordinates and ItemPackPtr
449 push cx
450 push si
451 push cx
452 cmp cl, 40
453 jb SDIOS_ItemPack_NoFixUpItemPack
454 inc cl
455 SDIOS_ItemPack_NoFixUpItemPack:
456 call VideoIO_Locate
457
458
459CLR_ITEM_PACK_CLASSIC = 0f01h
460CLR_ITEM_PACK_BM = 0f01h
461CLR_ITEM_PACK_TB = 0f08h
462IFDEF TESTBUILD
463CLR_ITEM_PACK = CLR_ITEM_PACK_TB
464ELSE
465CLR_ITEM_PACK = CLR_ITEM_PACK_BM
466ENDIF
467
468 mov cx, CLR_ITEM_PACK
469 call VideoIO_Color ; White on blue background
470 mov si, ds:[si+LocMENU_ItemNamePtr] ; SI - Name of Item
471 or si, si
472 jz SDIOS_ItemPack_NoItemName
473 call VideoIO_Print
474 SDIOS_ItemPack_NoItemName:
475 pop cx
476 add cl, 24
477 call VideoIO_Locate
478 mov al, 3Ah
479 call VideoIO_PrintSingleChar ; Write double-point
480 mov word ptr TextColorFore, dx
481 pop si
482 pop cx
483 add cl, 26 ; Fix X-coordinate (for ItemPack)
484 call VideoIO_Locate
485
486 add si, LocMENU_ItemPack ; Where ItemPack is located...
487 ; Filler berechnen
488 SDIOS_ItemPack_RetryGetLen:
489 mov cx, 11
490 call GetLenOfName
491 cmp cx, 11
492 je SDIOS_ItemPack_NoFiller
493 mov al, cl
494 mov cl, 11
495 sub cl, al
496 mov al, 20h ; Fill up with spaces
497 call VideoIO_Internal_MakeWinRight ; and write...
498 SDIOS_ItemPack_NoFiller:
499 call VideoIO_PrintLikeLenOfName ; Write ItemPack
500 ret
501SETUP_DrawItemOnScreen EndP
502
503SETUP_FillUpItemPack_Now Proc Near Uses ax bx si
504 call SETUP_SwitchToSelectedItem ; Calculates SI for Item-No (CH)
505 jnc SFUIPN_ValidItem
506 SFUIPN_Ignore:
507 ret ; Ignore all Invalid Items
508
509 SFUIPN_ValidItem:
510 mov bx, ds:[si+LocMENU_VariablePtr]
511 or bx, bx
512 jz SFUIPN_Ignore
513 mov ax, ds:[si+LocMENU_RoutinePtr]
514 mov cl, 1 ; Add, if anything fails
515 stc ; Just FillUp Call
516 call ax ; CH-ItemNo, CL-Add/Sub, BX-PtrToVar
517 ret
518SETUP_FillUpItemPack_Now EndP
519
520CLR_SETUP_WINDOW_CLASSIC = 0f01h
521CLR_SETUP_WINDOW_BM = 0901h
522CLR_SETUP_WINDOW_TB = 0908h
523IFDEF TESTBUILD
524CLR_SETUP_WINDOW = CLR_SETUP_WINDOW_TB
525ELSE
526CLR_SETUP_WINDOW = CLR_SETUP_WINDOW_BM
527ENDIF
528
529SETUP_DrawMenuWindow Proc Near Uses es
530 mov cx, CLR_SETUP_WINDOW
531 call VideoIO_Color
532 mov bx, 0401h
533 mov dx, 0E50h
534 call VideoIO_MakeWindow
535 mov bx, 0E01h
536 mov dx, 1150h
537 call VideoIO_MakeWindow
538 mov cx, 0529h
539 call VideoIO_Locate
540 mov al, TextChar_WinLineDown
541 mov cl, 12
542 call VideoIO_Internal_MakeWinDown
543 ; the little fixups for better looking windows...
544 mov cx, 0429h
545 call VideoIO_Locate
546 mov al, TextChar_WinRep1
547 call VideoIO_PrintSingleChar
548 mov cx, 0E29h
549 call VideoIO_Locate
550 mov al, TextChar_WinRep6
551 call VideoIO_PrintSingleChar
552 mov cx, 1129h
553 call VideoIO_Locate
554 mov al, TextChar_WinRep3
555 call VideoIO_PrintSingleChar
556 mov cx, 0E01h
557 call VideoIO_Locate
558 mov al, TextChar_WinRep5
559 call VideoIO_PrintSingleChar
560 mov cx, 0E50h
561 call VideoIO_Locate
562 mov al, TextChar_WinRep4
563 call VideoIO_PrintSingleChar
564 ret
565SETUP_DrawMenuWindow EndP
566
567SETUP_DrawMenuBase Proc Near
568 call BOOTMENU_BuildBackground
569 ; -------------------------------------------- Upper Copyright...
570 mov cx, 0F00h
571 call VideoIO_Color
572 mov cx, 011Eh
573 call VideoIO_Locate
574 mov si, offset Copyright
575 inc si
576 mov cl, 9
577 call VideoIO_FixedPrint ; Put 'AiR-BOOT' to 1st line...
578 push si
579 mov si, offset SETUP_UpperFixString
580 call VideoIO_Print ; and 'SETUP'...
581 pop si
582 mov cl, CopyrightVersionLen
583 call VideoIO_FixedPrint ; and 'vX.XX'.
584
585 ; Rousseau:
586 ; Strange, had to adjust this value.
587 ; Somewhere some offset changed...
588 ; Possibly happened with the movzx change to 286 instructions because some
589 ; offsets are hard coded.
590 ;add si, 3
591 add si, 2
592
593 call GetLenOfString ; CX - Len of "Copyright" string
594 mov dx, cx
595 mov cx, 0228h
596 call VideoIO_LocateToCenter ; LocateToCenter 2, 40 using TotalLen
597 call VideoIO_Print ; 'Copyright' to 2nd line...
598
599 mov si, offset TXT_TranslationBy
600 call GetLenOfString ; CX - Len of "Translated by" string
601 mov dx, cx
602 mov cx, 0328h
603 call VideoIO_LocateToCenter ; LocateToCenter 3, 40 using TotalLen
604 call VideoIO_Print ; 'Translated By' as well...
605 ; -------------------------------------------- Lower 1st Line
606 mov si, offset TXT_SETUP_LowerMessage
607 mov cl, 2
608 call GetLenOfStrings ; CX - Len of 5 Strings at [si]
609 mov dx, cx
610 mov cx, 1329h
611 call VideoIO_LocateToCenter ; LocateToCenter 21, 40 using TotalLen
612 call VideoIO_Print ; Begin using WHITE again...
613 mov cx, 0C00h
614 call VideoIO_Color
615 call VideoIO_Print ; contine red - 'GPLv3+'
616 ; -------------------------------------------- Lower 2nd Line
617 mov cl, 1
618 call GetLenOfStrings ; CX - Len of 3 Strings at [si]
619 mov dx, cx
620 mov cx, 1429h
621 call VideoIO_LocateToCenter ; LocateToCenter 19, 40 using TotalLen
622 mov cx, 0F00h
623 call VideoIO_Color ; White...
624 call VideoIO_Print ; Begin using WHITE...
625 ; -------------------------------------------- Lower 3rd Line
626 mov cl, 1
627 call GetLenOfString ; CX - Len of String at [si]
628 mov dx, cx
629 mov cx, 1629h
630 call VideoIO_LocateToCenter ; LocateToCenter 22, 40 using TotalLen
631 mov cx, 0F00h
632 call VideoIO_Color ; White...
633 call VideoIO_Print ; For more information...
634 ; -------------------------------------------- Lower 4th Line
635 mov cl, 1
636 call GetLenOfStrings ; CX - Len of 5 Strings at [si]
637 mov dx, cx
638 mov cx, 1729h
639 call VideoIO_LocateToCenter ; LocateToCenter 24, 40 using TotalLen
640 mov cx, 0B00h
641 call VideoIO_Color
642 call VideoIO_Print ; homepage
643 ; -------------------------------------------- Lower 5th Line
644 mov cl, 2
645 call GetLenOfStrings ; CX - Len of 4 Strings at [si]
646 mov dx, cx
647 mov cx, 1929h
648 call VideoIO_LocateToCenter ; LocateToCenter 25, 40 using TotalLen
649 mov cx, 0700h
650 call VideoIO_Color
651 call VideoIO_Print ; white - 'contact via e-mail'...
652 mov cx, 0700h
653 call VideoIO_Color
654 call VideoIO_Print ; and finally the e-mail adress
655 ret
656SETUP_DrawMenuBase EndP
657
658
659; F10-SETUP Help Directions
660CLR_SETUP_HELP_CLASSIC = 0f01h
661CLR_SETUP_HELP_BM = 0f01h
662CLR_SETUP_HELP_TB = 0f08h
663IFDEF TESTBUILD
664CLR_SETUP_HELP = CLR_SETUP_HELP_TB
665ELSE
666CLR_SETUP_HELP = CLR_SETUP_HELP_BM
667ENDIF
668
669; Display the Help Menu
670; In: SI - Pointer to 4 HelpStrings...
671; Destroyed: None
672SETUP_DrawMenuHelp Proc Near Uses cx si
673 mov cx, CLR_SETUP_HELP
674 call VideoIO_Color
675 mov cx, 0F05h
676 call VideoIO_Locate
677 call VideoIO_Print
678 mov cx, 1005h
679 call VideoIO_Locate
680 call VideoIO_Print
681 mov cx, 0F2Dh
682 call VideoIO_Locate
683 call VideoIO_Print
684 mov cx, 102Dh
685 call VideoIO_Locate
686 call VideoIO_Print
687 ret
688SETUP_DrawMenuHelp EndP
689
690; In: bx - HelpPtr
691; Destroyed: None
692SETUP_ShowHelp Proc Near Uses cx dx ds si es di bp
693 mov ax, VideoIO_Page2
694 call VideoIO_BackUpTo
695
696 push bx ; Push HelpPtr
697 mov cx, 0B03h
698 call VideoIO_Color
699 mov bx, 0F33h
700 mov dx, 174Eh
701 call VideoIO_MakeWindow
702 ; Print at lower-right frame of window
703 mov si, offset TXT_SETUPHELP_Enter
704 call GetLenOfString ; CX - Len of String
705 mov dl, cl
706 mov cx, 174Eh
707 sub cl, dl
708 call VideoIO_Locate ; Locate 23, (78-LenOfString)
709 call VideoIO_Print
710 mov cx, 0F03h
711 call VideoIO_Color
712 ; Center at upper frame of window
713 mov si, offset TXT_SETUPHELP_Base
714 call GetLenOfString
715 mov dx, cx
716 mov cx, 0F41h
717 call VideoIO_LocateToCenter ; LocateToCenter 15, 65 using LenOfStr
718 call VideoIO_Print
719 ; beim R
720
721 mov cx, 0E03h
722 call VideoIO_Color
723 pop si ; and restore HelpPtr to SI
724 mov cx, 1136h
725
726 SSH_Loop:
727 call VideoIO_Locate
728 call VideoIO_Print
729 inc ch ; TextPosY + 1
730 cmp TextPosX, 36h
731 ja SSH_Loop
732
733 SSH_KeyLoop:
734 mov ah, 0
735 int 16h
736 cmp ah, Keys_ENTER
737 je SSH_EndOfHelp
738 cmp ah, Keys_ESC
739 je SSH_EndOfHelp
740 jmp SSH_KeyLoop
741
742 SSH_EndOfHelp:
743 mov ax, VideoIO_Page2
744 call VideoIO_RestoreFrom
745 ret
746SETUP_ShowHelp EndP
747
748SETUP_EnterMenu_PartitionSetup Proc Near Uses dx bp
749 ; Extra-Full Featured Partition Setup
750 call PARTSETUP_Main
751 ret
752SETUP_EnterMenu_PartitionSetup EndP
753
754SETUP_EnterMenu_BasicOptions Proc Near Uses dx bp
755 mov bp, offset SETUP_BasicOptions
756 call SETUP_MenuTask ; calls Menu!
757 ret
758SETUP_EnterMenu_BasicOptions EndP
759
760SETUP_EnterMenu_AdvancedOptions Proc Near Uses dx bp
761 mov bp, offset SETUP_AdvancedOptions
762 call SETUP_MenuTask ; calls Menu!
763 ret
764SETUP_EnterMenu_AdvancedOptions EndP
765
766SETUP_EnterMenu_ExtendedOptions Proc Near Uses dx bp
767 mov bp, offset SETUP_ExtendedBootOptions
768 call SETUP_MenuTask ; calls Menu!
769 ret
770SETUP_EnterMenu_ExtendedOptions EndP
771
772SETUP_EnterMenu_DefineMasterPassword Proc Near
773 mov di, offset CFG_MasterPassword
774 call SETUP_EnterMenu_DefinePassword
775 ret
776SETUP_EnterMenu_DefineMasterPassword EndP
777
778SETUP_EnterMenu_DefineBootPassword Proc Near
779 mov di, offset CFG_BootPassword
780 call SETUP_EnterMenu_DefinePassword
781 ret
782SETUP_EnterMenu_DefineBootPassword EndP
783
784; ============================================================================
785
786; In: di - Place for Password to be defined
787; Destroyed: None
788SETUP_EnterMenu_DefinePassword Proc Near Uses dx es bp
789 push di ; DI - Place of Password
790 mov ax, cs
791 mov es, ax ; ES == CS & Magic (AX) destroyed
792 mov si, offset TXT_SETUP_PasswordOld
793 ; di - Place of Password to Check (0 to check both passwords)
794 call PASSWORD_AskSpecifiedPassword
795 mov si, offset TXT_SETUP_PasswordDefine
796 mov di, offset SETUP_NewPwd
797 call SETUP_LetEnterPassword
798 xor ax, ax ; Magic (AX) destroyed
799 mov si, offset TXT_SETUP_PasswordVerify
800 mov di, offset SETUP_VerifyPwd
801 call SETUP_LetEnterPassword
802
803 mov si, offset SETUP_NewPwd
804 mov di, offset SETUP_VerifyPwd
805 mov cx, 8
806 repe cmpsb
807 jne SEMDP_NoMatch
808
809 mov si, offset SETUP_NewPwd
810 call PASSWORD_Encode
811 mov si, offset PasswordSpace
812 pop di ; DI = Place for Password
813 mov cx, 4
814 rep movsw ; neues Passwort...
815
816 mov di, offset SETUP_NewPwd
817 mov al, 32
818 mov cx, 8
819 repe scasb
820 je SEMDP_Disabled
821 mov cx, 0A02h
822 mov si, offset TXT_SETUP_PasswordMatched
823 call SETUP_ShowErrorBox
824 jmp SEMDP_ExitSub
825 SEMDP_Disabled:
826 mov cx, 0A02h
827 mov si, offset TXT_SETUP_PasswordDisabled
828 call SETUP_ShowErrorBox
829 jmp SEMDP_ExitSub
830
831 SEMDP_NoMatch:
832 pop di ; DI = Place for Password <BUG>
833 mov cx, 0C04h
834 mov si, offset TXT_SETUP_PasswordMismatch
835 call SETUP_ShowErrorBox
836 jmp SEMDP_ExitSub
837
838 SEMDP_ExitSub:
839 ret
840SETUP_EnterMenu_DefinePassword EndP
841
842; In: DS:SI - Text-Line for Display
843; ES:DI - Location for new password (must be 17 bytes)
844; AX - Magic, if set to ABAB, it will use a different layout and
845; will write 'Please Enter Password:'
846SETUP_LetEnterPassword Proc Near Uses bx cx dx si es di
847 local EnterPwd_Location:word, EnterPwd_DefinePwd:word
848
849 mov ax, VideoIO_Page2
850 call VideoIO_BackUpTo
851 push ax
852 push di
853 mov ax, 20h ; Space
854 mov cx, 16
855 rep stosb ; Kill new password
856 mov es:[di], ah ; ending NUL
857 pop di
858 pop ax
859 cmp ax, 0ABABh ; Magic Processing...
860 je SLEP_MagicLayOut
861 mov cx, 0D05h ; Password Dialog
862 call VideoIO_Color
863
864 call GetLenOfString ; CX - Len of Error Message
865 add cl, 6 ; Adjust to include 2 Spaces and Frame
866 push cx
867 mov bx, 0C28h
868 shr cl, 1
869 sub bl, cl
870 pop cx
871 mov dh, 0Fh
872 mov dl, bl
873 add dl, cl
874 dec dl ; Size window to match given string...
875 call VideoIO_MakeWindow
876 mov cx, 0F05h ; Password EntryField Label
877 call VideoIO_Color
878
879 mov ch, 0Dh
880 mov cl, bl
881 add cl, 3
882 call VideoIO_Locate
883 call VideoIO_Print ; Uses given string 'Define or Verify'
884 mov cx, 0E05h ; Password EntryField
885 call VideoIO_Color
886 mov word ptr [EnterPwd_Location], 0E26h
887 mov word ptr [EnterPwd_DefinePwd], 1
888 jmp SLEP_JumpToInputProcess
889
890 SLEP_MagicLayOut:
891 mov cx, 0C04h ; Only used for different (unused) layout (ABAB)
892 call VideoIO_Color
893
894 call GetLenOfString ; CX - Len of Error Message
895 add cl, 4 ; Adjust to include Space and Frame
896 push cx
897 mov bx, 0C28h
898 shr cl, 1
899 sub bl, cl
900 pop cx
901 mov dh, 10h
902 mov dl, bl
903 add dl, cl
904 dec dl ; Size window to match given string...
905 call VideoIO_MakeWindow
906 mov cx, 0F04h
907 call VideoIO_Color
908 mov ch, 0Dh
909 mov cl, bl
910 add cl, 2
911 call VideoIO_Locate
912 call VideoIO_Print ; Uses given string...
913
914 mov si, offset TXT_PleaseEnterPassword
915 call GetLenOfString ; CX - Len of Error Message
916 mov dx, cx
917 mov cx, 0E28h
918 call VideoIO_LocateToCenter ; LocateToCenter 14, 40 using LenOfStr
919 call VideoIO_Print ; Writes 'Please Enter Password:'
920 mov cx, 0E04h
921 call VideoIO_Color
922 mov EnterPwd_Location, 0F25h
923 mov EnterPwd_DefinePwd, 0
924 SLEP_JumpToInputProcess:
925 call SOUND_PreBootMenu
926 mov si, di ; DS:SI - Current Password
927 xor dl, dl
928 ; DL - location of cursor (first=0)
929 SLEP_Loop:
930 mov cx, [EnterPwd_Location]
931 call VideoIO_Locate
932 push si
933 add si, 8
934 call VideoIO_Print ; Prints current Password
935 pop si
936 mov ah, 0
937 int 16h
938 cmp al, 61h
939 jb SLEP_SkipFixLower
940 cmp al, 7Ah
941 ja SLEP_SkipFixLower
942 xor al, 20h ; Convert to UpperCase (ELiTE)
943 jmp SLEP_CorrectPwdChar
944 SLEP_SkipFixLower:
945 cmp al, 41h
946 jb SLEP_NonChar
947 cmp al, 5Ah
948 ja SLEP_NonChar
949 jmp SLEP_CorrectPwdChar
950 SLEP_NonChar:
951 cmp al, 30h
952 jb SLEP_NonNum
953 cmp al, 39h
954 ja SLEP_NonNum
955 jmp SLEP_CorrectPwdChar
956 SLEP_NonNum:
957 cmp al, 0Dh
958 je SLEP_Enter
959 cmp al, 08h
960 je SLEP_OneBack
961 SLEP_SkipThiz:
962 jmp SLEP_Loop
963
964 SLEP_CorrectPwdChar:
965 cmp dl, 8
966 je SLEP_SkipThiz
967
968 ;movzx bx, dl
969 mov bl,dl
970 mov bh,0
971
972 mov ds:[si+bx], al
973 mov al, 42 ; fixed star :]
974 mov ds:[si+bx+8], al
975 inc dl
976 jmp SLEP_Loop
977 SLEP_OneBack:
978 cmp dl, 0
979 je SLEP_SkipThiz
980 dec dl
981
982 ;movzx bx, dl
983 mov bl,dl
984 mov bh,0
985
986 mov al, 32
987 mov ds:[si+bx], al
988 mov ds:[si+bx+8], al
989 jmp SLEP_Loop
990 SLEP_Enter:
991 or dl, dl
992 jnz SLEP_GotSomePassword
993 cmp word ptr [EnterPwd_DefinePwd], 1
994 je SLEP_GotSomePassword
995 mov cx, 8
996 mov al, 1 ; Fill empty password with [01]
997 rep stosb ; ...only when Asking Password.
998 SLEP_GotSomePassword:
999 mov ax, VideoIO_Page2
1000 call VideoIO_RestoreFrom
1001 ret
1002SETUP_LetEnterPassword EndP
1003
1004; ============================================================================
1005
1006; CX = Color of Box, SI = String in Box
1007; If AX = ABABh -> Thingie will not wait...
1008SETUP_ShowErrorBox Proc Near Uses ax bx cx
1009 push ax
1010 push cx
1011 call VideoIO_Color
1012 call GetLenOfString ; CX - Len of Error Message
1013 add cl, 4 ; Adjust to include Space and Frame
1014 push cx
1015 mov bx, 0D28h
1016 shr cl, 1
1017 sub bl, cl
1018 pop cx
1019 mov dh, 0Fh
1020 mov dl, bl
1021 add dl, cl
1022 dec dl
1023 call VideoIO_MakeWindow
1024 pop cx
1025 mov ch, 0Fh
1026 call VideoIO_Color
1027 mov ch, 0Eh
1028 mov cl, bl
1029 add cl, 2
1030 call VideoIO_Locate
1031 call VideoIO_Print
1032 pop ax
1033 cmp ax, 0ABABh
1034 je SSEB_NoWait
1035 mov ah, 0
1036 int 16h ; Waits for key stroke
1037 SSEB_NoWait:
1038 ret
1039SETUP_ShowErrorBox EndP
1040
1041SETUP_EnterMenu_SaveAndExitSetup Proc Near Uses dx bp
1042 mov si, offset TXT_SETUP_SaveAndExitNow
1043 call SETUP_Warning_AreYouSure
1044 jnz SEMSAES_UserAbort
1045 SEMSAES_DoThis:
1046 xor al, al
1047 mov byte ptr [CFG_AutoEnterSetup], al
1048 add word ptr [CFG_LastTimeEditLow], 1
1049 adc word ptr [CFG_LastTimeEditHi], 0 ; Update Time-Stamp
1050 call DriveIO_SaveConfiguration
1051 mov byte ptr [SETUP_ExitEvent], 1 ; Exit and continue boot process
1052 SEMSAES_UserAbort:
1053 ret
1054SETUP_EnterMenu_SaveAndExitSetup EndP
1055
1056SETUP_EnterMenu_ExitWithoutSaving Proc Near Uses dx bp
1057 mov si, offset TXT_SETUP_QuitWithoutSaveNow
1058 call SETUP_Warning_AreYouSure
1059 jnz SEMEWS_UserAbort
1060 ; If we were forced to enter Setup, save configuration anyway...
1061 test byte ptr [CFG_AutoEnterSetup], 1
1062 jz SEMEWS_DoThis
1063 jmp SEMEWS_DoThis ; Cross-Jump to SaveAndExitSetup!
1064
1065 SEMEWS_DoThis:
1066 ; Loads basic configuration...
1067 ; This is *NOT* IPT nor HideConfig
1068 call DriveIO_LoadConfiguration
1069 mov byte ptr [SETUP_ExitEvent], 1 ; Exit and continue boot process
1070 SEMEWS_UserAbort:
1071 ret
1072SETUP_EnterMenu_ExitWithoutSaving EndP
1073
1074; Displays and asks user, if he is sure
1075; In: SI - Sure about what (string, NUL-terminated)
1076; Out: Non-Zero Flag set -> User is sure
1077; Destroyed: None
1078SETUP_Warning_AreYouSure Proc Near
1079 mov cx, 0C04h
1080 call VideoIO_Color
1081 call GetLenOfString ; CX - Len of Given String
1082 add cl, 2+6 ; Adjust to include Spaces and Frame
1083 push cx
1084 mov bx, 0B28h
1085 shr cl, 1
1086 sub bl, cl
1087 pop cx
1088 mov dh, 0Fh
1089 mov dl, bl
1090 add dl, cl
1091 dec dl
1092 call VideoIO_MakeWindow
1093 mov cx, 0F04h
1094 call VideoIO_Color
1095
1096 ; Display what the user has to be sure at...
1097 call GetLenOfString ; CX - Len of Given String
1098 mov dx, cx
1099 mov cx, 0C28h
1100 call VideoIO_LocateToCenter ; LocateToCenter 12, 40 using LenOfStr
1101 call VideoIO_Print ; Use given string...
1102
1103 mov si, offset TXT_SETUP_AreYouSure2
1104 call GetLenOfString
1105 mov dx, cx
1106 mov cx, 0E28h
1107 call VideoIO_LocateToCenter ; LocateToCenter 14, 40 using LenOfStr
1108 call VideoIO_Print
1109 ; Now the 1st Warning sentence, because it should get yellow...
1110 mov cx, 0E04h
1111 call VideoIO_Color ; Yellow on Red
1112 mov si, offset TXT_SETUP_AreYouSure1
1113 call GetLenOfString
1114 mov dx, cx
1115 mov cx, 0D28h
1116 call VideoIO_LocateToCenter ; LocateToCenter 13, 40 using LenOfStr
1117 call VideoIO_Print
1118
1119 ; Waits for user-response...
1120 SWAYS_Loop:
1121 mov ah, 0
1122 int 16h
1123 and al, 0DFh
1124 cmp al, TXT_SETUP_LetterYes
1125 je SWAYS_YES
1126 cmp al, TXT_SETUP_LetterYes2
1127 je SWAYS_YES
1128 cmp al, TXT_SETUP_LetterNo
1129 je SWAYS_NO
1130 jmp SWAYS_Loop
1131
1132 SWAYS_YES:
1133 and al, 0 ; Sets Zero-Flag
1134 ret
1135
1136 SWAYS_NO:
1137 or al, 1 ; Resets Zero-Flag
1138 ret
1139SETUP_Warning_AreYouSure EndP
1140
1141
1142;Calling Conventions for Magics:
1143;================================
1144; BX - VarPtr
1145; CH - ItemNo
1146; CL - 1, add, 0 means subtract
1147; SI - Pointer to current Item
1148; Carry Flag - Refresh Item, do not modify
1149
1150SETUPMAGIC_InternalCopyTillNUL Proc Near Uses ax cx
1151 SMICTN_Loop:
1152
1153 ;!
1154 ;! DEBUG_PROBE
1155 ;!
1156 IFDEF AUX_DEBUGx
1157 push 1239h
1158 call DEBUG_Probe
1159 call DEBUG_DumpRegisters
1160 call DEBUG_DumpIPT
1161 ENDIF
1162
1163 lodsb
1164 stosb
1165 inc cl
1166 or al, al
1167 jnz SMICTN_Loop ; Copies the string...
1168 mov al, 13
1169 sub al, cl
1170 jz SMICTN_NoFiller
1171 dec al
1172
1173 ;movzx cx, al
1174 mov cl,al
1175 mov ch,0
1176
1177 xor al, al
1178 rep stosb ; and fill up with NULs, if required
1179 SMICTN_NoFiller:
1180 ret
1181SETUPMAGIC_InternalCopyTillNUL EndP
1182
1183; Cur Value in DL, Maximum Value in DH. Add/Sub in CL
1184SETUPMAGIC_InternalCheckUp Proc Near
1185;!
1186;! DEBUG_PROBE
1187;!
1188IFDEF AUX_DEBUGx
1189 push 1238h
1190 call DEBUG_Probe
1191 call DEBUG_DumpRegisters
1192ENDIF
1193
1194 or cl, cl ; CL==0? -> Decrease
1195 jz SMICU_Substract ; otherwise -> Increase
1196 inc dl
1197 jmp SMICU_CheckNow
1198 SMICU_Substract:
1199 dec dl
1200 SMICU_CheckNow:
1201 cmp dl, 0FFh
1202 jne SMICU_DoNotModifyMin
1203 mov dl, dh ; -1? -> set to maximum
1204 SMICU_DoNotModifyMin:
1205 cmp dl, dh
1206 jbe SMICU_DoNotModifyMax
1207 xor dl, dl ; Maximum exceeded? -> set 0
1208 SMICU_DoNotModifyMax:
1209 ret
1210SETUPMAGIC_InternalCheckUp EndP
1211
1212SETUPMAGIC_EnableDisable Proc Near Uses ax si es di
1213 mov al, ds:[bx]
1214 jc SMED_DoNotModify
1215 xor al, 1 ; Do Flip-Flop :)
1216 SMED_DoNotModify:
1217 mov ds:[bx], al
1218 mov di, si
1219 mov si, offset TXT_SETUP_MAGIC_Enabled
1220 or al, al
1221 jnz SMED_Enabled
1222 mov si, offset TXT_SETUP_MAGIC_Disabled
1223 SMED_Enabled:
1224 push cs
1225 pop es
1226 add di, LocMENU_ItemPack ; DI points to ItemPack...
1227 call SETUPMAGIC_InternalCopyTillNUL
1228 ret
1229SETUPMAGIC_EnableDisable EndP
1230
1231SETUPMAGIC_ChangeBootDelay Proc Near Uses ax cx dx ds si es di
1232 mov dl, ds:[bx] ; Current Partition Number
1233 jc SMCBD_DoNotModify
1234 mov dh, 0FFh
1235 call SETUPMAGIC_InternalCheckUp ; CheckUp DL (max. 255)
1236 SMCBD_DoNotModify:
1237 mov ds:[bx], dl
1238 mov cx, 1A01h
1239 call VideoIO_Locate
1240 mov ax, VideoIO_Segment
1241 mov es, ax
1242 mov di, 4000
1243 mov cx, 8
1244 xor al, al
1245 rep stosb ; Writes 8x NUL
1246 mov al, dl
1247 call VideoIO_PrintByteDynamicNumber
1248 ; Pseudo-(XCHG DS, ES)
1249 push ds
1250 push es
1251 pop ds
1252 pop es
1253
1254 mov di, si
1255 add di, LocMENU_ItemPack ; ES:DI - ItemPack
1256 mov si, 4000 ; DS:SI - Screen Page 1
1257 push es
1258 push di
1259 mov cx, 4
1260 SMCBD_Loop:
1261 lodsw
1262 stosb
1263 loop SMCBD_Loop ; okay we got it...trick!
1264 ; DS:SI - ItemPack
1265 pop si
1266 pop ds
1267 mov cx, 12
1268 call GetLenOfName ; Gets the length of the number
1269 add si, cx
1270 mov al, 0FFh
1271 mov ds:[si], al ; and a Filler as last char (looks better)
1272 ret
1273SETUPMAGIC_ChangeBootDelay EndP
1274
1275; Used by : Default Selection
1276; Value : Partition Number (Base=0, None=80h, ContinueBIOS=FEh, Floppy=FFh)
1277; Method : Changes to another bootable partition
1278; Logic : if no bootable selections are found -> will set 80h
1279; if already set to 80h -> will search through all selections
1280SETUPMAGIC_ChangeDefaultSelection Proc Near Uses ax cx dx si es di
1281 mov di, si
1282 mov dl, ds:[bx] ; Cur Selection No.
1283 push bx
1284 pushf
1285 cmp dl, 080h
1286 jne SMCP_AlreadyGotSelection
1287 ; Start at partition 0. So Continue-BIOS and Floppy will go last
1288 xor dl, dl
1289 SMCP_AlreadyGotSelection:
1290 ; We use BL in here for tracking how many selections left
1291 mov bl, [CFG_Partitions]
1292 cmp dl, 0FEh
1293 jb SMCP_DoneAdjust
1294 je SMCP_AdjustContinueBIOS
1295 cmp byte ptr [CFG_IncludeFloppy], 0
1296 jne SMCP_DoneAdjust
1297 dec dl ; No Floppy? -> Try Resume-BIOS
1298 SMCP_AdjustContinueBIOS:
1299 cmp byte ptr [CFG_ResumeBIOSbootSeq], 0
1300 jne SMCP_DoneAdjust
1301 xor dl, dl ; No Resume-BIOS? -> Start partition 0
1302 SMCP_DoneAdjust:
1303 mov dh, bl
1304 inc bl
1305 dec dh
1306 or cl, cl ; CL==0? -> Decrease
1307 jz SMCP_SubstractSelection ; otherwise -> Increase
1308 popf
1309 jc SMCP_Dec_ModifyDone
1310 SMCP_Inc_RejectPartition:
1311 inc dl ; Increase Selection No
1312 cmp dl, [CFG_Partitions]
1313 jb SMCP_Inc_ModifyDone
1314 cmp dl, 0FFh
1315 je SMCP_Inc_TryFloppy
1316 mov dl, 0FEh ; Try Resume-BIOS
1317 cmp byte ptr [CFG_ResumeBIOSbootSeq], 0
1318 jne SMCP_Inc_ModifyDone
1319 inc dl ; Try Floppy
1320 SMCP_Inc_TryFloppy:
1321 cmp byte ptr [CFG_IncludeFloppy], 0
1322 jne SMCP_Inc_ModifyDone
1323 cmp byte ptr [CFG_Partitions], 0
1324 je SMCP_NoBootable
1325 inc dl ; Now start at partition 0 again
1326 SMCP_Inc_ModifyDone:
1327 dec bl
1328 jz SMCP_NoBootable
1329 ; Get Partition-Pointer (SI) from Partition-Number (DL)
1330 call PART_GetPartitionPointer
1331 mov ax, ds:[si+LocIPT_Flags]
1332 test ax, Flags_Bootable
1333 jz SMCP_Inc_RejectPartition
1334 jmp SMCP_GotSelection
1335
1336 SMCP_SubstractSelection:
1337 popf
1338 jc SMCP_Dec_ModifyDone
1339 SMCP_Dec_RejectPartition:
1340 dec dl ; Decrease Selection No
1341 cmp dl, 0FDh
1342 jb SMCP_Dec_ModifyDone ; <FDh -> We are done
1343 je SMCP_Dec_TryPartition
1344 cmp dl, 0FFh
1345 jb SMCP_Dec_TryResumeBIOS
1346 cmp byte ptr [CFG_IncludeFloppy], 0
1347 jne SMCP_Dec_ModifyDone
1348 dec dl
1349 SMCP_Dec_TryResumeBIOS:
1350 cmp byte ptr [CFG_ResumeBIOSbootSeq], 0
1351 jne SMCP_Dec_ModifyDone
1352 SMCP_Dec_TryPartition:
1353 mov dl, [CFG_Partitions]
1354 or dl, dl
1355 jz SMCP_NoBootable
1356 dec dl ; Now start at last partition again
1357 SMCP_Dec_ModifyDone:
1358 dec bl
1359 jz SMCP_NoBootable
1360 ; Get Partition-Pointer (SI) from Partition-Number (DL)
1361 call PART_GetPartitionPointer
1362 mov ax, ds:[si+LocIPT_Flags]
1363 test ax, Flags_Bootable
1364 jz SMCP_Dec_RejectPartition
1365
1366 SMCP_GotSelection:
1367 pop bx
1368 mov ds:[bx], dl ; Set new partition
1369 add si, LocIPT_Name ; Location of Name
1370 push cs
1371 pop es
1372 add di, LocMENU_ItemPack ; DI points to ItemPack...
1373 mov cx, 11
1374 rep movsb ; Copy cur PartitionName to ItemPack
1375 xor al, al
1376 stosb ; Ending Zero :)
1377 ret
1378
1379 SMCP_NoBootable:
1380 pop bx
1381 mov dl, 080h ; "No Bootable"
1382 mov ds:[bx], dl ; set that one
1383 mov si, offset TXT_SETUP_MAGIC_NoBootable
1384 push cs
1385 pop es
1386 add di, LocMENU_ItemPack
1387 call SETUPMAGIC_InternalCopyTillNUL
1388 ret
1389SETUPMAGIC_ChangeDefaultSelection EndP
1390
1391
1392SETUPMAGIC_ChangeTimedKeyHandling Proc Near Uses ax cx dx ds si es di
1393 mov di, si
1394 mov dl, ds:[bx] ; Cur Timed-Key-Handling
1395 jc SMCTKH_DoNotModify
1396 mov dh, 02h
1397 call SETUPMAGIC_InternalCheckUp ; CheckUp DL (max. 2)
1398 SMCTKH_DoNotModify:
1399 mov ds:[bx], dl
1400 cmp dl, 1
1401 jb SMCTKH_Is0
1402 je SMCTKH_Is1
1403 ; ist 2 vermutlich ;)
1404 mov si, offset TXT_SETUP_MAGIC_StopTime
1405 jmp SMCTKH_CopyThiz
1406 SMCTKH_Is0:
1407 mov si, offset TXT_SETUP_MAGIC_DoNothing
1408 jmp SMCTKH_CopyThiz
1409 SMCTKH_Is1:
1410 mov si, offset TXT_SETUP_MAGIC_ResetTime
1411 SMCTKH_CopyThiz:
1412 add di, LocMENU_ItemPack ; DI points to ItemPack...
1413 push cs
1414 pop es
1415 call SETUPMAGIC_InternalCopyTillNUL
1416 ret
1417SETUPMAGIC_ChangeTimedKeyHandling EndP
1418
1419SETUPMAGIC_ChangeBootMenu Proc Near Uses ax cx dx ds si es di
1420 mov di, si
1421 mov dl, ds:[bx] ; Cur Boot-Menu state
1422 jc SMCBM_DoNotModify
1423 mov dh, 02h
1424 call SETUPMAGIC_InternalCheckUp ; CheckUp DL (max. 2)
1425 SMCBM_DoNotModify:
1426 mov ds:[bx], dl
1427 cmp dl, 1
1428 jb SMCBM_Is0
1429 je SMCBM_Is1
1430 ; ist 2 vermutlich ;)
1431 mov si, offset TXT_SETUP_MAGIC_Detailed
1432 jmp SMCBM_CopyThiz
1433 SMCBM_Is0:
1434 mov si, offset TXT_SETUP_MAGIC_Disabled
1435 jmp SMCBM_CopyThiz
1436 SMCBM_Is1:
1437 mov si, offset TXT_SETUP_MAGIC_Enabled
1438 SMCBM_CopyThiz:
1439 add di, LocMENU_ItemPack ; DI points to ItemPack...
1440 push cs
1441 pop es
1442 call SETUPMAGIC_InternalCopyTillNUL
1443 ret
1444SETUPMAGIC_ChangeBootMenu EndP
1445
1446SETUPMAGIC_ChangeFloppyDisplay Proc Near Uses cx dx si es di
1447 call SETUPMAGIC_EnableDisable ; forward call
1448 cmp byte ptr [CFG_PartDefault], 0FFh ; Default-Selection is us?
1449 jne SMCFD_Done
1450 xor ch, ch
1451 mov CFG_PartDefault, ch ; Reset Default-Selection to 1st part
1452 ; We need to fill up Item 0 (Default-Selection)...
1453 call SETUP_FillUpItemPack_Now
1454 ; ...and display it on screen (so the user thinks that we are not dumb)
1455 ; This is hardcoded, but there is no other way.
1456 xor dl, dl
1457 call SETUP_DrawDeSelectItem ; Redraw Item 0
1458 SMCFD_Done:
1459 ret
1460SETUPMAGIC_ChangeFloppyDisplay EndP
1461
1462SETUPMAGIC_ChangeBIOSbootSeq Proc Near Uses ax bx cx dx si di
1463;!
1464;! DEBUG_PROBE
1465;!
1466IFDEF AUX_DEBUGx
1467 push 1237h
1468 call DEBUG_Probe
1469 call DEBUG_DumpRegisters
1470ENDIF
1471
1472 mov di, si
1473 mov dl, ds:[bx] ; Cur Timed-Key-Handling
1474 jc SMCBBS_DoNotModify
1475 mov dh, 3
1476 call SETUPMAGIC_InternalCheckUp ; CheckUp DL (max. 3)
1477 SMCBBS_DoNotModify:
1478 mov ds:[bx], dl
1479 ; DL - Current value
1480 or dl, dl
1481 jnz SMCBBS_Enabled
1482 mov si, offset TXT_SETUP_MAGIC_Disabled
1483 cmp byte ptr [CFG_PartDefault], 0FEh ; Default-Selection is us?
1484 jne SMCBBS_CopyThiz
1485 mov CFG_PartDefault, dl ; Reset Default-Selection to 1st part
1486 jmp SMCBBS_CopyThiz
1487 SMCBBS_Enabled:
1488 dec dl
1489
1490 ;movzx bx, dl
1491 mov bl,dl
1492 mov bh,0
1493
1494 shl bx, 1
1495 mov si, word ptr [ContinueBIOSbootTable+bx]
1496 SMCBBS_CopyThiz:
1497 add di, LocMENU_ItemPack ; DI points to ItemPack...
1498 push cs
1499 pop es
1500 call SETUPMAGIC_InternalCopyTillNUL
1501 ; Copy device-name to the ContBIOSbootSeq-IPT entry
1502 call PART_UpdateResumeBIOSName
1503 ret
1504SETUPMAGIC_ChangeBIOSbootSeq EndP
Note: See TracBrowser for help on using the repository browser.