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

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

Removed the ancient 'ReleaseCode' conditional [v1.1.1-testing]

This was used in pre v1.07 versions to create a DOS .COM executable
for debugging. It has never been used in v1.07+ versions and debugging
is now done using the serial port from native AirBoot. Time to get rid
of this unused stuff.

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.0 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 OS/2 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
882 call DriveIO_SaveLVMSector ; Save sector
883
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
895 call DriveIO_SavePartition ; Saves Boot-Record
896
897 ; And reset VIBR-CRC, otherwise virus-warning and system-halt
898 ; BOOKMARK: Update CRC on Partition Sector
899 sub si, LocIPT_Name ; Now pointer points to base again...
900 mov bx, offset [PartitionSector]
901 call PART_UpdateBootRecordCRC
902
903 PSCPN_AllDone:
904 ; This here is done for safety, because we misused CurPartition_Location
905 xor ax, ax
906 mov di, offset CurPartition_Location
907 mov cx, 4
908 rep stosw ; NUL out CurPartition_Location
909 ret
910PARTSETUP_ChangePartitionName EndP
911
912; =============================================================================
913; This is called from MBRS_Routines_PartitionSetup
914; In: DL - Partition to HiddenSetup
915; Destroyed: ax
916PARTHIDESETUP_Main Proc Near Uses dx
917 ; Spread Special-Marker from Hide-Config
918 call PARTHIDESETUP_GetHideConfigAndSpread
919 ; Calculate Position of Window.
920 ; If Partition Selected Left-Side -> go Right-Sided Window
921 ; otherwise Left-Sided.
922 mov [PartSetup_ActivePart], dl
923 mov ax, 0102h
924 and dl, 1
925 jnz PHSM_FirstStep
926 mov ax, 002Ah
927 PHSM_FirstStep:
928 mov [PartSetup_HiddenX], al
929 mov [PartSetup_HiddenAdd], ah
930
931 ; Draw Menu...
932 xor dx, dx
933 mov [PartSetup_HiddenUpper], dl
934 call PARTHIDESETUP_DrawMenuBase
935 call PARTHIDESETUP_RefreshPartitions
936 ; Show Choice-Bar at DH...
937 call PARTHIDESETUP_BuildChoiceBar
938
939 ; Now we got everything on-the-screen
940 PHSM_MainLoop:
941 mov ah, 0
942 int 16h
943 cmp ah, Keys_Up
944 je PHSM_KeyUp
945 cmp ah, Keys_Down
946 je PHSM_KeyDown
947 cmp ah, Keys_ESC
948 je PHSM_KeyESC
949 cmp ah, Keys_F1
950 je PHSM_KeyF1
951 cmp ah, Keys_ENTER
952 je PHSM_KeyToogle
953 cmp ah, Keys_Plus
954 je PHSM_KeyToogle
955 cmp ah, Keys_Minus
956 je PHSM_KeyToogle
957 cmp ah, Keys_GrayPlus
958 je PHSM_KeyToogle
959 cmp ah, Keys_GrayMinus
960 je PHSM_KeyToogle
961 cmp ah, Keys_PageDown
962 je PHSM_KeyToogle
963 cmp ah, Keys_PageUp
964 je PHSM_KeyToogle
965 ; ASCII values...
966 cmp al, Keys_Space
967 je PHSM_KeyToogle
968 jmp PHSM_MainLoop
969
970 PHSM_KeyESC:
971 ; Collect Hide-Partition-Config and put it into Hide-Table
972 mov dl, [PartSetup_ActivePart]
973
974IFDEF AUX_DEBUG
975 ;~ pusha
976 ;~ mov al,dl ; Partition the hiding is set for.
977 ;~ call AuxIO_TeletypeHexByte
978 ;~ call AuxIO_TeletypeNL
979 ;~ popa
980ENDIF
981
982 call PARTHIDESETUP_CollectHideConfigAndPutToTable
983 ; Simply return to Partition Setup
984 ret
985
986 PHSM_KeyUp:
987 dec dh
988 call PARTHIDESETUP_BuildChoiceBar
989 jmp PHSM_MainLoop
990
991 PHSM_KeyDown:
992 inc dh
993 call PARTHIDESETUP_BuildChoiceBar
994 jmp PHSM_MainLoop
995
996 PHSM_KeyToogle:
997
998IFDEF AUX_DEBUG
999 ;~ pusha
1000 ;~ mov al,dl ; Index of partition to set Special Marker on.
1001 ;~ call AuxIO_TeletypeHexByte
1002 ;~ call AuxIO_TeletypeNL
1003 ;~ popa
1004ENDIF
1005
1006 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1007 mov al, [si+LocIPT_Flags]
1008 xor al, Flags_SpecialMarker
1009 mov [si+LocIPT_Flags], al
1010 call PARTHIDESETUP_DrawPartitionInfo
1011 call PARTHIDESETUP_BuildChoiceBar
1012 jmp PHSM_MainLoop
1013
1014 PHSM_KeyF1:
1015 mov bx, offset TXT_SETUPHELP_HideSetup
1016 call SETUP_ShowHelp ; Shows help
1017 jmp PHSM_MainLoop
1018PARTHIDESETUP_Main EndP
1019
1020; Draw all standard-things for HiddenSetup, dynamic content not included.
1021PARTHIDESETUP_DrawMenuBase Proc Near Uses dx
1022 ; PartSetup_HiddenX1
1023
1024
1025
1026CLR_PART_HIDE_WINDOW_BASE_CLASSIC = 0d05h
1027CLR_PART_HIDE_WINDOW_BASE_BM = 0a02h
1028CLR_PART_HIDE_WINDOW_BASE_TB = 0a02h
1029IFDEF TESTBUILD
1030CLR_PART_HIDE_WINDOW_BASE = CLR_PART_HIDE_WINDOW_BASE_TB
1031ELSE
1032CLR_PART_HIDE_WINDOW_BASE = CLR_PART_HIDE_WINDOW_BASE_BM
1033ENDIF
1034
1035 mov cx, CLR_PART_HIDE_WINDOW_BASE ; Lila on lila
1036 call VideoIO_Color
1037 mov bh, 05h
1038 mov bl, [PartSetup_HiddenX]
1039 mov dh, 10h
1040 mov dl, bl
1041 add dl, 25h
1042 add dl, [PartSetup_HiddenAdd]
1043 push bx
1044 call VideoIO_MakeWindow
1045 pop bx
1046 ; --- Make Window-Header - "Hide Feature" at top frame-line
1047 inc bl
1048 mov cx, bx
1049 call VideoIO_Locate
1050 mov al, 0b5h
1051 call VideoIO_PrintSingleChar
1052
1053
1054
1055CLR_PART_HIDE_WINDOW_LABEL_CLASSIC = 0e05h
1056CLR_PART_HIDE_WINDOW_LABEL_BM = 0e02h
1057CLR_PART_HIDE_WINDOW_LABEL_TB = 0e02h
1058IFDEF TESTBUILD
1059CLR_PART_HIDE_WINDOW_LABEL = CLR_PART_HIDE_WINDOW_LABEL_TB
1060ELSE
1061CLR_PART_HIDE_WINDOW_LABEL = CLR_PART_HIDE_WINDOW_LABEL_BM
1062ENDIF
1063
1064 mov cx, CLR_PART_HIDE_WINDOW_LABEL ; Yellow on Lila
1065 call VideoIO_Color
1066 mov si, offset TXT_SETUP_HideFeature
1067 call VideoIO_Print
1068
1069
1070
1071CLR_PART_HIDE_WINDOW_BORDER_CLASSIC = 0d05h
1072CLR_PART_HIDE_WINDOW_BORDER_BM = 0d02h
1073CLR_PART_HIDE_WINDOW_BORDER_TB = 0d02h
1074IFDEF TESTBUILD
1075CLR_PART_HIDE_WINDOW_BORDER = CLR_PART_HIDE_WINDOW_BORDER_TB
1076ELSE
1077CLR_PART_HIDE_WINDOW_BORDER = CLR_PART_HIDE_WINDOW_BORDER_BM
1078ENDIF
1079
1080 mov cx, CLR_PART_HIDE_WINDOW_BASE ; Lila on lila
1081 call VideoIO_Color
1082 mov al, 0c6h
1083 call VideoIO_PrintSingleChar
1084 ; --- Make Window-Footer - "State when booting..." at bottom right frame-line
1085 mov cx, CLR_PART_HIDE_WINDOW_BORDER ; Lila on lila
1086 call VideoIO_Color
1087 mov dh, 10h
1088 mov dl, [PartSetup_HiddenX]
1089 add dl, 25h
1090 add dl, [PartSetup_HiddenAdd] ; Location 16, HiddenX->right aligned
1091 mov si, offset TXT_SETUP_HideFeature2
1092 call GetLenOfString ; CX - Length of HideFeature2
1093 sub dl, cl ; Adjust Position
1094 push dx
1095 mov dl, [PartSetup_ActivePart]
1096 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1097 pop dx
1098 ; Display "Label" field without ending NULs/Spaces
1099 add si, LocIPT_Name
1100 mov cx, 11
1101 call GetLenOfName
1102 sub dl, cl ; Adjust position
1103 sub dl, 2
1104 push cx
1105 push si ; SI == Label Field
1106 mov cx, dx
1107 call VideoIO_Locate
1108 mov al, '<'
1109 call VideoIO_PrintSingleChar
1110 mov si, offset TXT_SETUP_HideFeature2
1111 call VideoIO_Print
1112 pop si
1113 pop cx
1114 call VideoIO_FixedPrint
1115 mov al, '>'
1116 call VideoIO_PrintSingleChar
1117
1118; inc cl
1119; call MBR_Locate ; Location 16, HiddenX
1120; mov al, 0b5h
1121; call MBR_PrintSingleChar
1122; mov cx, 0E05h ; Yellow on Lila
1123; call MBR_Color
1124; mov si, offset TXT_SETUP_HideFeature2
1125; call MBR_Print
1126; mov dl, PartSetup_ActivePart
1127; call MBR_Part_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1128; ; Display "Label" field without ending NULs/Spaces
1129; add si, LocIPT_Name
1130; mov cx, 11
1131; call MBR_GetLenOfName
1132; call MBR_FixedPrint
1133; mov cx, 0D05h ; Lila on lila
1134; call MBR_Color
1135; mov al, 0c6h
1136; call MBR_PrintSingleChar
1137
1138 ; --- Make ':' Line down
1139
1140
1141
1142CLR_PART_HIDE_MENU_BASE_CLASSIC = 0f05h
1143CLR_PART_HIDE_MENU_BASE_BM = 0f02h
1144CLR_PART_HIDE_MENU_BASE_TB = 0f02h
1145IFDEF TESTBUILD
1146CLR_PART_HIDE_MENU_BASE = CLR_PART_HIDE_MENU_BASE_TB
1147ELSE
1148CLR_PART_HIDE_MENU_BASE = CLR_PART_HIDE_MENU_BASE_BM
1149ENDIF
1150
1151 mov cx, CLR_PART_HIDE_MENU_BASE ; Yellow on Lila
1152 call VideoIO_Color
1153 mov ch, 07h
1154 mov cl, PartSetup_HiddenX
1155 add cl, 24
1156 add cl, PartSetup_HiddenAdd
1157 call VideoIO_Locate
1158 mov al, ':'
1159 mov cl, 8
1160 call VideoIO_Internal_MakeWinDown
1161 ret
1162PARTHIDESETUP_DrawMenuBase EndP
1163
1164; Draw all partitions to Hidden-Setup aka Dynamic Content-Draw
1165PARTHIDESETUP_RefreshPartitions Proc Near Uses dx
1166 mov dl, [PartSetup_HiddenUpper]
1167 mov dh, 8
1168 PHSRP_Loop:
1169 call PARTHIDESETUP_DrawPartitionInfo
1170 inc dl
1171 dec dh
1172 jnz PHSRP_Loop
1173
1174
1175
1176CLR_PART_HIDE_MENU_MARKERS_CLASSIC = 0d05h
1177CLR_PART_HIDE_MENU_MARKERS_BM = 0a02h
1178CLR_PART_HIDE_MENU_MARKERS_TB = 0a02h
1179IFDEF TESTBUILD
1180CLR_PART_HIDE_MENU_MARKERS = CLR_PART_HIDE_MENU_MARKERS_TB
1181ELSE
1182CLR_PART_HIDE_MENU_MARKERS = CLR_PART_HIDE_MENU_MARKERS_BM
1183ENDIF
1184
1185 ; At last calculate Scroll-Markers
1186 mov cx, CLR_PART_HIDE_MENU_MARKERS ; Lila on lila ; Hide Feature Markers
1187 call VideoIO_Color
1188 mov cx, 0603h ; 6, +3
1189 add cl, [PartSetup_HiddenX]
1190 mov dl, [PartSetup_HiddenUpper]
1191 call PARTSETUP_UpperScrollMarker
1192 add cl, 29
1193 add cl, [PartSetup_HiddenAdd] ; 6, +29
1194 call PARTSETUP_UpperScrollMarker
1195 mov cx, 0F03h ; 15, +3
1196 add cl, [PartSetup_HiddenX]
1197 add dl, 8 ; add 8 -> points to last partition
1198 mov dh, [CFG_Partitions] ; Limit
1199 call PARTSETUP_LowerScrollMarker
1200 add cl, 29
1201 add cl, [PartSetup_HiddenAdd] ; 6, +29
1202 call PARTSETUP_LowerScrollMarker
1203 ret
1204PARTHIDESETUP_RefreshPartitions EndP
1205
1206PARTHIDESETUP_DrawPartitionInfo Proc Near Uses dx
1207 local NoOfPart :byte
1208 mov ch, dl
1209 sub ch, [PartSetup_HiddenUpper]
1210 add ch, 7
1211 mov cl, 2
1212 add cl, [PartSetup_HiddenX]
1213 ; We got location
1214 mov NoOfPart, dl
1215 call VideoIO_Locate
1216
1217 ; Clean data-area...
1218 push cx
1219 mov al, ' '
1220 mov cl, 22
1221 call VideoIO_PrintSingleMultiChar
1222 pop cx
1223
1224 cmp dl, [CFG_Partitions]
1225 jae PHSDPI_NoData
1226
1227 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1228 call VideoIO_Locate
1229 push cx
1230 ; Display "Label" field aka "OS2" without ending NULs/Spaces
1231
1232
1233
1234CLR_PART_HIDE_LABEL_CLASSIC = 0f05h
1235CLR_PART_HIDE_LABEL_BM = 0f02h
1236CLR_PART_HIDE_LABEL_TB = 0f02h
1237IFDEF TESTBUILD
1238CLR_PART_HIDE_LABEL = CLR_PART_HIDE_LABEL_TB
1239ELSE
1240CLR_PART_HIDE_LABEL = CLR_PART_HIDE_LABEL_BM
1241ENDIF
1242
1243 mov cx, CLR_PART_HIDE_LABEL
1244 call VideoIO_Color ; Bright White on Lila
1245 push si
1246 add si, LocIPT_Name
1247 mov cx, 11
1248 call GetLenOfName
1249 call VideoIO_FixedPrint
1250 pop si
1251
1252
1253
1254CLR_PART_HIDE_WINDOW_FS_CLASSIC = 0d05h
1255CLR_PART_HIDE_WINDOW_FS_BM = 0a02h
1256CLR_PART_HIDE_WINDOW_FS_TB = 0a02h
1257IFDEF TESTBUILD
1258CLR_PART_HIDE_WINDOW_FS = CLR_PART_HIDE_WINDOW_FS_TB
1259ELSE
1260CLR_PART_HIDE_WINDOW_FS = CLR_PART_HIDE_WINDOW_FS_BM
1261ENDIF
1262
1263 mov cx, CLR_PART_HIDE_WINDOW_FS
1264 call VideoIO_Color ; Bright Lila on Lila
1265 mov al, ' '
1266 call VideoIO_PrintSingleChar
1267 mov al, '['
1268 call VideoIO_PrintSingleChar
1269 ; Display "Type" field aka "HPFS" without ending NULs/Spaces
1270 push si
1271 mov al, [si+LocIPT_SystemID]
1272 call PART_SearchFileSysName
1273 mov cx, 8
1274 call GetLenOfName
1275 call VideoIO_FixedPrint
1276 pop si
1277 mov al, ']'
1278 call VideoIO_PrintSingleChar
1279 pop cx
1280 add cl, 24
1281 add cl, PartSetup_HiddenAdd
1282 call VideoIO_Locate
1283 push cx
1284
1285
1286
1287CLR_PART_HIDE_WINDOW_CHOISES_CLASSIC = 0e05h
1288CLR_PART_HIDE_WINDOW_CHOISES_BM = 0e02h
1289CLR_PART_HIDE_WINDOW_CHOISES_TB = 0e02h
1290IFDEF TESTBUILD
1291CLR_PART_HIDE_WINDOW_CHOISES = CLR_PART_HIDE_WINDOW_CHOISES_TB
1292ELSE
1293CLR_PART_HIDE_WINDOW_CHOISES = CLR_PART_HIDE_WINDOW_CHOISES_BM
1294ENDIF
1295
1296 mov cx, CLR_PART_HIDE_WINDOW_CHOISES
1297 call VideoIO_Color ; Yellow on Lila
1298 mov al, ' '
1299 mov cl, 10
1300 call VideoIO_PrintSingleMultiChar ; Fill up area with spaces
1301 ; Finally draw Hidden/Unhidden
1302 mov bl, [si+LocIPT_Flags]
1303 mov si, offset TXT_SETUP_MAGIC_Unhidden
1304 and bl, Flags_SpecialMarker
1305 jz PHSDPI_IsNotHidden
1306 mov si, offset TXT_SETUP_MAGIC_Hidden
1307 PHSDPI_IsNotHidden:
1308 call GetLenOfString
1309 mov dx, cx
1310 pop cx
1311 add cx, 10
1312 sub cx, dx
1313 call VideoIO_Locate
1314 call VideoIO_Print
1315 PHSDPI_NoData:
1316 ret
1317PARTHIDESETUP_DrawPartitionInfo EndP
1318
1319; In: DL - Current Active (to be inactivated)
1320; DH - New Active (to be activated)
1321; Destroyed: None
1322PARTHIDESETUP_BuildChoiceBar Proc Near
1323 cmp dl, dh
1324 je PHSBCB_SkipRetrace
1325 call VideoIO_WaitRetrace
1326 PHSBCB_SkipRetrace:
1327
1328
1329
1330CLR_PART_HIDE_WINDOW_MENU_BAR_CLASSIC = 5eh
1331CLR_PART_HIDE_WINDOW_MENU_BAR_BM = 2eh
1332CLR_PART_HIDE_WINDOW_MENU_BAR_TB = 2eh
1333IFDEF TESTBUILD
1334CLR_PART_HIDE_WINDOW_MENU_BAR = CLR_PART_HIDE_WINDOW_MENU_BAR_TB
1335ELSE
1336CLR_PART_HIDE_WINDOW_MENU_BAR = CLR_PART_HIDE_WINDOW_MENU_BAR_BM
1337ENDIF
1338
1339 ; Deactivate current active bar
1340 mov cl, CLR_PART_HIDE_WINDOW_MENU_BAR ; Yellow on Lila
1341 call PARTHIDESETUP_ReColorPart
1342
1343 ; Running Fixing
1344 cmp dh, 0FFh
1345 jne PHSBCB_NoUnderflow
1346 xor dh, dh
1347 PHSBCB_NoUnderflow:
1348 cmp dh, [CFG_Partitions]
1349 jb PHSBCB_NoOverflow
1350 mov dh, [CFG_Partitions]
1351 dec dh
1352 PHSBCB_NoOverflow:
1353 mov dl, dh
1354
1355 ; Do we need to scroll ?
1356 mov al, [PartSetup_HiddenUpper]
1357 cmp dl, al
1358 jb PHSBCB_YesScrolling
1359 add al, 8
1360 cmp dl, al
1361 jb PHSBCB_NoScrolling
1362 mov al, dl
1363 sub al, 7
1364 mov [PartSetup_HiddenUpper], al
1365 call PARTHIDESETUP_RefreshPartitions
1366 jmp PHSBCB_NoScrolling
1367 PHSBCB_YesScrolling:
1368 mov al, dl
1369 mov [PartSetup_HiddenUpper], al
1370 call PARTHIDESETUP_RefreshPartitions
1371 PHSBCB_NoScrolling:
1372
1373
1374
1375; Activate fresh active bar
1376CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_CLASSIC = 1fh
1377CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM = 1fh
1378CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_TB = 1fh
1379IFDEF TESTBUILD
1380CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR = CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_TB
1381ELSE
1382CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR = CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM
1383ENDIF
1384
1385 mov cl, CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR ; Bright White on Blue
1386 call PARTHIDESETUP_ReColorPart
1387 ; Now DL==DH
1388 ret
1389PARTHIDESETUP_BuildChoiceBar EndP
1390
1391; In: CL - Color, DL - Partition
1392; Destroyed: None, but Locate-Pointer
1393PARTHIDESETUP_ReColorPart Proc Near Uses bx cx es di
1394 mov bh, cl ; Color to BH
1395 ; First calculate location of bar
1396 cmp dl, [PartSetup_HiddenUpper]
1397 jb PHSRCP_NotInWindowView
1398 mov ch, dl
1399 sub ch, [PartSetup_HiddenUpper] ; CH - Position relative to HiddenUpper
1400 cmp ch, 8 ; 8 - Maximum Total in Window
1401 jae PHSRCP_NotInWindowView
1402 add ch, 7
1403 mov cl, 26
1404 add cl, [PartSetup_HiddenX]
1405 add cl, [PartSetup_HiddenAdd]
1406
1407 mov bl, 10 ; Length of Bar is 10
1408 call VideoIO_Locate ; geht zu CX
1409 call VideoIO_Internal_SetRegs
1410 inc di ; DI - Destination+1 -> Color-Byte
1411 mov cl, bl ; Length of Bar is always 39
1412 PHSRCP_ClearLoop:
1413 mov es:[di], bh
1414 add di, 2
1415 dec cl
1416 jnz PHSRCP_ClearLoop
1417 PHSRCP_NotInWindowView:
1418 ret
1419PARTHIDESETUP_ReColorPart EndP
1420
1421; =============================================================================
1422
1423
1424;
1425; Rousseau: Adjusted for packed hidden-part-table !
1426; Needs to be re-written.
1427;
1428; This is called by MBRS_PS_HiddenSetup
1429; In: DL - Partition, where to save Hide-Config
1430; Destroyed: None, but Locate-Pointer
1431PARTHIDESETUP_GetHideConfigAndSpread Proc Near Uses ax bx dx si di
1432 ; First check HideFeature-Flag on selected partition.
1433 ; if it's not set, don't do anything...
1434 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
1435 mov al, [si+LocIPT_Flags]
1436 test al, Flags_HideFeature
1437 jz PHSGHCAS_EndOfEntries
1438 PHSGHCAS_SomethingHidden:
1439 ; Calculate, where to get Hide-Config
1440 mov ax, LocHPT_LenOfHPT ; Size of a hidden-part-table entry.
1441 mul dl ; Multiply by partition-index.
1442 mov di, offset HidePartitionTable
1443 add di, ax ; We got the pointer
1444
1445 ; So process Hide-Config. Read out Bitfield-Entries,
1446 ; each points to a partition.
1447 ; 3Fh is end-marker / maximum entries = CFG_Partitions
1448 mov cl, [CFG_Partitions]
1449 mov bx,di ; Pointer to hidden-parts entry for this partition.
1450 mov ch,0 ; Start index in hidden-parts entry for this partition.
1451 mov dh,6 ; Bitfields are 6 bits wide.
1452 PHSGHCAS_SpreadLoop:
1453 mov dl,ch ; Load bitfield index from CH.
1454 call CONV_GetBitfieldValue ; Get value of bitfield.
1455 mov dl,al ; Partition index in DL.
1456 ;~ mov dl, [di]
1457 ;~ inc di
1458 ;~ cmp dl, 0FFh
1459 cmp dl,3fh ; Max value for 6-bits field.
1460 je PHSGHCAS_EndOfEntries
1461 call PART_GetPartitionPointer ; Pointer for partition DL to SI
1462 mov al, [si+LocIPT_Flags]
1463 or al, Flags_SpecialMarker ; Set marker
1464 mov [si+LocIPT_Flags], al
1465 inc ch ; Next bitfield.
1466 dec cl
1467 jnz PHSGHCAS_SpreadLoop
1468 PHSGHCAS_EndOfEntries:
1469 ret
1470PARTHIDESETUP_GetHideConfigAndSpread EndP
1471
1472
1473;
1474; Rousseau: Adjusted for packed hidden-part-table !
1475; Needs to be re-written.
1476;
1477; This is called by MBRS_PS_HiddenSetup
1478; In: DL - Partition, where to save Hide-Config
1479; Destroyed: None, but Locate-Pointer
1480PARTHIDESETUP_CollectHideConfigAndPutToTable Proc Near Uses ax si es di
1481 ; First calculate, where to put Hide-Config
1482 ;~ mov ax, LocIPT_MaxPartitions
1483 mov ax, LocHPT_LenOfHPT ; Length of an HPT-entry.
1484 mul dl ; Partition to store info for.
1485 push cs
1486 pop es
1487 mov di, offset HidePartitionTable ; Packed hideparttable.
1488 add di, ax ; We got the pointer in DI.
1489
1490 ;~ push di
1491
1492 ; Fill hide-part-table entry with 'unused' marker.
1493 ; Note that the entry is actually an array of 45 6-bit bitfields.
1494 ; Below fills 34 bytes = 45 6-bit bitfields.
1495 push di
1496 mov cx, LocHPT_LenOfHPT
1497 mov al, 0FFh
1498 rep stosb ; Fill up with FFh
1499 pop di
1500
1501 ;~ mov bp,di
1502
1503 ; Now walk through the IPT collecting all SpecialMarkers.
1504 ; For each do a bitfield-entry containing the number of the partition.
1505 mov si, offset PartitionTable
1506 xor ch, ch ; Partition index
1507 mov cl, [CFG_Partitions] ; Nr. of partitions in IPT
1508 mov ah,0 ; Next hide-index to write.
1509
1510 ;
1511 ; Collect all partitions that have the special marker set.
1512 ; This marker was set by toggling the hide/unhide option in the setup menu.
1513 ;
1514 PHSCHCAPTT_CollectLoop:
1515
1516 ; Get marker and test it.
1517 mov bl, [si+LocIPT_Flags]
1518 test bl, Flags_SpecialMarker
1519
1520 ; No marker.
1521 jz PHSCHCAPTT_NoMarker
1522
1523 ; Setup stuff for bitfield operation.
1524 push dx ; Save partition pointer.
1525 push bx ; Save marker.
1526 mov bx,di ; Get pointer to HPT-entry.
1527 mov dl,ah ; Index in entry.
1528 mov dh,6 ; Bitfield width.
1529 push ax ; Save index.
1530 mov al,ch ; Partition index to store.
1531
1532
1533 IFDEF AUX_DEBUG
1534 ;~ pushf
1535 ;~ pusha
1536 ;~ push ax
1537 ;~ mov al,dl
1538 ;~ call AuxIO_TeletypeHexByte
1539 ;~ mov al,':'
1540 ;~ call AuxIO_Teletype
1541 ;~ mov ax,bx
1542 ;~ call AuxIO_TeletypeHexWord
1543 ;~ mov al,':'
1544 ;~ call AuxIO_Teletype
1545 ;~ mov ax,bp
1546 ;~ call AuxIO_TeletypeHexWord
1547 ;~ mov al,':'
1548 ;~ call AuxIO_Teletype
1549 ;~ mov ax,sp
1550 ;~ call AuxIO_TeletypeHexWord
1551 ;~ mov al,':'
1552 ;~ call AuxIO_Teletype
1553 ;~ pop ax
1554 ;~ call AuxIO_TeletypeHexByte
1555 ;~ call AuxIO_TeletypeNL
1556 ;~ popa
1557 ;~ popf
1558 ENDIF
1559
1560 call CONV_SetBitfieldValue ; Store bitfield.
1561 pop ax ; Restore index.
1562 pop bx ; Restore marker.
1563 pop dx ; Restore partition pointer.
1564
1565 inc ah ; Advance to next index.
1566
1567 ;~ mov ds:[di], ch ; Write byte-Entry
1568 ;~ inc di
1569 xor bl, Flags_SpecialMarker ; Reset Flag
1570 mov [si+LocIPT_Flags], bl ; Store it in IPT
1571
1572
1573 PHSCHCAPTT_NoMarker:
1574 add si, LocIPT_LenOfIPT ; Advance to next partition in IPT.
1575 inc ch ; Next partition-index.
1576 dec cl ; Decrement partitions to process.
1577 jnz PHSCHCAPTT_CollectLoop ; Are we done yet ?
1578
1579 ;~ pop si ; Original Hide-Config Pointer -> SI
1580 ; Now check, if we have written anything
1581 ;~ cmp si, di
1582 test ah,ah ; See if we had to store anything.
1583 jne PHSCHCAPTT_SomethingToHide ; Yep, go to write end-marker.
1584
1585 ; Nothing to hide...so UNSET the Hidden-Feature Flag
1586 call PART_GetPartitionPointer ; Use DL to get part-pointer in SI.
1587 mov al, [si+LocIPT_Flags] ; Get flags.
1588 mov ah, Flags_HideFeature ; Hide mask.
1589 not ah ; Complement.
1590 and al, ah ; Clear hide-flag.
1591 mov [si+LocIPT_Flags], al ; Store it.
1592 ;~ pop bp
1593 ret ; Return to caller.
1594
1595 PHSCHCAPTT_SomethingToHide:
1596 cmp ah, LocIPT_MaxPartitions ; See if index is at end.
1597 jae PHSCHCAPTT_AllUsed ; Yep, no need to store end-marker.
1598
1599 ; Write end-marker.
1600 push dx ; Save partition pointer.
1601 mov al,3fh ; End marker (6-bit)
1602 mov dl,ah ; Index in HPT-entry.
1603 mov dh,6 ; Bitfield width.
1604 mov bx,di ; Get pointer to HPT-entry.
1605 call CONV_SetBitfieldValue ; Store end-marker.
1606 pop dx ; Restore partition pointer.
1607
1608 ;~ mov ax, si
1609 ;~ add ax, LocIPT_MaxPartitions
1610 ;~ cmp di, ax
1611 ;~ jae PHSCHCAPTT_AllUsed
1612 ; Set END-marker
1613 ;~ mov al, 0FFh
1614 ;~ stosb ; Write byte-Entry
1615 PHSCHCAPTT_AllUsed:
1616
1617 ; Something to hide...so SET the Hidden-Feature Flag
1618 call PART_GetPartitionPointer ; Use DL to get part-pointer in SI.
1619 mov al, [si+LocIPT_Flags] ; Get flags.
1620 or al, Flags_HideFeature ; Set hide-flag.
1621 mov [si+LocIPT_Flags], al ; Store it.
1622 ;~ pop bp
1623 ret ; Return to caller.
1624PARTHIDESETUP_CollectHideConfigAndPutToTable EndP
1625
1626; =============================================================================
1627
1628; This is called from MBRS_Routines_PartitionSetup
1629; In: DL - Partition to LogicalDriveLetter-Setup
1630; Destroyed: ax
1631PARTSETUP_DriveLetterSetup Proc Near Uses dx si es di
1632 call PART_GetPartitionPointer ; Gets the PartitionPointer for DL in SI
1633 ; SystemID must support DriveLetter feature (FAT16, HPFS, JFS)
1634 mov al, bptr [si+LocIPT_SystemID]
1635 push si
1636 call PART_SearchFileSysName
1637 pop si
1638 test ah, FileSysFlags_DriveLetter
1639 jnz PSDLS_GotLDLP
1640
1641 ; Drive-Letter feature only possible on HPFS/FAT16 (OS/2) systems
1642 mov cx, 0C04h
1643 mov si, offset TXT_SETUP_NoLDLpartition
1644 call SETUP_ShowErrorBox
1645 ret
1646
1647 PSDLS_GotLDLP:
1648 ; First build up menu and display current setting...
1649 call PARTSETUPDL_DrawMenuBase ; DL - partition-no
1650
1651 ; Now get the Logical-Drive-Letter for that partition...
1652 ;movzx bx, dl
1653 mov bl,dl
1654 mov bh,0
1655
1656 mov dl, byte ptr [DriveLetters+bx]
1657
1658 push bx
1659 ; DS:SI - IPT Entry of Partition, DL - LogicalDriveLetter
1660 call PARTSETUPDL_DrawDriveLetter
1661
1662 ; Now we got everything on-the-screen
1663 PSDLS_MainLoop:
1664 mov ah, 0
1665 int 16h
1666 cmp ah, Keys_Backspace
1667 je PSDLS_BackSpace
1668 cmp ah, Keys_Up
1669 je PSDLS_KeyUp
1670 cmp ah, Keys_Down
1671 je PSDLS_KeyDown
1672 cmp ah, Keys_ESC
1673 je PSDLS_KeyDONE
1674 cmp ah, Keys_ENTER
1675 je PSDLS_KeyDONE
1676 ; Direct-Letter-Input
1677 or al, 20h ; Lower-Case Input
1678 cmp al, 'c'
1679 jb PSDLS_MainLoop
1680 cmp al, 'z'
1681 ja PSDLS_MainLoop
1682 mov dl, al
1683 add dl, 1Dh ; -> Convert to used logic
1684 call PARTSETUPDL_DrawDriveLetter
1685 jmp PSDLS_MainLoop
1686
1687
1688 ; Clear drive-letter with backspace
1689 PSDLS_BackSpace:
1690 xor dl,dl
1691 call PARTSETUPDL_DrawDriveLetter
1692 jmp PSDLS_MainLoop
1693
1694 PSDLS_KeyUp:
1695 dec dl
1696 cmp dl, 7Fh
1697 jne PSDLS_KeyUpFix1
1698 xor dl, dl
1699 PSDLS_KeyUpFix1:
1700 cmp dl, 97h
1701 jbe PSDLS_KeyUpFix2
1702 mov dl, 97h
1703 PSDLS_KeyUpFix2:
1704 call PARTSETUPDL_DrawDriveLetter
1705 jmp PSDLS_MainLoop
1706
1707 PSDLS_KeyDown:
1708 inc dl
1709 cmp dl, 97h
1710 jbe PSDLS_KeyDownFix1
1711 xor dl, dl
1712 PSDLS_KeyDownFix1:
1713 cmp dl, 01h
1714 jne PSDLS_KeyDownFix2
1715 mov dl, 80h
1716 PSDLS_KeyDownFix2:
1717 call PARTSETUPDL_DrawDriveLetter
1718 jmp PSDLS_MainLoop
1719
1720
1721 PSDLS_KeyDONE:
1722 ; Write Drive-Letter into DriveLetter-Table
1723 pop bx
1724 mov bptr [DriveLetters+bx], dl
1725 mov al, ds:[si+LocIPT_Flags]
1726 mov ah, Flags_DriveLetter
1727 not ah
1728 and al, ah
1729 or dl, dl
1730 jz PSDLS_NoFlag
1731 or al, Flags_DriveLetter
1732 PSDLS_NoFlag:
1733 mov ds:[si+LocIPT_Flags], al
1734 ret
1735PARTSETUP_DriveLetterSetup EndP
1736
1737; Draw all standard-things for DriveLetterSetup, dynamic content not included.
1738PARTSETUPDL_DrawMenuBase Proc Near Uses dx si
1739 ; Calculate Position of Window.
1740 ; If Partition Selected Left-Side -> go Right-Sided Window
1741 ; otherwise Left-Sided.
1742 mov PartSetup_ActivePart, dl
1743 mov al, 8 ; X-Pos = 8
1744 and dl, 1
1745 jnz PSDLDMB_FirstStep
1746 mov al, 30h ; X-Pos = 48
1747 PSDLDMB_FirstStep:
1748 mov PartSetup_HiddenX, al
1749
1750
1751
1752; Draw base-window
1753CLR_PART_DL_XX_CLASSIC = 0d05h
1754CLR_PART_DL_XX_BM = 0a02h
1755CLR_PART_DL_XX_TB = 0a02h
1756IFDEF TESTBUILD
1757CLR_PART_DL_XX = CLR_PART_DL_XX_TB
1758ELSE
1759CLR_PART_DL_XX = CLR_PART_DL_XX_BM
1760ENDIF
1761
1762 mov cx, CLR_PART_DL_XX ; Lila on lila
1763 call VideoIO_Color
1764 mov bh, 06h
1765 mov bl, [PartSetup_HiddenX]
1766 mov dh, 0Ah
1767 mov dl, bl
1768 add dl, 16h
1769 push bx
1770 call VideoIO_MakeWindow
1771 pop bx
1772 ; Make Window-Header
1773 inc bl
1774 push bx
1775 mov cx, bx
1776 call VideoIO_Locate
1777 mov al, 0b5h
1778 call VideoIO_PrintSingleChar
1779
1780
1781
1782CLR_PART_DL_WINDOW_TITLE_CLASSIC = 0e05h
1783CLR_PART_DL_WINDOW_TITLE_BM = 0e02h
1784CLR_PART_DL_WINDOW_TITLE_TB = 0e02h
1785IFDEF TESTBUILD
1786CLR_PART_DL_WINDOW_TITLE = CLR_PART_DL_WINDOW_TITLE_TB
1787ELSE
1788CLR_PART_DL_WINDOW_TITLE = CLR_PART_DL_WINDOW_TITLE_BM
1789ENDIF
1790
1791 mov cx, CLR_PART_DL_WINDOW_TITLE ; Yellow on Lila
1792 call VideoIO_Color
1793 mov si, offset TXT_SETUP_DriveLetter
1794 call VideoIO_Print
1795
1796
1797
1798CLR_PART_DL_WINDOW_BORDER2_CLASSIC = 0d05h
1799CLR_PART_DL_WINDOW_BORDER2_BM = 0a02h
1800CLR_PART_DL_WINDOW_BORDER2_TB = 0a02h
1801IFDEF TESTBUILD
1802CLR_PART_DL_WINDOW_BORDER2 = CLR_PART_DL_WINDOW_BORDER2_TB
1803ELSE
1804CLR_PART_DL_WINDOW_BORDER2 = CLR_PART_DL_WINDOW_BORDER2_BM
1805ENDIF
1806
1807 mov cx, CLR_PART_DL_WINDOW_BORDER2 ; Lila on lila
1808 call VideoIO_Color
1809 mov al, 0c6h
1810 call VideoIO_PrintSingleChar
1811 pop bx
1812 ; Display help-information
1813 mov si, offset TXT_SETUPHELP_DriveLetter
1814
1815
1816
1817CLR_PART_DL_SETUP_HELP_CLASSIC = 0d05h
1818CLR_PART_DL_SETUP_HELP_BM = 0a02h
1819CLR_PART_DL_SETUP_HELP_TB = 0a02h
1820IFDEF TESTBUILD
1821CLR_PART_DL_SETUP_HELP = CLR_PART_DL_SETUP_HELP_TB
1822ELSE
1823CLR_PART_DL_SETUP_HELP = CLR_PART_DL_SETUP_HELP_BM
1824ENDIF
1825
1826 mov cx, CLR_PART_DL_SETUP_HELP ; Lila on lila
1827 call VideoIO_Color
1828
1829 call GetLenOfString ; CX - Len of string
1830 mov dx, cx
1831 mov cx, bx
1832 add cx, 0413h
1833 sub cl, dl
1834 call VideoIO_Locate
1835 mov al, '<'
1836 call VideoIO_PrintSingleChar
1837 call VideoIO_Print
1838 mov al, '>'
1839 call VideoIO_PrintSingleChar
1840 ;
1841 mov cx, 0F01h ; Bright White on Blue
1842 call VideoIO_Color
1843 mov cx, 0805h ; Position 8, 5
1844 add cl, PartSetup_HiddenX
1845 call VideoIO_Locate
1846 mov al, ' '
1847 mov cl, 12
1848 call VideoIO_PrintSingleMultiChar
1849 ret
1850PARTSETUPDL_DrawMenuBase EndP
1851
1852; Writes Logical Drive-Letter to Screen (Logical-Drive-Letter-Setup)
1853; In: DL - Logical Drive-Letter Byte
1854; Destroyed: None
1855PARTSETUPDL_DrawDriveLetter Proc Near Uses si
1856 ; 00h -> standard drive letter
1857 ; 80h -> use C: as drive letter
1858 ; 97h -> use Z: as drive letter
1859 push dx
1860 mov cx, 0805h ; Position 8, 5
1861 add cl, [PartSetup_HiddenX]
1862 call VideoIO_Locate
1863 add cl, 6 ; Everything centered (12/2)
1864 push cx
1865 mov al, ' '
1866 mov cl, 12
1867 call VideoIO_PrintSingleMultiChar ; Fill up area with spaces
1868
1869 or dl, dl
1870 jnz PSDLDDL_Letter
1871 mov si, offset TXT_SETUP_MAGIC_Disabled
1872 call GetLenOfString
1873 mov dx, cx
1874 pop cx
1875 call VideoIO_LocateToCenter ; LocateToCenter using TotalLen
1876 call VideoIO_Print
1877 pop dx
1878 ret
1879
1880 PSDLDDL_Letter:
1881 mov si, offset TXT_SETUP_MAGIC_Set
1882 call GetLenOfString
1883 mov dx, cx
1884 add dx, 2
1885 pop cx
1886 call VideoIO_LocateToCenter ; LocateToCenter using TotalLen
1887 call VideoIO_Print
1888 pop dx
1889 mov al, dl
1890 sub al, 3Dh
1891 call VideoIO_PrintSingleChar
1892 mov al, ':'
1893 call VideoIO_PrintSingleChar
1894 ret
1895PARTSETUPDL_DrawDriveLetter EndP
Note: See TracBrowser for help on using the repository browser.