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