source: trunk/bootcode/setup/part_set.asm@ 65

Last change on this file since 65 was 65, checked in by Ben Rietbroek, 9 years ago

Use different colors for testbuilds [v1.1.1-testing]

When the colors for a testbuild are the same as the colors used for a
release, it's easy to forget one is using a testbuild. So, from now on
testbuilds will use a different color-scheme as a reminder.

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: 59.1 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 / PARTITION SETUP
20;---------------------------------------------------------------------------
21
22IFDEF MODULE_NAMES
23DB 'PART_SET',0
24ENDIF
25
26; This here is called from Menu in AIR-BSET.asm
27PARTSETUP_Main Proc Near
28 ; Build Fixed Content...
29 call PARTSETUP_DrawMenuBase
30 ; Build Dynamic Content...
31 mov dl, PartSetup_ActivePart
32 mov dh, dl ; DL - Current Active, DH - New Active
33 call PARTSETUP_RefreshPartitions
34 ; Show Choice-Bar at DH...
35 call PARTSETUP_BuildChoiceBar
36
37 ; Now we got everything on-the-screen
38 PSM_MainLoop:
39 push dx
40 mov ah, 0
41 int 16h
42 pop dx
43
44 ;
45 ; INSERT DEBUG KEYHANDLER HERE ?
46 ;
47
48 cmp ah, Keys_Up
49 je PSM_KeyUp
50 cmp ah, Keys_Down
51 je PSM_KeyDown
52 cmp ah, Keys_Left
53 je PSM_KeyLeft
54 cmp ah, Keys_Right
55 je PSM_KeyRight
56 cmp ah, Keys_ESC
57 je PSM_KeyESC
58 cmp ah, Keys_F1
59 je PSM_KeyF1
60 cmp ah, Keys_ENTER
61 je PSM_KeyENTER
62 ; Flags-Change
63 and al, 0DFh ; Upper-Case Input
64 cmp al, TXT_SETUP_FlagLetterBootable
65 je PSM_KeyBootAble
66 cmp al, TXT_SETUP_FlagLetterVIBR
67 je PSM_KeyVIBRdetection
68 cmp al, TXT_SETUP_FlagLetterHide
69
70 jne skip_x
71 jmp PSM_KeyHiddenSetup
72 skip_x:
73 cmp al, TXT_SETUP_FlagLetterDrvLetter
74
75 jne skip_y
76 jmp PSM_KeyDriveLetterForceSetup
77 skip_y:
78
79 cmp al, TXT_SETUP_FlagLetterExtMShack
80 jne skip_z
81 jmp PSM_KeyDriveLetterExtMShack
82 skip_z:
83 jmp PSM_MainLoop
84
85 PSM_KeyESC:
86 ; Simpy exit this menu...
87 mov PartSetup_ActivePart, dl
88 ret
89
90 PSM_KeyUp:
91 cmp dh, 1
92 jbe PSM_MainLoop
93 sub dh, 2
94 call PARTSETUP_BuildChoiceBar
95 jmp PSM_MainLoop
96
97 PSM_KeyDown:
98 add dh, 2
99 call PARTSETUP_BuildChoiceBar
100 jmp PSM_MainLoop
101
102 PSM_KeyLeft:
103 xor dh, 1
104 call PARTSETUP_BuildChoiceBar
105 jmp PSM_MainLoop
106
107 PSM_KeyRight:
108 xor dh, 1
109 call PARTSETUP_BuildChoiceBar
110 jmp PSM_MainLoop
111
112 PSM_KeyF1:
113 mov bx, offset TXT_SETUPHELP_InPartitionSetup
114 call SETUP_ShowHelp ; Shows help
115 jmp PSM_MainLoop
116
117 ; Disabling editing for type 0x35 is currently implemented
118 ; in PARTSETUP_ChangePartitionName.
119 PSM_KeyENTER:
120 call PARTSETUP_ChangePartitionName
121 ; Rebuild Menu...
122 call PARTSETUP_DrawMenuBase
123 call PARTSETUP_RefreshPartitions
124 call PARTSETUP_BuildChoiceBar
125 jmp PSM_MainLoop
126
127 PSM_KeyBootAble:
128 call PART_GetPartitionPointer ; Gets Partition (DL) Pointer -> SI
129 ; See if this is an eCS LVM Volume.
130 ; In that case, we don't allow it to be made bootable.
131 ; We also show a popup to inform the user.
132 call PARTSETUP_IsType35
133 je PSM_KeyBootAble_istype35
134
135 PSM_KeyBootAble_notype35:
136 mov al, [si+LocIPT_Flags]
137 xor al, Flags_Bootable
138 mov [si+LocIPT_Flags], al
139 call PARTSETUP_DrawPartitionInfo
140 call PARTSETUP_BuildChoiceBar
141 PSM_KeyBootAble_istype35:
142 jmp PSM_MainLoop
143
144 PSM_KeyVIBRdetection:
145 call PART_GetPartitionPointer ; Gets Partition (DL) Pointer -> SI
146 mov al, [si+LocIPT_Flags]
147 xor al, Flags_VIBR_Detection
148 mov [si+LocIPT_Flags], al
149 xor ax, ax
150 mov word ptr [si+LocIPT_BootRecordCRC], ax
151 call PARTSETUP_DrawPartitionInfo
152 call PARTSETUP_BuildChoiceBar
153 jmp PSM_MainLoop
154
155 PSM_KeyHiddenSetup:
156 call PARTHIDESETUP_Main
157 ; Rebuild Menu...
158 call PARTSETUP_DrawMenuBase
159 call PARTSETUP_RefreshPartitions
160 call PARTSETUP_BuildChoiceBar
161 jmp PSM_MainLoop
162
163 PSM_KeyDriveLetterForceSetup:
164 call PARTSETUP_DriveLetterSetup
165 ; Rebuild Menu...
166 call PARTSETUP_DrawMenuBase
167 call PARTSETUP_RefreshPartitions
168 call PARTSETUP_BuildChoiceBar
169 jmp PSM_MainLoop
170
171 PSM_KeyDriveLetterExtMShack:
172 call PART_GetPartitionPointer ; Gets Partition (DL) Pointer -> SI
173 mov al, [si+LocIPT_Flags]
174 xor al, Flags_ExtPartMShack
175 mov [si+LocIPT_Flags], al
176 call PARTSETUP_DrawPartitionInfo
177 call PARTSETUP_BuildChoiceBar
178 jmp PSM_MainLoop
179PARTSETUP_Main EndP
180
181
182; See if this is a partition of type 0x35 and display error
183; when user tries to set it as bootable.
184; IN: SI = Pointer to partition
185; OUT: ZF = Set if 0x35, clear otherwise
186PARTSETUP_IsType35 Proc Near
187 mov al, [si+LocIPT_SystemID]
188 cmp al, 35h
189 jne PARTSETUP_IsType35_end
190 pushf
191 pusha
192 ; Cannot boot LVM-Data partitions
193 mov cx, 0C04h
194 mov si, offset TXT_SETUP_NoBootType35
195 call SETUP_ShowErrorBox
196 popa
197 call PARTSETUP_DrawMenuBase
198 call PARTSETUP_RefreshPartitions
199 call PARTSETUP_BuildChoiceBar
200 popf
201 PARTSETUP_IsType35_end:
202 ret
203PARTSETUP_IsType35 EndP
204
205
206
207CLR_SETUP_PARTITION_LABELS_CLASSIC = 0b01h
208CLR_SETUP_PARTITION_LABELS_BM = 0b01h
209CLR_SETUP_PARTITION_LABELS_TB = 0b08h
210IFDEF TESTBUILD
211CLR_SETUP_PARTITION_LABELS = CLR_SETUP_PARTITION_LABELS_TB
212ELSE
213CLR_SETUP_PARTITION_LABELS = CLR_SETUP_PARTITION_LABELS_BM
214ENDIF
215
216; Draw all standard-things for Partition Setup, dynamic content not included.
217PARTSETUP_DrawMenuBase Proc Near Uses dx
218 call SETUP_DrawMenuWindow ; Standard Windows
219
220 ; 1st No Hd [09] Name [15] Flags [1D] Type
221 ; 2nd No Hd [31] Name [3D] Flags [45] Type
222
223 mov cx, 0508h
224 call VideoIO_Locate
225 inc TextPosX
226 mov al, TextChar_WinLineDown
227 mov cl, 9
228 call VideoIO_Internal_MakeWinDown ; Line between 1st No Hd and Name
229 mov cx, 0515h
230 call VideoIO_Locate
231 mov al, TextChar_WinLineDown
232 mov cl, 9
233 call VideoIO_Internal_MakeWinDown ; Line between 1st Name and Flags
234 mov cx, 051Dh
235 call VideoIO_Locate
236 mov al, TextChar_WinLineDown
237 mov cl, 9
238 call VideoIO_Internal_MakeWinDown ; Line between 1st Flags and Type
239
240 mov cx, 0531h ; Line between 2nd No Hd and Name
241 call VideoIO_Locate
242 mov al, TextChar_WinLineDown
243 mov cl, 9
244 call VideoIO_Internal_MakeWinDown
245 mov cx, 053Dh ; Line between 2nd Name and Flags
246 call VideoIO_Locate
247 mov al, TextChar_WinLineDown
248 mov cl, 9
249 call VideoIO_Internal_MakeWinDown
250 mov cx, 0545h ; Line between 2nd Flags and Type
251 call VideoIO_Locate
252 mov al, TextChar_WinLineDown
253 mov cl, 9
254 call VideoIO_Internal_MakeWinDown
255
256 mov cx, CLR_SETUP_PARTITION_LABELS ; F10-SETUP-PARTITION-SETUP labels bg
257 call VideoIO_Color
258
259 ; ------------------------------------- 1st Part
260 mov cx, 0503h
261 call VideoIO_Locate
262 mov si, offset TXT_TopInfos_No ; "No Hd"
263 mov cl, 5
264 call VideoIO_FixedPrint
265 mov cx, 050Bh
266 call VideoIO_Locate
267 mov si, offset TXT_TopInfos_Label ; "Label"
268 mov cl, 5
269 call VideoIO_FixedPrint
270 mov cx, 0517h
271 call VideoIO_Locate
272 mov si, offset TXT_TopInfos_Flags ; "Flags"
273 mov cl, 5
274 call VideoIO_FixedPrint
275 mov cx, 051Fh
276 call VideoIO_Locate
277 mov si, offset TXT_TopInfos_Type ; "Type"
278 mov cl, 4
279 call VideoIO_FixedPrint
280
281 ; ------------------------------------- 2nd Part
282 mov cx, 052Bh
283 call VideoIO_Locate
284 mov si, offset TXT_TopInfos_No ; "No Hd"
285 mov cl, 5
286 call VideoIO_FixedPrint
287 mov cx, 0533h
288 call VideoIO_Locate
289 mov si, offset TXT_TopInfos_Label ; "Label"
290 mov cl, 5
291 call VideoIO_FixedPrint
292 mov cx, 053Fh
293 call VideoIO_Locate
294 mov si, offset TXT_TopInfos_Flags ; "Flags"
295 mov cl, 5
296 call VideoIO_FixedPrint
297 mov cx, 0547h
298 call VideoIO_Locate
299 mov si, offset TXT_TopInfos_Type ; "Type"
300 mov cl, 4
301 call VideoIO_FixedPrint
302
303 mov si, offset TXT_SETUPHELP_PartSetup
304 call SETUP_DrawMenuHelp
305 ret
306PARTSETUP_DrawMenuBase EndP
307
308; Displays all partitions into Partition Setup Menu
309; aka displays dynamic content.
310PARTSETUP_RefreshPartitions Proc Near Uses cx dx
311 mov dl, PartSetup_UpperPart
312 mov dh, 12
313 PSRP_Loop:
314 call PARTSETUP_DrawPartitionInfo
315 inc dl
316 dec dh
317 jnz PSRP_Loop
318 ; At last calculate Scroll-Markers
319IFDEF TESTBUILD
320 mov cx, 0908h
321ELSE
322 mov cx, 0901h
323ENDIF
324 call VideoIO_Color
325 mov cx, 0603h ; 6, 3
326 mov dl, PartSetup_UpperPart
327 call PARTSETUP_UpperScrollMarker
328 mov cl, 37 ; 6, 37
329 call PARTSETUP_UpperScrollMarker
330 mov cl, 43 ; 6, 43
331 call PARTSETUP_UpperScrollMarker
332 mov cl, 76 ; 6, 76
333 call PARTSETUP_UpperScrollMarker
334 mov cx, 0D03h ; 13, 3
335 add dl, 12 ; add 12 -> points to last partition
336 mov dh, CFG_Partitions ; Limit
337 call PARTSETUP_LowerScrollMarker
338 mov cl, 37 ; 6, 37
339 call PARTSETUP_LowerScrollMarker
340 inc dl ; add 1 -> cool way ;-)
341 mov cl, 43 ; 6, 43
342 call PARTSETUP_LowerScrollMarker
343 mov cl, 76 ; 6, 76
344 call PARTSETUP_LowerScrollMarker
345 ret
346PARTSETUP_RefreshPartitions EndP
347
348; Writes Partition-Information to Screen (Partition-Setup)
349; In: DL - Number of Partition (Base=0)
350; Destroyed: None
351PARTSETUP_DrawPartitionInfo Proc Near Uses ax bx cx dx si
352 local NoOfPart :byte
353 mov ch, dl
354 sub ch, PartSetup_UpperPart
355 mov cl, 3 ; 3 - first Position
356 shr ch, 1
357 jnc PSDPI_LeftPos
358 mov cl, 43 ; 43 - second Position
359 PSDPI_LeftPos:
360 add ch, 7 ; CH - Line Location for PartInfo
361 ; We got location
362 mov NoOfPart, dl
363 call VideoIO_Locate
364
365 cmp dl, CFG_Partitions
366 jb PSDPI_GotPartitionData
367 push cx
368 mov al, ' '
369 mov cl, 5
370 call VideoIO_PrintSingleMultiChar
371 pop cx
372 add cl, 7
373 call VideoIO_Locate
374 push cx
375 mov al, ' '
376 mov cl, 11
377 call VideoIO_PrintSingleMultiChar
378 pop cx
379 add cl, 13
380 call VideoIO_Locate
381 push cx
382 mov al, ' '
383 mov cl, 5
384 call VideoIO_PrintSingleMultiChar
385 pop cx
386 add cl, 7
387 call VideoIO_Locate
388 push cx
389 mov al, ' '
390 mov cl, 8
391 call VideoIO_PrintSingleMultiChar
392 pop cx
393 ret
394
395 PSDPI_GotPartitionData:
396 call PART_GetPartitionPointer ; Gets Pointer to Partition (DL) -> SI
397 mov al, NoOfPart
398 inc al
399 call VideoIO_PrintByteNumber
400
401 ; Display "No Hd" field aka "01/01"
402 call VideoIO_Locate
403 push cx
404IFDEF TESTBUILD
405 mov cx, 0F08h
406ELSE
407 mov cx, 0F01h
408ENDIF
409 call VideoIO_Color ; Bright White, Blue
410 pop cx
411 mov al, NoOfPart
412 inc al
413 call VideoIO_PrintByteNumber
414 mov al, '/'
415 call VideoIO_PrintSingleChar
416 mov al, [si+LocIPT_Drive]
417 sub al, 7Fh
418 call VideoIO_PrintByteNumber
419
420 ; Display "Label" field e.g. "OS2 " (fixed 11 bytes)
421 add cl, 7
422 call VideoIO_Locate
423 push cx
424IFDEF TESTBUILD
425 mov cx, 0E08h
426ELSE
427 mov cx, 0E01h
428ENDIF
429 call VideoIO_Color ; Yellow, Blue
430 push si
431 add si, LocIPT_Name
432 mov cl, 11
433 call VideoIO_FixedPrint
434 pop si
435 pop cx
436
437 ; Display "Flags" field aka "BVHL"
438 add cl, 13
439 call VideoIO_Locate
440 ; This is using a sub-routine for each flag. Is better that way.
441 mov bl, [si+LocIPT_Flags]
442 mov bh, bl
443 mov al, TXT_SETUP_FlagLetterBootable
444 and bl, Flags_Bootable
445 call PARTSETUP_DrawOneFlag
446 mov bl, bh
447 mov al, TXT_SETUP_FlagLetterVIBR
448 and bl, Flags_VIBR_Detection
449 call PARTSETUP_DrawOneFlag
450 mov bl, bh
451 mov al, TXT_SETUP_FlagLetterHide
452 and bl, Flags_HideFeature
453 call PARTSETUP_DrawOneFlag
454 mov bl, bh
455 mov al, TXT_SETUP_FlagLetterDrvLetter
456 and bl, Flags_DriveLetter
457 call PARTSETUP_DrawOneFlag
458 mov bl, bh
459 mov al, TXT_SETUP_FlagLetterExtMShack
460 and bl, Flags_ExtPartMShack
461 call PARTSETUP_DrawOneFlag
462
463 ; Display "Type" field aka "FAT16Big"
464 add cl, 7
465 call VideoIO_Locate
466 push cx
467IFDEF TESTBUILD
468 mov cx, 0C08h
469ELSE
470 mov cx, 0C01h
471ENDIF
472 call VideoIO_Color ; Bright Red, Blue
473 pop cx
474 mov al, [si+LocIPT_SystemID]
475 call PART_SearchFileSysName
476 mov cl, 8
477 call VideoIO_FixedPrint
478 ret
479PARTSETUP_DrawPartitionInfo EndP
480
481; In: AL - Flag-Letter
482; BL - ==0 -> Flag not set, =!0 -> Flag set
483; Destroyed: None
484PARTSETUP_DrawOneFlag Proc Near Uses cx
485IFDEF TESTBUILD
486 mov cx, 0A08h ; Bright Green
487ELSE
488 mov cx, 0A01h ; Bright Green
489ENDIF
490 or bl, bl
491 jnz PSDOF_FlagSet
492 mov ch, 09h ; Bright Blue
493 PSDOF_FlagSet:
494 call VideoIO_Color
495 call VideoIO_PrintSingleChar
496 ret
497PARTSETUP_DrawOneFlag EndP
498
499; F10-SETUP
500CLR_SETUP_SELECTION_BAR_CLASSIC = 10h
501CLR_SETUP_SELECTION_BAR_BM = 10h
502CLR_SETUP_SELECTION_BAR_TB = 80h
503IFDEF TESTBUILD
504CLR_SETUP_SELECTION_BAR = CLR_SETUP_SELECTION_BAR_TB
505ELSE
506CLR_SETUP_SELECTION_BAR = CLR_SETUP_SELECTION_BAR_BM
507ENDIF
508
509; In: DL - Current Active (to be inactivated)
510; DH - New Active (to be activated)
511; Destroyed: None
512PARTSETUP_BuildChoiceBar Proc Near
513 cmp dl, dh
514 je PSBCB_SkipRetrace
515 call VideoIO_WaitRetrace
516 PSBCB_SkipRetrace:
517
518 ; Deactivate current active bar
519 mov cl, CLR_SETUP_SELECTION_BAR
520 call PARTSETUP_ReColorPart
521
522 ; Running Fixing
523 cmp dh, 0FFh
524 jne PSBCB_NoUnderflow
525 xor dh, dh
526 PSBCB_NoUnderflow:
527 cmp dh, CFG_Partitions
528 jb PSBCB_NoOverflow
529 mov dh, CFG_Partitions
530 dec dh
531 PSBCB_NoOverflow:
532 mov dl, dh
533
534 ; Do we need to scroll ?
535 mov al, PartSetup_UpperPart
536 cmp dl, al
537 jb PSBCB_YesScrolling
538 add al, 12
539 cmp dl, al
540 jb PSBCB_NoScrolling
541 mov al, dl
542 and al, 0FEh ; UpperPart is never 1/3/5/7/etc.
543 sub al, 10
544 mov PartSetup_UpperPart, al
545 call PARTSETUP_RefreshPartitions
546 jmp PSBCB_NoScrolling
547 PSBCB_YesScrolling:
548 mov al, dl
549 and al, 0FEh ; UpperPart is never 1/3/5/7/etc.
550 mov PartSetup_UpperPart, al
551 call PARTSETUP_RefreshPartitions
552 PSBCB_NoScrolling:
553
554 ; Activate fresh active bar
555 mov cl, 40h ; F10-SETUP SelectionBar Active bg
556 call PARTSETUP_ReColorPart
557 ; Now DL==DH
558 ret
559PARTSETUP_BuildChoiceBar EndP
560
561; In: CL - Color, DL - Partition
562; Destroyed: None, but Locate-Pointer
563PARTSETUP_ReColorPart Proc Near Uses bx cx es di
564 mov bh, cl ; Color to BH
565 ; First calculate location of bar
566 cmp dl, PartSetup_UpperPart
567 jb PSRCP_NotInWindowView
568 mov ch, dl
569 sub ch, PartSetup_UpperPart ; CH - Position relative to UpperPart
570 cmp ch, 12 ; 12 - Maximum Total in Window
571 jae PSRCP_NotInWindowView
572 mov cl, 2 ; 2 - first Position
573 mov bl, 39 ; Length of Bar is 39
574 shr ch, 1
575 jnc PSRCP_LeftPos
576 mov cl, 42 ; 42 - second Position
577 dec bl ; Length of Bar is 38
578 PSRCP_LeftPos:
579 add ch, 7 ; Y-Position add-on fixed 7
580 call VideoIO_Locate ; geht zu CX
581 call VideoIO_Internal_SetRegs
582 inc di ; DI - Destination+1 -> Color-Byte
583 mov cl, bl ; Length of Bar is always 39
584 PSRCP_ClearLoop:
585 mov al, es:[di]
586 and al, 0Fh
587 or al, bh ; setzt den Hintergrund (BH)
588 mov es:[di], al
589 add di, 2
590 dec cl
591 jnz PSRCP_ClearLoop
592 PSRCP_NotInWindowView:
593 ret
594PARTSETUP_ReColorPart EndP
595
596; In: CX - Location, DL - UpperPartNo
597; Destroyed: None, but Locate-Pointer
598PARTSETUP_UpperScrollMarker Proc Near Uses ax cx
599 call VideoIO_Locate
600 mov al, ' '
601 or dl, dl
602 jz PSUSM_NoMarker
603 mov al, 1Eh
604 PSUSM_NoMarker:
605 mov cl, 3
606 call VideoIO_PrintSingleMultiChar
607 ret
608PARTSETUP_UpperScrollMarker EndP
609
610; In: CX - Location, DL - UpperPartNo, DH - Limit
611; Destroyed: None, cx dx
612PARTSETUP_LowerScrollMarker Proc Near Uses ax cx
613 call VideoIO_Locate
614 mov al, ' '
615 cmp dl, dh
616 jae PSLSM_NoMarker
617 mov al, 1Fh
618 PSLSM_NoMarker:
619 mov cl, 3
620 call VideoIO_PrintSingleMultiChar
621 ret
622PARTSETUP_LowerScrollMarker EndP
623
624; =============================================================================
625
626; This is called from MBRS_Routines_PartitionSetup
627; In: DL - Partition to ChangeName
628; Destroyed: ax bx cx
629PARTSETUP_ChangePartitionName Proc Near Uses dx ds si di
630 push ds
631 pop es ; we need DS==ES in here for MOVSB etc.
632 call PART_GetPartitionPointer ; Gets the PartitionPointer for DL in SI
633
634 ; First deactivate current active bar
635 mov cl, 10h
636 call PARTSETUP_ReColorPart
637
638 ; Calculate where the Partition-Name is located...
639 mov ch, dl
640 sub ch, PartSetup_UpperPart ; CH - Position relative to UpperPart
641 mov cl, 10 ; 10 - first Position
642 shr ch, 1
643 jnc PSCPN_LeftPos
644 mov cl, 50 ; 50 - second Position
645 PSCPN_LeftPos:
646 add ch, 7 ; Y-Position add-on fixed 7
647 call VideoIO_Locate ; Goes to CX
648
649 mov byte ptr [ChangePartNameSave], 0 ; Don't save to BR / LVM Sector
650
651 ; We compare, if our IPT contains the same partition name as in BR or LVM
652 ; This is done for security purposes, because if they match, we will update
653 ; the name in both - IPT and BR/LVM.
654
655 ;movzx bx, dl
656 mov bl,dl
657 mov bh,0
658
659 cmp byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM
660 je PSCPN_NotLVMSupported
661
662 ;
663 ; BOOKMARK: LVM Label Manipulations
664 ;
665
666 ; ------------------------------------------------------------[LVM CHECK]---
667 ; Load LVM-Sector here and seek to PartitionName
668 ; Set CurPartition_Location information of destination partition
669 mov ax, [si+LocIPT_AbsolutePartTable]
670 mov [CurPartition_Location+0], ax
671 mov ax, [si+LocIPT_AbsolutePartTable+2]
672 mov [CurPartition_Location+2], ax
673 mov ah, byte ptr [si+LocIPT_LocationPartTable+0]
674 mov al, byte ptr [si+LocIPT_Drive]
675 mov [CurPartition_Location+4], ax
676 mov ax, [si+LocIPT_LocationPartTable+1]
677 mov [CurPartition_Location+6], ax
678 mov di, si ; Put SI into DI
679 call DriveIO_LoadLVMSector
680 jnc PSCPN_LVMGotError ; Security again, if problem -> halt
681 push dx
682 mov ax, [di+LocIPT_AbsoluteBegin]
683 mov dx, [di+LocIPT_AbsoluteBegin+2]
684 call LVM_SearchForPartition
685 pop dx
686 jnc PSCPN_LVMGotError ; Not Found? -> display error and halt
687
688
689 ; Point to LVM VolumeName
690 add si, LocLVM_VolumeName
691
692
693 xchg si, di ; SI-IPTEntry, DI-LVM PartName
694 jmp PSCPN_CheckPartName ; Check, if match...
695
696
697
698 PSCPN_LVMGotError:
699 jmp MBR_LoadError
700
701
702
703 ; mov si, di ; Restore SI and bootrecord fall-back
704 PSCPN_NotLVMSupported:
705 ; ----------------------------------------------------[BOOT-RECORD CHECK]---
706 ; Load Boot-Record...
707 ; BOOKMARK: Load Boot Record
708 push dx
709 mov ax, [si+LocIPT_AbsoluteBegin+0]
710 mov bx, [si+LocIPT_AbsoluteBegin+2]
711 mov cx, [si+LocIPT_LocationBegin+1]
712 mov dh, [si+LocIPT_LocationBegin+0]
713 mov dl, [si+LocIPT_Drive]
714 call DriveIO_LoadPartition
715 pop dx
716
717 ; We seek to Partition Label within boot-record here
718 mov di, offset PartitionSector
719
720 push si
721 mov al, [si+LocIPT_SystemID]
722 call PART_SearchFileSysName
723 ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSysNamePtr
724 pop si
725
726 test ah, FileSysFlags_NoName ; If NoName by FileSysFlag
727 jnz PSCPN_LetUserEditPartName ; -> don't put it into BR at anytime
728 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting
729 jz PSCPN_ResumeNormal
730 add di, 1Ch ; Fix for FAT 32, shit
731 PSCPN_ResumeNormal:
732 add di, 2Bh ; ES:DI - Name of Partition
733
734
735
736
737
738 ; This code is used for BR and LVM checking
739 ; Rousseau: Because AiR-BOOT v1.0.8+ uses the LVM_VolumeName, which is copied
740 ; to the IPT, this compare fails when the LVM_PartitionName is not
741 ; the same as the LVM_VolumeName. In that case, only the LVM_VolumeName
742 ; is updated. If they are the same, both are upated so they are the same
743 ; again after the edit.
744
745 PSCPN_CheckPartName:
746
747 ; Do no synchronization initially.
748 mov byte ptr [SyncLvmLabels],0
749
750 ; SI = IPT_Enty, DI points to LVM VolumeName.
751
752 ; If the partition is an LVM partition then disable editing completely.
753 cmp byte ptr [si+LocIPT_SystemID], 035h
754 jnz no_type_35h
755
756 ; Cannot boot LVM-Data partitions
757 pusha
758 mov cx, 0C04h
759 mov si, offset TXT_SETUP_NoEditType35
760 call SETUP_ShowErrorBox
761 popa
762
763
764 jmp PSCPN_AllDone
765
766 ; SI = IPT_Enty, DI points to LVM VolumeName.
767 no_type_35h:
768
769 ;
770 ; Compare LVM VolumeName and PartitionName and
771 ; set flag if they are the same and need to be synced after user edit.
772 ;
773 push si
774 push di
775 mov si,di ; Pointer to LVM V-name in SI
776 add di,LocLVM_LabelLen ; Pointer to LVM P-name in DI
777 mov cx,LocLVM_LabelLen ; Length of LVM label
778 cld
779 repe cmpsb ; Compare V and P labels
780 jnz LVM_Labels_not_equal
781 mov byte ptr [SyncLvmLabels],1 ; Same so set flag for later
782 LVM_Labels_not_equal:
783 pop di
784 pop si
785
786
787 mov cx, 11 ; Partition-Name-Length = 11 Bytes
788 push si
789 push di
790 add si, LocIPT_Name ; DS:SI -> Partition-Name
791 repz cmpsb
792 pop di
793 pop si
794 jne PSCPN_LetUserEditPartName ; -> No BR/LVM Changing/Saving
795
796 mov byte ptr [ChangePartNameSave], 1 ; Remember, so we will save to BR
797
798 ; SI = IPT_Enty, DI points to LVM PartitionName.
799 PSCPN_LetUserEditPartName:
800 ; User will now edit the volume label...
801 mov cx, 11
802 add si, LocIPT_Name ; DS:SI -> Partition-Name
803 call VideoIO_LetUserEditString ; -> does actual editing
804 jnc PSCPN_AllDone ; Did user abort ?
805
806 test byte ptr [ChangePartNameSave], 1
807 jz PSCPN_AllDone ; Actually we just skip BR/LVM-Save
808
809 ; Check, where to save 2nd destination to...
810
811 ;movzx bx, dl
812 mov bl,dl
813 mov bh,0
814
815 cmp byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM
816 je PSCPN_SaveBootRecord
817
818
819 ; Make DI point to LVM VolumeName in LVM-entry
820 ;~ sub di,20
821
822 ; Points to LVM VolumeName.
823 push di
824
825 ; -------------------------------------------------[LVM SAVE VOLUME NAME]---
826 ; Copy 11 bytes from IPT into LVM VolumeName, back-padd with zero's
827 mov cx, 11
828 push si
829 rep movsb
830 pop si
831
832 ; Padd with zero's, but the editor still might have left spaces
833 ; at the end of the 11-byte part. We correct that below.
834 xor al, al
835 mov cx, 9
836 rep stosb
837
838
839 ;
840 ; The AiR-BOOT Label Editor inserts spaces when a label is edited
841 ; and characters are backspaced.
842 ; This is fine for filesystem labels, which are space padded,
843 ; but the LVM VolumeName and PartitionName need to be zero padded.
844 ; So, below we replace all trailing spaces with zero's.
845 ;
846 ; Correct LVM VolumeName
847 ;
848 mov cx,20
849 vn_padd_next:
850 jcxz vn_padded
851 dec di
852 dec cx
853 mov al,[di]
854 test al,al
855 jz vn_padd_next
856 cmp al,' '
857 jnz vn_padded
858 mov byte ptr [di],0
859 jmp vn_padd_next
860 vn_padded:
861
862 ; Points to LVM VolumeName
863 pop di
864
865 ; See if LVM-labels need to be synced.
866 test byte ptr [SyncLvmLabels],1
867 jz LVM_no_sync_labels
868
869 ; Sync LVM-labels.
870 mov si,di
871 add di,LocLVM_LabelLen
872 mov cx,LocLVM_LabelLen
873 cld
874 rep movsb
875
876
877 LVM_no_sync_labels:
878 ; Update LVM-CRC now...
879 mov si, offset LVMSector
880 call LVM_UpdateSectorCRC
881 IFDEF ReleaseCode
882 call DriveIO_SaveLVMSector ; Save sector
883 ENDIF
884 jmp PSCPN_AllDone
885
886 ; -----------------------------------------------------[BOOT-RECORD SAVE]---
887 ; BOOKMARK: Save Boot Record (After change from Setup Menu)
888 PSCPN_SaveBootRecord:
889 ; Copy 11 bytes from IPT to Boot-Record
890 mov cx, 11
891 push si
892 rep movsb ; Copy IPT-name to Boot-Record
893 pop si
894 IFDEF ReleaseCode
895 call DriveIO_SavePartition ; Saves Boot-Record
896 ENDIF
897
898 ; And reset VIBR-CRC, otherwise virus-warning and system-halt
899 ; BOOKMARK: Update CRC on Partition Sector
900 sub si, LocIPT_Name ; Now pointer points to base again...
901 mov bx, offset [PartitionSector]
902 call PART_UpdateBootRecordCRC
903
904 PSCPN_AllDone:
905 ; This here is done for safety, because we misused CurPartition_Location
906 xor ax, ax
907 mov di, offset CurPartition_Location
908 mov cx, 4
909 rep stosw ; NUL out CurPartition_Location
910 ret
911PARTSETUP_ChangePartitionName EndP
912
913; =============================================================================
914; This is called from MBRS_Routines_PartitionSetup
915; In: DL - Partition to HiddenSetup
916; Destroyed: ax
917PARTHIDESETUP_Main Proc Near Uses dx
918 ; Spread Special-Marker from Hide-Config
919 call PARTHIDESETUP_GetHideConfigAndSpread
920 ; Calculate Position of Window.
921 ; If Partition Selected Left-Side -> go Right-Sided Window
922 ; otherwise Left-Sided.
923 mov [PartSetup_ActivePart], dl
924 mov ax, 0102h
925 and dl, 1
926 jnz PHSM_FirstStep
927 mov ax, 002Ah
928 PHSM_FirstStep:
929 mov [PartSetup_HiddenX], al
930 mov [PartSetup_HiddenAdd], ah
931
932 ; Draw Menu...
933 xor dx, dx
934 mov [PartSetup_HiddenUpper], dl
935 call PARTHIDESETUP_DrawMenuBase
936 call PARTHIDESETUP_RefreshPartitions
937 ; Show Choice-Bar at DH...
938 call PARTHIDESETUP_BuildChoiceBar
939
940 ; Now we got everything on-the-screen
941 PHSM_MainLoop:
942 mov ah, 0
943 int 16h
944 cmp ah, Keys_Up
945 je PHSM_KeyUp
946 cmp ah, Keys_Down
947 je PHSM_KeyDown
948 cmp ah, Keys_ESC
949 je PHSM_KeyESC
950 cmp ah, Keys_F1
951 je PHSM_KeyF1
952 cmp ah, Keys_ENTER
953 je PHSM_KeyToogle
954 cmp ah, Keys_Plus
955 je PHSM_KeyToogle
956 cmp ah, Keys_Minus
957 je PHSM_KeyToogle
958 cmp ah, Keys_GrayPlus
959 je PHSM_KeyToogle
960 cmp ah, Keys_GrayMinus
961 je PHSM_KeyToogle
962 cmp ah, Keys_PageDown
963 je PHSM_KeyToogle
964 cmp ah, Keys_PageUp
965 je PHSM_KeyToogle
966 ; ASCII values...
967 cmp al, Keys_Space
968 je PHSM_KeyToogle
969 jmp PHSM_MainLoop
970
971 PHSM_KeyESC:
972 ; Collect Hide-Partition-Config and put it into Hide-Table
973 mov dl, [PartSetup_ActivePart]
974
975IFDEF AUX_DEBUG
976 ;~ pusha
977 ;~ mov al,dl ; Partition the hiding is set for.
978 ;~ call AuxIO_TeletypeHexByte
979 ;~ call AuxIO_TeletypeNL
980 ;~ popa
981ENDIF
982
983 call PARTHIDESETUP_CollectHideConfigAndPutToTable
984 ; Simply return to Partition Setup
985 ret
986
987 PHSM_KeyUp:
988 dec dh
989 call PARTHIDESETUP_BuildChoiceBar
990 jmp PHSM_MainLoop
991
992 PHSM_KeyDown:
993 inc dh
994 call PARTHIDESETUP_BuildChoiceBar
995 jmp PHSM_MainLoop
996
997 PHSM_KeyToogle:
998
999IFDEF AUX_DEBUG
1000 ;~ pusha
1001 ;~ mov al,dl ; Index of partition to set Special Marker on.
1002 ;~ call AuxIO_TeletypeHexByte
1003 ;~ call AuxIO_TeletypeNL
1004 ;~ popa
1005ENDIF
1006
1007 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1008 mov al, [si+LocIPT_Flags]
1009 xor al, Flags_SpecialMarker
1010 mov [si+LocIPT_Flags], al
1011 call PARTHIDESETUP_DrawPartitionInfo
1012 call PARTHIDESETUP_BuildChoiceBar
1013 jmp PHSM_MainLoop
1014
1015 PHSM_KeyF1:
1016 mov bx, offset TXT_SETUPHELP_HideSetup
1017 call SETUP_ShowHelp ; Shows help
1018 jmp PHSM_MainLoop
1019PARTHIDESETUP_Main EndP
1020
1021; Draw all standard-things for HiddenSetup, dynamic content not included.
1022PARTHIDESETUP_DrawMenuBase Proc Near Uses dx
1023 ; PartSetup_HiddenX1
1024
1025
1026
1027CLR_PART_HIDE_WINDOW_BASE_CLASSIC = 0d05h
1028CLR_PART_HIDE_WINDOW_BASE_BM = 0a02h
1029CLR_PART_HIDE_WINDOW_BASE_TB = 0a02h
1030IFDEF TESTBUILD
1031CLR_PART_HIDE_WINDOW_BASE = CLR_PART_HIDE_WINDOW_BASE_TB
1032ELSE
1033CLR_PART_HIDE_WINDOW_BASE = CLR_PART_HIDE_WINDOW_BASE_BM
1034ENDIF
1035
1036 mov cx, CLR_PART_HIDE_WINDOW_BASE ; Lila on lila
1037 call VideoIO_Color
1038 mov bh, 05h
1039 mov bl, [PartSetup_HiddenX]
1040 mov dh, 10h
1041 mov dl, bl
1042 add dl, 25h
1043 add dl, [PartSetup_HiddenAdd]
1044 push bx
1045 call VideoIO_MakeWindow
1046 pop bx
1047 ; --- Make Window-Header - "Hide Feature" at top frame-line
1048 inc bl
1049 mov cx, bx
1050 call VideoIO_Locate
1051 mov al, 'µ'
1052 call VideoIO_PrintSingleChar
1053
1054
1055
1056CLR_PART_HIDE_WINDOW_LABEL_CLASSIC = 0e05h
1057CLR_PART_HIDE_WINDOW_LABEL_BM = 0e02h
1058CLR_PART_HIDE_WINDOW_LABEL_TB = 0e02h
1059IFDEF TESTBUILD
1060CLR_PART_HIDE_WINDOW_LABEL = CLR_PART_HIDE_WINDOW_LABEL_TB
1061ELSE
1062CLR_PART_HIDE_WINDOW_LABEL = CLR_PART_HIDE_WINDOW_LABEL_BM
1063ENDIF
1064
1065 mov cx, CLR_PART_HIDE_WINDOW_LABEL ; Yellow on Lila
1066 call VideoIO_Color
1067 mov si, offset TXT_SETUP_HideFeature
1068 call VideoIO_Print
1069
1070
1071
1072CLR_PART_HIDE_WINDOW_BORDER_CLASSIC = 0d05h
1073CLR_PART_HIDE_WINDOW_BORDER_BM = 0d02h
1074CLR_PART_HIDE_WINDOW_BORDER_TB = 0d02h
1075IFDEF TESTBUILD
1076CLR_PART_HIDE_WINDOW_BORDER = CLR_PART_HIDE_WINDOW_BORDER_TB
1077ELSE
1078CLR_PART_HIDE_WINDOW_BORDER = CLR_PART_HIDE_WINDOW_BORDER_BM
1079ENDIF
1080
1081 mov cx, CLR_PART_HIDE_WINDOW_BASE ; Lila on lila
1082 call VideoIO_Color
1083 mov al, 'Æ'
1084 call VideoIO_PrintSingleChar
1085 ; --- Make Window-Footer - "State when booting..." at bottom right frame-line
1086 mov cx, CLR_PART_HIDE_WINDOW_BORDER ; Lila on lila
1087 call VideoIO_Color
1088 mov dh, 10h
1089 mov dl, [PartSetup_HiddenX]
1090 add dl, 25h
1091 add dl, [PartSetup_HiddenAdd] ; Location 16, HiddenX->right aligned
1092 mov si, offset TXT_SETUP_HideFeature2
1093 call GetLenOfString ; CX - Length of HideFeature2
1094 sub dl, cl ; Adjust Position
1095 push dx
1096 mov dl, [PartSetup_ActivePart]
1097 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1098 pop dx
1099 ; Display "Label" field without ending NULs/Spaces
1100 add si, LocIPT_Name
1101 mov cx, 11
1102 call GetLenOfName
1103 sub dl, cl ; Adjust position
1104 sub dl, 2
1105 push cx
1106 push si ; SI == Label Field
1107 mov cx, dx
1108 call VideoIO_Locate
1109 mov al, '<'
1110 call VideoIO_PrintSingleChar
1111 mov si, offset TXT_SETUP_HideFeature2
1112 call VideoIO_Print
1113 pop si
1114 pop cx
1115 call VideoIO_FixedPrint
1116 mov al, '>'
1117 call VideoIO_PrintSingleChar
1118
1119; inc cl
1120; call MBR_Locate ; Location 16, HiddenX
1121; mov al, 'µ'
1122; call MBR_PrintSingleChar
1123; mov cx, 0E05h ; Yellow on Lila
1124; call MBR_Color
1125; mov si, offset TXT_SETUP_HideFeature2
1126; call MBR_Print
1127; mov dl, PartSetup_ActivePart
1128; call MBR_Part_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1129; ; Display "Label" field without ending NULs/Spaces
1130; add si, LocIPT_Name
1131; mov cx, 11
1132; call MBR_GetLenOfName
1133; call MBR_FixedPrint
1134; mov cx, 0D05h ; Lila on lila
1135; call MBR_Color
1136; mov al, 'Æ'
1137; call MBR_PrintSingleChar
1138
1139 ; --- Make ':' Line down
1140
1141
1142
1143CLR_PART_HIDE_MENU_BASE_CLASSIC = 0f05h
1144CLR_PART_HIDE_MENU_BASE_BM = 0f02h
1145CLR_PART_HIDE_MENU_BASE_TB = 0f02h
1146IFDEF TESTBUILD
1147CLR_PART_HIDE_MENU_BASE = CLR_PART_HIDE_MENU_BASE_TB
1148ELSE
1149CLR_PART_HIDE_MENU_BASE = CLR_PART_HIDE_MENU_BASE_BM
1150ENDIF
1151
1152 mov cx, CLR_PART_HIDE_MENU_BASE ; Yellow on Lila
1153 call VideoIO_Color
1154 mov ch, 07h
1155 mov cl, PartSetup_HiddenX
1156 add cl, 24
1157 add cl, PartSetup_HiddenAdd
1158 call VideoIO_Locate
1159 mov al, ':'
1160 mov cl, 8
1161 call VideoIO_Internal_MakeWinDown
1162 ret
1163PARTHIDESETUP_DrawMenuBase EndP
1164
1165; Draw all partitions to Hidden-Setup aka Dynamic Content-Draw
1166PARTHIDESETUP_RefreshPartitions Proc Near Uses dx
1167 mov dl, [PartSetup_HiddenUpper]
1168 mov dh, 8
1169 PHSRP_Loop:
1170 call PARTHIDESETUP_DrawPartitionInfo
1171 inc dl
1172 dec dh
1173 jnz PHSRP_Loop
1174
1175
1176
1177CLR_PART_HIDE_MENU_MARKERS_CLASSIC = 0d05h
1178CLR_PART_HIDE_MENU_MARKERS_BM = 0a02h
1179CLR_PART_HIDE_MENU_MARKERS_TB = 0a02h
1180IFDEF TESTBUILD
1181CLR_PART_HIDE_MENU_MARKERS = CLR_PART_HIDE_MENU_MARKERS_TB
1182ELSE
1183CLR_PART_HIDE_MENU_MARKERS = CLR_PART_HIDE_MENU_MARKERS_BM
1184ENDIF
1185
1186 ; At last calculate Scroll-Markers
1187 mov cx, CLR_PART_HIDE_MENU_MARKERS ; Lila on lila ; Hide Feature Markers
1188 call VideoIO_Color
1189 mov cx, 0603h ; 6, +3
1190 add cl, [PartSetup_HiddenX]
1191 mov dl, [PartSetup_HiddenUpper]
1192 call PARTSETUP_UpperScrollMarker
1193 add cl, 29
1194 add cl, [PartSetup_HiddenAdd] ; 6, +29
1195 call PARTSETUP_UpperScrollMarker
1196 mov cx, 0F03h ; 15, +3
1197 add cl, [PartSetup_HiddenX]
1198 add dl, 8 ; add 8 -> points to last partition
1199 mov dh, [CFG_Partitions] ; Limit
1200 call PARTSETUP_LowerScrollMarker
1201 add cl, 29
1202 add cl, [PartSetup_HiddenAdd] ; 6, +29
1203 call PARTSETUP_LowerScrollMarker
1204 ret
1205PARTHIDESETUP_RefreshPartitions EndP
1206
1207PARTHIDESETUP_DrawPartitionInfo Proc Near Uses dx
1208 local NoOfPart :byte
1209 mov ch, dl
1210 sub ch, [PartSetup_HiddenUpper]
1211 add ch, 7
1212 mov cl, 2
1213 add cl, [PartSetup_HiddenX]
1214 ; We got location
1215 mov NoOfPart, dl
1216 call VideoIO_Locate
1217
1218 ; Clean data-area...
1219 push cx
1220 mov al, ' '
1221 mov cl, 22
1222 call VideoIO_PrintSingleMultiChar
1223 pop cx
1224
1225 cmp dl, [CFG_Partitions]
1226 jae PHSDPI_NoData
1227
1228 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1229 call VideoIO_Locate
1230 push cx
1231 ; Display "Label" field aka "OS2" without ending NULs/Spaces
1232
1233
1234
1235CLR_PART_HIDE_LABEL_CLASSIC = 0f05h
1236CLR_PART_HIDE_LABEL_BM = 0f02h
1237CLR_PART_HIDE_LABEL_TB = 0f02h
1238IFDEF TESTBUILD
1239CLR_PART_HIDE_LABEL = CLR_PART_HIDE_LABEL_TB
1240ELSE
1241CLR_PART_HIDE_LABEL = CLR_PART_HIDE_LABEL_BM
1242ENDIF
1243
1244 mov cx, CLR_PART_HIDE_LABEL
1245 call VideoIO_Color ; Bright White on Lila
1246 push si
1247 add si, LocIPT_Name
1248 mov cx, 11
1249 call GetLenOfName
1250 call VideoIO_FixedPrint
1251 pop si
1252
1253
1254
1255CLR_PART_HIDE_WINDOW_FS_CLASSIC = 0d05h
1256CLR_PART_HIDE_WINDOW_FS_BM = 0a02h
1257CLR_PART_HIDE_WINDOW_FS_TB = 0a02h
1258IFDEF TESTBUILD
1259CLR_PART_HIDE_WINDOW_FS = CLR_PART_HIDE_WINDOW_FS_TB
1260ELSE
1261CLR_PART_HIDE_WINDOW_FS = CLR_PART_HIDE_WINDOW_FS_BM
1262ENDIF
1263
1264 mov cx, CLR_PART_HIDE_WINDOW_FS
1265 call VideoIO_Color ; Bright Lila on Lila
1266 mov al, ' '
1267 call VideoIO_PrintSingleChar
1268 mov al, '['
1269 call VideoIO_PrintSingleChar
1270 ; Display "Type" field aka "HPFS" without ending NULs/Spaces
1271 push si
1272 mov al, [si+LocIPT_SystemID]
1273 call PART_SearchFileSysName
1274 mov cx, 8
1275 call GetLenOfName
1276 call VideoIO_FixedPrint
1277 pop si
1278 mov al, ']'
1279 call VideoIO_PrintSingleChar
1280 pop cx
1281 add cl, 24
1282 add cl, PartSetup_HiddenAdd
1283 call VideoIO_Locate
1284 push cx
1285
1286
1287
1288CLR_PART_HIDE_WINDOW_CHOISES_CLASSIC = 0e05h
1289CLR_PART_HIDE_WINDOW_CHOISES_BM = 0e02h
1290CLR_PART_HIDE_WINDOW_CHOISES_TB = 0e02h
1291IFDEF TESTBUILD
1292CLR_PART_HIDE_WINDOW_CHOISES = CLR_PART_HIDE_WINDOW_CHOISES_TB
1293ELSE
1294CLR_PART_HIDE_WINDOW_CHOISES = CLR_PART_HIDE_WINDOW_CHOISES_BM
1295ENDIF
1296
1297 mov cx, CLR_PART_HIDE_WINDOW_CHOISES
1298 call VideoIO_Color ; Yellow on Lila
1299 mov al, ' '
1300 mov cl, 10
1301 call VideoIO_PrintSingleMultiChar ; Fill up area with spaces
1302 ; Finally draw Hidden/Unhidden
1303 mov bl, [si+LocIPT_Flags]
1304 mov si, offset TXT_SETUP_MAGIC_Unhidden
1305 and bl, Flags_SpecialMarker
1306 jz PHSDPI_IsNotHidden
1307 mov si, offset TXT_SETUP_MAGIC_Hidden
1308 PHSDPI_IsNotHidden:
1309 call GetLenOfString
1310 mov dx, cx
1311 pop cx
1312 add cx, 10
1313 sub cx, dx
1314 call VideoIO_Locate
1315 call VideoIO_Print
1316 PHSDPI_NoData:
1317 ret
1318PARTHIDESETUP_DrawPartitionInfo EndP
1319
1320; In: DL - Current Active (to be inactivated)
1321; DH - New Active (to be activated)
1322; Destroyed: None
1323PARTHIDESETUP_BuildChoiceBar Proc Near
1324 cmp dl, dh
1325 je PHSBCB_SkipRetrace
1326 call VideoIO_WaitRetrace
1327 PHSBCB_SkipRetrace:
1328
1329
1330
1331CLR_PART_HIDE_WINDOW_MENU_BAR_CLASSIC = 5eh
1332CLR_PART_HIDE_WINDOW_MENU_BAR_BM = 2eh
1333CLR_PART_HIDE_WINDOW_MENU_BAR_TB = 2eh
1334IFDEF TESTBUILD
1335CLR_PART_HIDE_WINDOW_MENU_BAR = CLR_PART_HIDE_WINDOW_MENU_BAR_TB
1336ELSE
1337CLR_PART_HIDE_WINDOW_MENU_BAR = CLR_PART_HIDE_WINDOW_MENU_BAR_BM
1338ENDIF
1339
1340 ; Deactivate current active bar
1341 mov cl, CLR_PART_HIDE_WINDOW_MENU_BAR ; Yellow on Lila
1342 call PARTHIDESETUP_ReColorPart
1343
1344 ; Running Fixing
1345 cmp dh, 0FFh
1346 jne PHSBCB_NoUnderflow
1347 xor dh, dh
1348 PHSBCB_NoUnderflow:
1349 cmp dh, [CFG_Partitions]
1350 jb PHSBCB_NoOverflow
1351 mov dh, [CFG_Partitions]
1352 dec dh
1353 PHSBCB_NoOverflow:
1354 mov dl, dh
1355
1356 ; Do we need to scroll ?
1357 mov al, [PartSetup_HiddenUpper]
1358 cmp dl, al
1359 jb PHSBCB_YesScrolling
1360 add al, 8
1361 cmp dl, al
1362 jb PHSBCB_NoScrolling
1363 mov al, dl
1364 sub al, 7
1365 mov [PartSetup_HiddenUpper], al
1366 call PARTHIDESETUP_RefreshPartitions
1367 jmp PHSBCB_NoScrolling
1368 PHSBCB_YesScrolling:
1369 mov al, dl
1370 mov [PartSetup_HiddenUpper], al
1371 call PARTHIDESETUP_RefreshPartitions
1372 PHSBCB_NoScrolling:
1373
1374
1375
1376; Activate fresh active bar
1377CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_CLASSIC = 1fh
1378CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM = 1fh
1379CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_TB = 1fh
1380IFDEF TESTBUILD
1381CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR = CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_TB
1382ELSE
1383CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR = CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM
1384ENDIF
1385
1386 mov cl, CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR ; Bright White on Blue
1387 call PARTHIDESETUP_ReColorPart
1388 ; Now DL==DH
1389 ret
1390PARTHIDESETUP_BuildChoiceBar EndP
1391
1392; In: CL - Color, DL - Partition
1393; Destroyed: None, but Locate-Pointer
1394PARTHIDESETUP_ReColorPart Proc Near Uses bx cx es di
1395 mov bh, cl ; Color to BH
1396 ; First calculate location of bar
1397 cmp dl, [PartSetup_HiddenUpper]
1398 jb PHSRCP_NotInWindowView
1399 mov ch, dl
1400 sub ch, [PartSetup_HiddenUpper] ; CH - Position relative to HiddenUpper
1401 cmp ch, 8 ; 8 - Maximum Total in Window
1402 jae PHSRCP_NotInWindowView
1403 add ch, 7
1404 mov cl, 26
1405 add cl, [PartSetup_HiddenX]
1406 add cl, [PartSetup_HiddenAdd]
1407
1408 mov bl, 10 ; Length of Bar is 10
1409 call VideoIO_Locate ; geht zu CX
1410 call VideoIO_Internal_SetRegs
1411 inc di ; DI - Destination+1 -> Color-Byte
1412 mov cl, bl ; Length of Bar is always 39
1413 PHSRCP_ClearLoop:
1414 mov es:[di], bh
1415 add di, 2
1416 dec cl
1417 jnz PHSRCP_ClearLoop
1418 PHSRCP_NotInWindowView:
1419 ret
1420PARTHIDESETUP_ReColorPart EndP
1421
1422; =============================================================================
1423
1424
1425;
1426; Rousseau: Adjusted for packed hidden-part-table !
1427; Needs to be re-written.
1428;
1429; This is called by MBRS_PS_HiddenSetup
1430; In: DL - Partition, where to save Hide-Config
1431; Destroyed: None, but Locate-Pointer
1432PARTHIDESETUP_GetHideConfigAndSpread Proc Near Uses ax bx dx si di
1433 ; First check HideFeature-Flag on selected partition.
1434 ; if it's not set, don't do anything...
1435 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1436 mov al, [si+LocIPT_Flags]
1437 test al, Flags_HideFeature
1438 jz PHSGHCAS_EndOfEntries
1439 PHSGHCAS_SomethingHidden:
1440 ; Calculate, where to get Hide-Config
1441 mov ax, LocHPT_LenOfHPT ; Size of a hidden-part-table entry.
1442 mul dl ; Multiply by partition-index.
1443 mov di, offset HidePartitionTable
1444 add di, ax ; We got the pointer
1445
1446 ; So process Hide-Config. Read out Bitfield-Entries,
1447 ; each points to a partition.
1448 ; 3Fh is end-marker / maximum entries = CFG_Partitions
1449 mov cl, [CFG_Partitions]
1450 mov bx,di ; Pointer to hidden-parts entry for this partition.
1451 mov ch,0 ; Start index in hidden-parts entry for this partition.
1452 mov dh,6 ; Bitfields are 6 bits wide.
1453 PHSGHCAS_SpreadLoop:
1454 mov dl,ch ; Load bitfield index from CH.
1455 call CONV_GetBitfieldValue ; Get value of bitfield.
1456 mov dl,al ; Partition index in DL.
1457 ;~ mov dl, [di]
1458 ;~ inc di
1459 ;~ cmp dl, 0FFh
1460 cmp dl,3fh ; Max value for 6-bits field.
1461 je PHSGHCAS_EndOfEntries
1462 call PART_GetPartitionPointer ; Pointer for partition DL to SI
1463 mov al, [si+LocIPT_Flags]
1464 or al, Flags_SpecialMarker ; Set marker
1465 mov [si+LocIPT_Flags], al
1466 inc ch ; Next bitfield.
1467 dec cl
1468 jnz PHSGHCAS_SpreadLoop
1469 PHSGHCAS_EndOfEntries:
1470 ret
1471PARTHIDESETUP_GetHideConfigAndSpread EndP
1472
1473
1474;
1475; Rousseau: Adjusted for packed hidden-part-table !
1476; Needs to be re-written.
1477;
1478; This is called by MBRS_PS_HiddenSetup
1479; In: DL - Partition, where to save Hide-Config
1480; Destroyed: None, but Locate-Pointer
1481PARTHIDESETUP_CollectHideConfigAndPutToTable Proc Near Uses ax si es di
1482 ; First calculate, where to put Hide-Config
1483 ;~ mov ax, LocIPT_MaxPartitions
1484 mov ax, LocHPT_LenOfHPT ; Length of an HPT-entry.
1485 mul dl ; Partition to store info for.
1486 push cs
1487 pop es
1488 mov di, offset HidePartitionTable ; Packed hideparttable.
1489 add di, ax ; We got the pointer in DI.
1490
1491 ;~ push di
1492
1493 ; Fill hide-part-table entry with 'unused' marker.
1494 ; Note that the entry is actually an array of 45 6-bit bitfields.
1495 ; Below fills 34 bytes = 45 6-bit bitfields.
1496 push di
1497 mov cx, LocHPT_LenOfHPT
1498 mov al, 0FFh
1499 rep stosb ; Fill up with FFh
1500 pop di
1501
1502 ;~ mov bp,di
1503
1504 ; Now walk through the IPT collecting all SpecialMarkers.
1505 ; For each do a bitfield-entry containing the number of the partition.
1506 mov si, offset PartitionTable
1507 xor ch, ch ; Partition index
1508 mov cl, [CFG_Partitions] ; Nr. of partitions in IPT
1509 mov ah,0 ; Next hide-index to write.
1510
1511 ;
1512 ; Collect all partitions that have the special marker set.
1513 ; This marker was set by toggling the hide/unhide option in the setup menu.
1514 ;
1515 PHSCHCAPTT_CollectLoop:
1516
1517 ; Get marker and test it.
1518 mov bl, [si+LocIPT_Flags]
1519 test bl, Flags_SpecialMarker
1520
1521 ; No marker.
1522 jz PHSCHCAPTT_NoMarker
1523
1524 ; Setup stuff for bitfield operation.
1525 push dx ; Save partition pointer.
1526 push bx ; Save marker.
1527 mov bx,di ; Get pointer to HPT-entry.
1528 mov dl,ah ; Index in entry.
1529 mov dh,6 ; Bitfield width.
1530 push ax ; Save index.
1531 mov al,ch ; Partition index to store.
1532
1533
1534 IFDEF AUX_DEBUG
1535 ;~ pushf
1536 ;~ pusha
1537 ;~ push ax
1538 ;~ mov al,dl
1539 ;~ call AuxIO_TeletypeHexByte
1540 ;~ mov al,':'
1541 ;~ call AuxIO_Teletype
1542 ;~ mov ax,bx
1543 ;~ call AuxIO_TeletypeHexWord
1544 ;~ mov al,':'
1545 ;~ call AuxIO_Teletype
1546 ;~ mov ax,bp
1547 ;~ call AuxIO_TeletypeHexWord
1548 ;~ mov al,':'
1549 ;~ call AuxIO_Teletype
1550 ;~ mov ax,sp
1551 ;~ call AuxIO_TeletypeHexWord
1552 ;~ mov al,':'
1553 ;~ call AuxIO_Teletype
1554 ;~ pop ax
1555 ;~ call AuxIO_TeletypeHexByte
1556 ;~ call AuxIO_TeletypeNL
1557 ;~ popa
1558 ;~ popf
1559 ENDIF
1560
1561 call CONV_SetBitfieldValue ; Store bitfield.
1562 pop ax ; Restore index.
1563 pop bx ; Restore marker.
1564 pop dx ; Restore partition pointer.
1565
1566 inc ah ; Advance to next index.
1567
1568 ;~ mov ds:[di], ch ; Write byte-Entry
1569 ;~ inc di
1570 xor bl, Flags_SpecialMarker ; Reset Flag
1571 mov [si+LocIPT_Flags], bl ; Store it in IPT
1572
1573
1574 PHSCHCAPTT_NoMarker:
1575 add si, LocIPT_LenOfIPT ; Advance to next partition in IPT.
1576 inc ch ; Next partition-index.
1577 dec cl ; Decrement partitions to process.
1578 jnz PHSCHCAPTT_CollectLoop ; Are we done yet ?
1579
1580 ;~ pop si ; Original Hide-Config Pointer -> SI
1581 ; Now check, if we have written anything
1582 ;~ cmp si, di
1583 test ah,ah ; See if we had to store anything.
1584 jne PHSCHCAPTT_SomethingToHide ; Yep, go to write end-marker.
1585
1586 ; Nothing to hide...so UNSET the Hidden-Feature Flag
1587 call PART_GetPartitionPointer ; Use DL to get part-pointer in SI.
1588 mov al, [si+LocIPT_Flags] ; Get flags.
1589 mov ah, Flags_HideFeature ; Hide mask.
1590 not ah ; Complement.
1591 and al, ah ; Clear hide-flag.
1592 mov [si+LocIPT_Flags], al ; Store it.
1593 ;~ pop bp
1594 ret ; Return to caller.
1595
1596 PHSCHCAPTT_SomethingToHide:
1597 cmp ah, LocIPT_MaxPartitions ; See if index is at end.
1598 jae PHSCHCAPTT_AllUsed ; Yep, no need to store end-marker.
1599
1600 ; Write end-marker.
1601 push dx ; Save partition pointer.
1602 mov al,3fh ; End marker (6-bit)
1603 mov dl,ah ; Index in HPT-entry.
1604 mov dh,6 ; Bitfield width.
1605 mov bx,di ; Get pointer to HPT-entry.
1606 call CONV_SetBitfieldValue ; Store end-marker.
1607 pop dx ; Restore partition pointer.
1608
1609 ;~ mov ax, si
1610 ;~ add ax, LocIPT_MaxPartitions
1611 ;~ cmp di, ax
1612 ;~ jae PHSCHCAPTT_AllUsed
1613 ; Set END-marker
1614 ;~ mov al, 0FFh
1615 ;~ stosb ; Write byte-Entry
1616 PHSCHCAPTT_AllUsed:
1617
1618 ; Something to hide...so SET the Hidden-Feature Flag
1619 call PART_GetPartitionPointer ; Use DL to get part-pointer in SI.
1620 mov al, [si+LocIPT_Flags] ; Get flags.
1621 or al, Flags_HideFeature ; Set hide-flag.
1622 mov [si+LocIPT_Flags], al ; Store it.
1623 ;~ pop bp
1624 ret ; Return to caller.
1625PARTHIDESETUP_CollectHideConfigAndPutToTable EndP
1626
1627; =============================================================================
1628
1629; This is called from MBRS_Routines_PartitionSetup
1630; In: DL - Partition to LogicalDriveLetter-Setup
1631; Destroyed: ax
1632PARTSETUP_DriveLetterSetup Proc Near Uses dx si es di
1633 call PART_GetPartitionPointer ; Gets the PartitionPointer for DL in SI
1634 ; SystemID must support DriveLetter feature (FAT16, HPFS, JFS)
1635 mov al, bptr [si+LocIPT_SystemID]
1636 push si
1637 call PART_SearchFileSysName
1638 pop si
1639 test ah, FileSysFlags_DriveLetter
1640 jnz PSDLS_GotLDLP
1641
1642 ; Drive-Letter feature only possible on HPFS/FAT16 (OS/2) systems
1643 mov cx, 0C04h
1644 mov si, offset TXT_SETUP_NoLDLpartition
1645 call SETUP_ShowErrorBox
1646 ret
1647
1648 PSDLS_GotLDLP:
1649 ; First build up menu and display current setting...
1650 call PARTSETUPDL_DrawMenuBase ; DL - partition-no
1651
1652 ; Now get the Logical-Drive-Letter for that partition...
1653 ;movzx bx, dl
1654 mov bl,dl
1655 mov bh,0
1656
1657 mov dl, byte ptr [DriveLetters+bx]
1658
1659 push bx
1660 ; DS:SI - IPT Entry of Partition, DL - LogicalDriveLetter
1661 call PARTSETUPDL_DrawDriveLetter
1662
1663 ; Now we got everything on-the-screen
1664 PSDLS_MainLoop:
1665 mov ah, 0
1666 int 16h
1667 cmp ah, Keys_Backspace
1668 je PSDLS_BackSpace
1669 cmp ah, Keys_Up
1670 je PSDLS_KeyUp
1671 cmp ah, Keys_Down
1672 je PSDLS_KeyDown
1673 cmp ah, Keys_ESC
1674 je PSDLS_KeyDONE
1675 cmp ah, Keys_ENTER
1676 je PSDLS_KeyDONE
1677 ; Direct-Letter-Input
1678 or al, 20h ; Lower-Case Input
1679 cmp al, 'c'
1680 jb PSDLS_MainLoop
1681 cmp al, 'z'
1682 ja PSDLS_MainLoop
1683 mov dl, al
1684 add dl, 1Dh ; -> Convert to used logic
1685 call PARTSETUPDL_DrawDriveLetter
1686 jmp PSDLS_MainLoop
1687
1688
1689 ; Clear drive-letter with backspace
1690 PSDLS_BackSpace:
1691 xor dl,dl
1692 call PARTSETUPDL_DrawDriveLetter
1693 jmp PSDLS_MainLoop
1694
1695 PSDLS_KeyUp:
1696 dec dl
1697 cmp dl, 7Fh
1698 jne PSDLS_KeyUpFix1
1699 xor dl, dl
1700 PSDLS_KeyUpFix1:
1701 cmp dl, 97h
1702 jbe PSDLS_KeyUpFix2
1703 mov dl, 97h
1704 PSDLS_KeyUpFix2:
1705 call PARTSETUPDL_DrawDriveLetter
1706 jmp PSDLS_MainLoop
1707
1708 PSDLS_KeyDown:
1709 inc dl
1710 cmp dl, 97h
1711 jbe PSDLS_KeyDownFix1
1712 xor dl, dl
1713 PSDLS_KeyDownFix1:
1714 cmp dl, 01h
1715 jne PSDLS_KeyDownFix2
1716 mov dl, 80h
1717 PSDLS_KeyDownFix2:
1718 call PARTSETUPDL_DrawDriveLetter
1719 jmp PSDLS_MainLoop
1720
1721
1722 PSDLS_KeyDONE:
1723 ; Write Drive-Letter into DriveLetter-Table
1724 pop bx
1725 mov bptr [DriveLetters+bx], dl
1726 mov al, ds:[si+LocIPT_Flags]
1727 mov ah, Flags_DriveLetter
1728 not ah
1729 and al, ah
1730 or dl, dl
1731 jz PSDLS_NoFlag
1732 or al, Flags_DriveLetter
1733 PSDLS_NoFlag:
1734 mov ds:[si+LocIPT_Flags], al
1735 ret
1736PARTSETUP_DriveLetterSetup EndP
1737
1738; Draw all standard-things for DriveLetterSetup, dynamic content not included.
1739PARTSETUPDL_DrawMenuBase Proc Near Uses dx si
1740 ; Calculate Position of Window.
1741 ; If Partition Selected Left-Side -> go Right-Sided Window
1742 ; otherwise Left-Sided.
1743 mov PartSetup_ActivePart, dl
1744 mov al, 8 ; X-Pos = 8
1745 and dl, 1
1746 jnz PSDLDMB_FirstStep
1747 mov al, 30h ; X-Pos = 48
1748 PSDLDMB_FirstStep:
1749 mov PartSetup_HiddenX, al
1750
1751
1752
1753; Draw base-window
1754CLR_PART_DL_XX_CLASSIC = 0d05h
1755CLR_PART_DL_XX_BM = 0a02h
1756CLR_PART_DL_XX_TB = 0a02h
1757IFDEF TESTBUILD
1758CLR_PART_DL_XX = CLR_PART_DL_XX_TB
1759ELSE
1760CLR_PART_DL_XX = CLR_PART_DL_XX_BM
1761ENDIF
1762
1763 mov cx, CLR_PART_DL_XX ; Lila on lila
1764 call VideoIO_Color
1765 mov bh, 06h
1766 mov bl, [PartSetup_HiddenX]
1767 mov dh, 0Ah
1768 mov dl, bl
1769 add dl, 16h
1770 push bx
1771 call VideoIO_MakeWindow
1772 pop bx
1773 ; Make Window-Header
1774 inc bl
1775 push bx
1776 mov cx, bx
1777 call VideoIO_Locate
1778 mov al, 'µ'
1779 call VideoIO_PrintSingleChar
1780
1781
1782
1783CLR_PART_DL_WINDOW_TITLE_CLASSIC = 0e05h
1784CLR_PART_DL_WINDOW_TITLE_BM = 0e02h
1785CLR_PART_DL_WINDOW_TITLE_TB = 0e02h
1786IFDEF TESTBUILD
1787CLR_PART_DL_WINDOW_TITLE = CLR_PART_DL_WINDOW_TITLE_TB
1788ELSE
1789CLR_PART_DL_WINDOW_TITLE = CLR_PART_DL_WINDOW_TITLE_BM
1790ENDIF
1791
1792 mov cx, CLR_PART_DL_WINDOW_TITLE ; Yellow on Lila
1793 call VideoIO_Color
1794 mov si, offset TXT_SETUP_DriveLetter
1795 call VideoIO_Print
1796
1797
1798
1799CLR_PART_DL_WINDOW_BORDER2_CLASSIC = 0d05h
1800CLR_PART_DL_WINDOW_BORDER2_BM = 0a02h
1801CLR_PART_DL_WINDOW_BORDER2_TB = 0a02h
1802IFDEF TESTBUILD
1803CLR_PART_DL_WINDOW_BORDER2 = CLR_PART_DL_WINDOW_BORDER2_TB
1804ELSE
1805CLR_PART_DL_WINDOW_BORDER2 = CLR_PART_DL_WINDOW_BORDER2_BM
1806ENDIF
1807
1808 mov cx, CLR_PART_DL_WINDOW_BORDER2 ; Lila on lila
1809 call VideoIO_Color
1810 mov al, 'Æ'
1811 call VideoIO_PrintSingleChar
1812 pop bx
1813 ; Display help-information
1814 mov si, offset TXT_SETUPHELP_DriveLetter
1815
1816
1817
1818CLR_PART_DL_SETUP_HELP_CLASSIC = 0d05h
1819CLR_PART_DL_SETUP_HELP_BM = 0a02h
1820CLR_PART_DL_SETUP_HELP_TB = 0a02h
1821IFDEF TESTBUILD
1822CLR_PART_DL_SETUP_HELP = CLR_PART_DL_SETUP_HELP_TB
1823ELSE
1824CLR_PART_DL_SETUP_HELP = CLR_PART_DL_SETUP_HELP_BM
1825ENDIF
1826
1827 mov cx, CLR_PART_DL_SETUP_HELP ; Lila on lila
1828 call VideoIO_Color
1829
1830 call GetLenOfString ; CX - Len of string
1831 mov dx, cx
1832 mov cx, bx
1833 add cx, 0413h
1834 sub cl, dl
1835 call VideoIO_Locate
1836 mov al, '<'
1837 call VideoIO_PrintSingleChar
1838 call VideoIO_Print
1839 mov al, '>'
1840 call VideoIO_PrintSingleChar
1841 ;
1842 mov cx, 0F01h ; Bright White on Blue
1843 call VideoIO_Color
1844 mov cx, 0805h ; Position 8, 5
1845 add cl, PartSetup_HiddenX
1846 call VideoIO_Locate
1847 mov al, ' '
1848 mov cl, 12
1849 call VideoIO_PrintSingleMultiChar
1850 ret
1851PARTSETUPDL_DrawMenuBase EndP
1852
1853; Writes Logical Drive-Letter to Screen (Logical-Drive-Letter-Setup)
1854; In: DL - Logical Drive-Letter Byte
1855; Destroyed: None
1856PARTSETUPDL_DrawDriveLetter Proc Near Uses si
1857 ; 00h -> standard drive letter
1858 ; 80h -> use C: as drive letter
1859 ; 97h -> use Z: as drive letter
1860 push dx
1861 mov cx, 0805h ; Position 8, 5
1862 add cl, [PartSetup_HiddenX]
1863 call VideoIO_Locate
1864 add cl, 6 ; Everything centered (12/2)
1865 push cx
1866 mov al, ' '
1867 mov cl, 12
1868 call VideoIO_PrintSingleMultiChar ; Fill up area with spaces
1869
1870 or dl, dl
1871 jnz PSDLDDL_Letter
1872 mov si, offset TXT_SETUP_MAGIC_Disabled
1873 call GetLenOfString
1874 mov dx, cx
1875 pop cx
1876 call VideoIO_LocateToCenter ; LocateToCenter using TotalLen
1877 call VideoIO_Print
1878 pop dx
1879 ret
1880
1881 PSDLDDL_Letter:
1882 mov si, offset TXT_SETUP_MAGIC_Set
1883 call GetLenOfString
1884 mov dx, cx
1885 add dx, 2
1886 pop cx
1887 call VideoIO_LocateToCenter ; LocateToCenter using TotalLen
1888 call VideoIO_Print
1889 pop dx
1890 mov al, dl
1891 sub al, 3Dh
1892 call VideoIO_PrintSingleChar
1893 mov al, ':'
1894 call VideoIO_PrintSingleChar
1895 ret
1896PARTSETUPDL_DrawDriveLetter EndP
Note: See TracBrowser for help on using the repository browser.