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