[88] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
[3] | 2 | ; Description : Functions for printing boot menu strings.
|
---|
| 3 |
|
---|
| 4 | ; Section containing code
|
---|
| 5 | SECTION .text
|
---|
| 6 |
|
---|
| 7 | ;--------------------------------------------------------------------
|
---|
[88] | 8 | ; Prints Boot Menu title strings.
|
---|
[3] | 9 | ;
|
---|
[88] | 10 | ; BootMenuPrint_TitleStrings
|
---|
[3] | 11 | ; Parameters:
|
---|
[88] | 12 | ; Nothing
|
---|
[3] | 13 | ; Returns:
|
---|
[88] | 14 | ; CF: Set since menu event handled
|
---|
[3] | 15 | ; Corrupts registers:
|
---|
[88] | 16 | ; AX, SI, DI
|
---|
[3] | 17 | ;--------------------------------------------------------------------
|
---|
| 18 | ALIGN JUMP_ALIGN
|
---|
[88] | 19 | BootMenuPrint_TitleStrings:
|
---|
| 20 | mov si, ROMVARS.szTitle
|
---|
| 21 | call PrintNullTerminatedStringFromCSSIandSetCF
|
---|
| 22 | call BootMenuPrint_Newline
|
---|
| 23 | mov si, ROMVARS.szVersion
|
---|
| 24 | jmp PrintNullTerminatedStringFromCSSIandSetCF
|
---|
[3] | 25 |
|
---|
| 26 |
|
---|
| 27 | ;--------------------------------------------------------------------
|
---|
[88] | 28 | ; BootMenuPrint_Newline
|
---|
[3] | 29 | ; Parameters:
|
---|
[84] | 30 | ; Nothing
|
---|
[3] | 31 | ; Returns:
|
---|
| 32 | ; Nothing
|
---|
| 33 | ; Corrupts registers:
|
---|
[88] | 34 | ; AX, DI
|
---|
[3] | 35 | ;--------------------------------------------------------------------
|
---|
| 36 | ALIGN JUMP_ALIGN
|
---|
[88] | 37 | BootMenuPrint_Newline:
|
---|
| 38 | CALL_DISPLAY_LIBRARY PrintNewlineCharacters
|
---|
[3] | 39 | ret
|
---|
| 40 |
|
---|
| 41 |
|
---|
| 42 | ;--------------------------------------------------------------------
|
---|
| 43 | ; Prints Floppy Drive hotkey string.
|
---|
| 44 | ;
|
---|
| 45 | ; BootMenuPrint_FloppyHotkeyString
|
---|
| 46 | ; Parameters:
|
---|
| 47 | ; BL: Number of floppy drives in system
|
---|
| 48 | ; Returns:
|
---|
| 49 | ; Nothing
|
---|
| 50 | ; Corrupts registers:
|
---|
[88] | 51 | ; AX, SI
|
---|
[3] | 52 | ;--------------------------------------------------------------------
|
---|
| 53 | ALIGN JUMP_ALIGN
|
---|
| 54 | BootMenuPrint_FloppyHotkeyString:
|
---|
| 55 | test bl, bl ; Any floppy drives?
|
---|
[88] | 56 | jz SHORT NoFloppyDrivesOrHardDisksToPrint
|
---|
| 57 | push bp
|
---|
| 58 |
|
---|
| 59 | mov bp, sp
|
---|
| 60 | mov al, 'A'
|
---|
| 61 | push ax ; 'A'
|
---|
| 62 | dec ax
|
---|
| 63 | add al, bl
|
---|
| 64 | push ax ; Last floppy drive letter
|
---|
| 65 | ePUSH_T ax, g_szFDD
|
---|
[3] | 66 | ePUSH_T ax, g_szHDD
|
---|
[88] | 67 | jmp SHORT PrintHotkeyString
|
---|
[3] | 68 |
|
---|
| 69 | ;--------------------------------------------------------------------
|
---|
| 70 | ; Prints Hard Disk hotkey string.
|
---|
| 71 | ;
|
---|
| 72 | ; BootMenuPrint_FloppyHotkeyString
|
---|
| 73 | ; Parameters:
|
---|
| 74 | ; BH: Number of hard disks in system
|
---|
| 75 | ; Returns:
|
---|
| 76 | ; Nothing
|
---|
| 77 | ; Corrupts registers:
|
---|
[88] | 78 | ; AX, CX, SI
|
---|
[3] | 79 | ;--------------------------------------------------------------------
|
---|
| 80 | ALIGN JUMP_ALIGN
|
---|
| 81 | BootMenuPrint_HardDiskHotkeyString:
|
---|
| 82 | test bh, bh ; Any hard disks?
|
---|
[88] | 83 | jz SHORT NoFloppyDrivesOrHardDisksToPrint
|
---|
| 84 | push bp
|
---|
| 85 |
|
---|
| 86 | mov bp, sp
|
---|
| 87 | call BootMenu_GetLetterForFirstHardDisk
|
---|
| 88 | push cx ; First hard disk letter
|
---|
| 89 | dec cx
|
---|
| 90 | add cl, bh
|
---|
| 91 | push cx ; Last hard disk letter
|
---|
| 92 | ePUSH_T ax, g_szHDD
|
---|
[3] | 93 | ePUSH_T ax, g_szFDD
|
---|
[88] | 94 | ; Fall to PrintHotkeyString
|
---|
| 95 |
|
---|
| 96 | ALIGN JUMP_ALIGN
|
---|
| 97 | PrintHotkeyString:
|
---|
| 98 | mov si, g_szBottomScrn
|
---|
| 99 | jmp BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
| 100 | NoFloppyDrivesOrHardDisksToPrint:
|
---|
[3] | 101 | ret
|
---|
| 102 |
|
---|
| 103 | ;--------------------------------------------------------------------
|
---|
| 104 | ; BootMenuPrint_ClearScreen
|
---|
| 105 | ; Parameters:
|
---|
| 106 | ; Nothing
|
---|
| 107 | ; Returns:
|
---|
| 108 | ; Nothing
|
---|
| 109 | ; Corrupts registers:
|
---|
[88] | 110 | ; AX
|
---|
[3] | 111 | ;--------------------------------------------------------------------
|
---|
| 112 | ALIGN JUMP_ALIGN
|
---|
| 113 | BootMenuPrint_ClearScreen:
|
---|
[88] | 114 | push di
|
---|
| 115 | mov ax, ' ' | (MONO_NORMAL<<8)
|
---|
| 116 | CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
|
---|
| 117 | pop di
|
---|
[3] | 118 | ret
|
---|
| 119 |
|
---|
| 120 |
|
---|
| 121 | ;--------------------------------------------------------------------
|
---|
| 122 | ; Translates and prints drive number.
|
---|
| 123 | ;
|
---|
| 124 | ; BootMenuPrint_TranslatedDriveNumber
|
---|
| 125 | ; Parameters:
|
---|
| 126 | ; DL: Untranslated drive number
|
---|
| 127 | ; DS: RAMVARS segment
|
---|
| 128 | ; Returns:
|
---|
| 129 | ; Nothing
|
---|
| 130 | ; Corrupts registers:
|
---|
| 131 | ; AX, DI
|
---|
| 132 | ;--------------------------------------------------------------------
|
---|
| 133 | ALIGN JUMP_ALIGN
|
---|
| 134 | BootMenuPrint_TranslatedDriveNumber:
|
---|
| 135 | push dx
|
---|
[88] | 136 | push bx
|
---|
| 137 |
|
---|
[3] | 138 | call DriveXlate_ToOrBack
|
---|
[88] | 139 | eMOVZX ax, dl ; Drive number to AL
|
---|
| 140 | CALL_DISPLAY_LIBRARY PrintWordFromAXwithBaseInBX
|
---|
| 141 | mov al, ' ' ; Print space
|
---|
| 142 | CALL_DISPLAY_LIBRARY PrintCharacterFromAL
|
---|
| 143 |
|
---|
| 144 | pop bx
|
---|
[3] | 145 | pop dx
|
---|
| 146 | ret
|
---|
| 147 |
|
---|
| 148 |
|
---|
| 149 | ;--------------------------------------------------------------------
|
---|
| 150 | ; BootMenuPrint_FloppyMenuitem
|
---|
| 151 | ; Parameters:
|
---|
| 152 | ; DL: Untranslated Floppy Drive number
|
---|
| 153 | ; Returns:
|
---|
[88] | 154 | ; Nothing
|
---|
[3] | 155 | ; Corrupts registers:
|
---|
[88] | 156 | ; AX, DX, SI
|
---|
[3] | 157 | ;--------------------------------------------------------------------
|
---|
| 158 | ALIGN JUMP_ALIGN
|
---|
| 159 | BootMenuPrint_FloppyMenuitem:
|
---|
[88] | 160 | push bp
|
---|
| 161 |
|
---|
| 162 | mov bp, sp
|
---|
| 163 | mov si, g_szFDLetter
|
---|
[3] | 164 | ePUSH_T ax, g_szFloppyDrv
|
---|
[88] | 165 | add dl, 'A'
|
---|
| 166 | push dx ; Drive letter
|
---|
| 167 | jmp BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
[3] | 168 |
|
---|
| 169 |
|
---|
| 170 | ;--------------------------------------------------------------------
|
---|
| 171 | ; BootMenuPrint_HardDiskMenuitem
|
---|
| 172 | ; Parameters:
|
---|
| 173 | ; DL: Untranslated Hard Disk number
|
---|
| 174 | ; DS: RAMVARS segment
|
---|
| 175 | ; Returns:
|
---|
[88] | 176 | ; CF: Set since menu event handled
|
---|
[3] | 177 | ; Corrupts registers:
|
---|
[88] | 178 | ; AX, BX, SI, DI
|
---|
[3] | 179 | ;--------------------------------------------------------------------
|
---|
| 180 | ALIGN JUMP_ALIGN
|
---|
| 181 | BootMenuPrint_HardDiskMenuitem:
|
---|
| 182 | call FindDPT_ForDriveNumber ; DS:DI to point DPT
|
---|
[88] | 183 | jnc SHORT .HardDiskMenuitemForForeignDrive
|
---|
| 184 | ; Fall to .HardDiskMenuitemForOurDrive
|
---|
[3] | 185 |
|
---|
| 186 | ;--------------------------------------------------------------------
|
---|
[88] | 187 | ; .HardDiskMenuitemForOurDrive
|
---|
[3] | 188 | ; Parameters:
|
---|
| 189 | ; DL: Untranslated Hard Disk number
|
---|
| 190 | ; DS: RAMVARS segment
|
---|
| 191 | ; Returns:
|
---|
[88] | 192 | ; CF: Set since menu event handled
|
---|
[3] | 193 | ; Corrupts registers:
|
---|
[88] | 194 | ; AX, BX, SI, DI
|
---|
[3] | 195 | ;--------------------------------------------------------------------
|
---|
[88] | 196 | ;ALIGN JUMP_ALIGN
|
---|
| 197 | .HardDiskMenuitemForOurDrive:
|
---|
| 198 | call BootInfo_GetOffsetToBX
|
---|
| 199 | lea si, [bx+BOOTNFO.szDrvName]
|
---|
| 200 | xor bx, bx ; BDA segment
|
---|
| 201 | CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI
|
---|
| 202 | stc
|
---|
| 203 | ret
|
---|
[3] | 204 |
|
---|
| 205 | ;--------------------------------------------------------------------
|
---|
[88] | 206 | ; BootMenuPrint_HardDiskMenuitemForForeignDrive
|
---|
[3] | 207 | ; Parameters:
|
---|
| 208 | ; DL: Untranslated Hard Disk number
|
---|
| 209 | ; DS: RAMVARS segment
|
---|
| 210 | ; Returns:
|
---|
[88] | 211 | ; CF: Set since menu event handled
|
---|
[3] | 212 | ; Corrupts registers:
|
---|
[88] | 213 | ; AX, SI, DI
|
---|
[3] | 214 | ;--------------------------------------------------------------------
|
---|
| 215 | ALIGN JUMP_ALIGN
|
---|
[88] | 216 | .HardDiskMenuitemForForeignDrive:
|
---|
| 217 | mov si, g_szforeignHD
|
---|
| 218 | jmp PrintNullTerminatedStringFromCSSIandSetCF
|
---|
[3] | 219 |
|
---|
| 220 |
|
---|
| 221 | ;--------------------------------------------------------------------
|
---|
| 222 | ; BootMenuPrint_FunctionMenuitem
|
---|
| 223 | ; Parameters:
|
---|
| 224 | ; DX: Function ID
|
---|
| 225 | ; Returns:
|
---|
[88] | 226 | ; CF: Set if menu event was handled successfully
|
---|
[3] | 227 | ; Corrupts registers:
|
---|
[88] | 228 | ; AX, DX, SI, DI
|
---|
[3] | 229 | ;--------------------------------------------------------------------
|
---|
| 230 | ALIGN JUMP_ALIGN
|
---|
| 231 | BootMenuPrint_FunctionMenuitem:
|
---|
| 232 | test dx, dx ; ID_BOOTFUNC_ROMBOOT
|
---|
| 233 | jz SHORT .PrintRomBootMenuitem
|
---|
| 234 | ret
|
---|
| 235 |
|
---|
| 236 | ALIGN JUMP_ALIGN
|
---|
| 237 | .PrintRomBootMenuitem:
|
---|
| 238 | mov si, g_szRomBoot
|
---|
[88] | 239 | jmp PrintNullTerminatedStringFromCSSIandSetCF
|
---|
[3] | 240 |
|
---|
| 241 |
|
---|
| 242 | ;--------------------------------------------------------------------
|
---|
| 243 | ; BootMenuPrint_FloppyMenuitemInformation
|
---|
| 244 | ; Parameters:
|
---|
| 245 | ; DL: Untranslated Floppy Drive number
|
---|
| 246 | ; DS: RAMVARS segment
|
---|
| 247 | ; Returns:
|
---|
[88] | 248 | ; CF: Set since menu event was handled successfully
|
---|
[3] | 249 | ; Corrupts registers:
|
---|
[88] | 250 | ; AX, BX, CX, DX, SI, DI, ES
|
---|
[3] | 251 | ;--------------------------------------------------------------------
|
---|
| 252 | ALIGN JUMP_ALIGN
|
---|
| 253 | BootMenuPrint_FloppyMenuitemInformation:
|
---|
[88] | 254 | call BootMenuPrint_ClearInformationArea
|
---|
| 255 | call FloppyDrive_GetType ; Get Floppy Drive type to BX
|
---|
| 256 | test bx, bx ; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)
|
---|
| 257 | jz SHORT .PrintXTFloppyType
|
---|
[3] | 258 | cmp bl, FLOPPY_TYPE_35_ED
|
---|
[88] | 259 | ja SHORT .PrintUnknownFloppyType
|
---|
| 260 | jmp SHORT .PrintKnownFloppyType
|
---|
[3] | 261 |
|
---|
| 262 | ;--------------------------------------------------------------------
|
---|
[88] | 263 | ; .PrintXTFloppyType
|
---|
[3] | 264 | ; Parameters:
|
---|
| 265 | ; Nothing
|
---|
| 266 | ; Returns:
|
---|
[88] | 267 | ; CF: Set since menu event was handled successfully
|
---|
[3] | 268 | ; Corrupts registers:
|
---|
[88] | 269 | ; AX, SI, DI
|
---|
[3] | 270 | ;--------------------------------------------------------------------
|
---|
| 271 | ALIGN JUMP_ALIGN
|
---|
[88] | 272 | .PrintXTFloppyType:
|
---|
| 273 | push bp
|
---|
[3] | 274 | mov si, g_szFddSizeOr
|
---|
[88] | 275 | jmp SHORT .FormatXTorUnknownTypeFloppyDrive
|
---|
[3] | 276 |
|
---|
| 277 | ;--------------------------------------------------------------------
|
---|
[88] | 278 | ; .PrintUnknownFloppyType
|
---|
[3] | 279 | ; Parameters:
|
---|
| 280 | ; Nothing
|
---|
| 281 | ; Returns:
|
---|
[88] | 282 | ; CF: Set since menu event was handled successfully
|
---|
[3] | 283 | ; Corrupts registers:
|
---|
[88] | 284 | ; AX, SI, DI
|
---|
[3] | 285 | ;--------------------------------------------------------------------
|
---|
| 286 | ALIGN JUMP_ALIGN
|
---|
[88] | 287 | .PrintUnknownFloppyType:
|
---|
| 288 | push bp
|
---|
[3] | 289 | mov si, g_szFddUnknown
|
---|
[88] | 290 | .FormatXTorUnknownTypeFloppyDrive:
|
---|
| 291 | mov bp, sp
|
---|
[3] | 292 | ePUSH_T ax, g_szCapacity
|
---|
[88] | 293 | jmp BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
[3] | 294 |
|
---|
| 295 | ;--------------------------------------------------------------------
|
---|
[88] | 296 | ; .PrintKnownFloppyType
|
---|
[3] | 297 | ; Parameters:
|
---|
| 298 | ; BX: Floppy drive type
|
---|
| 299 | ; Returns:
|
---|
[88] | 300 | ; CF: Set since menu event was handled successfully
|
---|
[3] | 301 | ; Corrupts registers:
|
---|
[88] | 302 | ; AX, BX, SI, DI
|
---|
[3] | 303 | ;--------------------------------------------------------------------
|
---|
| 304 | ALIGN JUMP_ALIGN
|
---|
[88] | 305 | .PrintKnownFloppyType:
|
---|
| 306 | push bp
|
---|
| 307 |
|
---|
| 308 | mov bp, sp
|
---|
| 309 | mov si, g_szFddSize
|
---|
| 310 | ePUSH_T ax, g_szCapacity
|
---|
[3] | 311 | dec bx ; Cannot be 0 (FLOPPY_TYPE_525_OR_35_DD)
|
---|
| 312 | shl bx, 1 ; Shift for WORD lookup
|
---|
| 313 | mov ax, [cs:bx+.rgwPhysicalSize]
|
---|
[88] | 314 | push ax ; '5' or '3'
|
---|
| 315 | mov al, ah
|
---|
[3] | 316 | push ax ; '1/4' or '1/2'
|
---|
[88] | 317 | push WORD [cs:bx+.rgwCapacity]
|
---|
| 318 | jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
| 319 |
|
---|
[3] | 320 | ALIGN WORD_ALIGN
|
---|
| 321 | .rgwCapacity:
|
---|
| 322 | dw 360
|
---|
| 323 | dw 1200
|
---|
| 324 | dw 720
|
---|
| 325 | dw 1440
|
---|
| 326 | dw 2880
|
---|
| 327 | dw 2880
|
---|
| 328 | .rgwPhysicalSize:
|
---|
[88] | 329 | db '5', 172 ; 1, FLOPPY_TYPE_525_DD
|
---|
| 330 | db '5', 172 ; 2, FLOPPY_TYPE_525_HD
|
---|
| 331 | db '3', 171 ; 3, FLOPPY_TYPE_35_DD
|
---|
| 332 | db '3', 171 ; 4, FLOPPY_TYPE_35_HD
|
---|
| 333 | db '3', 171 ; 5, 3.5" ED on some BIOSes
|
---|
| 334 | db '3', 171 ; 6, FLOPPY_TYPE_35_ED
|
---|
[3] | 335 |
|
---|
| 336 |
|
---|
| 337 | ;--------------------------------------------------------------------
|
---|
| 338 | ; Prints Hard Disk Menuitem information strings.
|
---|
| 339 | ;
|
---|
| 340 | ; BootMenuPrint_HardDiskMenuitemInformation
|
---|
| 341 | ; Parameters:
|
---|
| 342 | ; DL: Untranslated Hard Disk number
|
---|
| 343 | ; DS: RAMVARS segment
|
---|
| 344 | ; Returns:
|
---|
[88] | 345 | ; CF: Set since menu event was handled successfully
|
---|
[3] | 346 | ; Corrupts registers:
|
---|
| 347 | ; BX, CX, DX, SI, DI, ES
|
---|
| 348 | ;--------------------------------------------------------------------
|
---|
| 349 | ALIGN JUMP_ALIGN
|
---|
| 350 | BootMenuPrint_HardDiskMenuitemInformation:
|
---|
| 351 | call FindDPT_ForDriveNumber ; DS:DI to point DPT
|
---|
[88] | 352 | jnc SHORT .HardDiskMenuitemInfoForForeignDrive
|
---|
| 353 | call .HardDiskMenuitemInfoSizeForOurDrive
|
---|
[3] | 354 | jmp BootMenuPrintCfg_ForOurDrive
|
---|
| 355 |
|
---|
| 356 | ;--------------------------------------------------------------------
|
---|
[88] | 357 | ; .HardDiskMenuitemInfoForForeignDrive
|
---|
[3] | 358 | ; Parameters:
|
---|
| 359 | ; DL: Untranslated Hard Disk number
|
---|
| 360 | ; DS: RAMVARS segment
|
---|
| 361 | ; Returns:
|
---|
[88] | 362 | ; CF: Set since menu event was handled successfully
|
---|
[3] | 363 | ; Corrupts registers:
|
---|
| 364 | ; AX, BX, CX, DX, SI, DI
|
---|
| 365 | ;--------------------------------------------------------------------
|
---|
| 366 | ALIGN JUMP_ALIGN
|
---|
[88] | 367 | .HardDiskMenuitemInfoForForeignDrive:
|
---|
| 368 | push bp
|
---|
| 369 | mov bp, sp
|
---|
| 370 | ePUSH_T ax, g_szCapacity
|
---|
| 371 |
|
---|
[3] | 372 | call DriveXlate_ToOrBack
|
---|
| 373 | call HCapacity_GetSectorCountFromForeignAH08h
|
---|
[88] | 374 | call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
|
---|
| 375 |
|
---|
[3] | 376 | mov si, g_szSizeSingle
|
---|
[88] | 377 | jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
[3] | 378 |
|
---|
| 379 | ;--------------------------------------------------------------------
|
---|
[88] | 380 | ; .HardDiskMenuitemInfoSizeForOurDrive
|
---|
[3] | 381 | ; Parameters:
|
---|
| 382 | ; DL: Untranslated Hard Disk number
|
---|
| 383 | ; DS:DI: Ptr to DPT
|
---|
| 384 | ; Returns:
|
---|
| 385 | ; Nothing
|
---|
| 386 | ; Corrupts registers:
|
---|
| 387 | ; AX, BX, CX, DX, SI, ES
|
---|
| 388 | ;--------------------------------------------------------------------
|
---|
| 389 | ALIGN JUMP_ALIGN
|
---|
[88] | 390 | .HardDiskMenuitemInfoSizeForOurDrive:
|
---|
| 391 | push bp
|
---|
| 392 | mov bp, sp
|
---|
| 393 | ePUSH_T ax, g_szCapacity
|
---|
[3] | 394 |
|
---|
[88] | 395 | ; Get and push L-CHS size
|
---|
| 396 | call HCapacity_GetSectorCountFromOurAH08h
|
---|
| 397 | call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
|
---|
| 398 |
|
---|
[3] | 399 | ; Get and push total LBA size
|
---|
| 400 | call BootInfo_GetTotalSectorCount
|
---|
[88] | 401 | call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
|
---|
[3] | 402 |
|
---|
| 403 | mov si, g_szSizeDual
|
---|
[88] | 404 | ; Fall to BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
[3] | 405 |
|
---|
| 406 |
|
---|
| 407 | ;--------------------------------------------------------------------
|
---|
[88] | 408 | ; BootMenuPrint_FormatCSSIfromParamsInSSBP
|
---|
| 409 | ; Parameters:
|
---|
| 410 | ; CS:SI: Ptr to string to format
|
---|
| 411 | ; SS:BP: Ptr to format parameters
|
---|
| 412 | ; Returns:
|
---|
| 413 | ; BP: Popped from stack
|
---|
| 414 | ; Corrupts registers:
|
---|
| 415 | ; AX
|
---|
| 416 | ;--------------------------------------------------------------------
|
---|
| 417 | ALIGN JUMP_ALIGN
|
---|
| 418 | BootMenuPrint_FormatCSSIfromParamsInSSBP:
|
---|
| 419 | push di
|
---|
| 420 | CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
|
---|
| 421 | stc ; Successfull return from menu event
|
---|
| 422 | pop di
|
---|
| 423 | pop bp
|
---|
| 424 | ret
|
---|
| 425 |
|
---|
| 426 |
|
---|
| 427 | ;--------------------------------------------------------------------
|
---|
| 428 | ; ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
|
---|
| 429 | ; Parameters:
|
---|
| 430 | ; BX:DX:AX: Sector count
|
---|
| 431 | ; Returns:
|
---|
| 432 | ; Size in stack
|
---|
| 433 | ; Corrupts registers:
|
---|
| 434 | ; AX, BX, CX, DX, SI
|
---|
| 435 | ;--------------------------------------------------------------------
|
---|
| 436 | ALIGN JUMP_ALIGN
|
---|
| 437 | ConvertSectorCountInBXDXAXtoSizeAndPushForFormat:
|
---|
| 438 | pop si ; Pop return address
|
---|
| 439 | call Size_ConvertSectorCountInBXDXAXtoKiB
|
---|
| 440 | mov cx, BYTE_MULTIPLES.kiB
|
---|
| 441 | call Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX
|
---|
| 442 | push ax ; Size in magnitude
|
---|
| 443 | push cx ; Tenths
|
---|
| 444 | push dx ; Magnitude character
|
---|
| 445 | jmp si
|
---|
| 446 |
|
---|
| 447 |
|
---|
| 448 | ;--------------------------------------------------------------------
|
---|
| 449 | ; PrintNullTerminatedStringFromCSSIandSetCF
|
---|
| 450 | ; Parameters:
|
---|
| 451 | ; CS:SI: Ptr to NULL terminated string to print
|
---|
| 452 | ; Returns:
|
---|
| 453 | ; CF: Set since menu event was handled successfully
|
---|
| 454 | ; Corrupts registers:
|
---|
| 455 | ; AX, DI
|
---|
| 456 | ;--------------------------------------------------------------------
|
---|
| 457 | ALIGN JUMP_ALIGN
|
---|
| 458 | PrintNullTerminatedStringFromCSSIandSetCF:
|
---|
| 459 | CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
|
---|
| 460 | stc
|
---|
| 461 | ret
|
---|
| 462 |
|
---|
| 463 |
|
---|
| 464 | ;--------------------------------------------------------------------
|
---|
| 465 | ; BootMenuPrint_ClearInformationArea
|
---|
| 466 | ; Parameters:
|
---|
| 467 | ; Nothing
|
---|
| 468 | ; Returns:
|
---|
| 469 | ; CF: Set
|
---|
| 470 | ; Corrupts registers:
|
---|
| 471 | ; AX, DI
|
---|
| 472 | ;--------------------------------------------------------------------
|
---|
| 473 | ALIGN JUMP_ALIGN
|
---|
| 474 | BootMenuPrint_ClearInformationArea:
|
---|
| 475 | CALL_MENU_LIBRARY ClearInformationArea
|
---|
| 476 | stc
|
---|
| 477 | ret
|
---|
| 478 |
|
---|
| 479 |
|
---|
| 480 | ;--------------------------------------------------------------------
|
---|
| 481 | ; Prints information strings to the bottom of the screen.
|
---|
[3] | 482 | ;
|
---|
[88] | 483 | ; BootMenuPrint_TheBottomOfScreen
|
---|
[3] | 484 | ; Parameters:
|
---|
| 485 | ; DS: RAMVARS segment
|
---|
| 486 | ; Returns:
|
---|
[88] | 487 | ; Nothing
|
---|
[3] | 488 | ; Corrupts registers:
|
---|
[88] | 489 | ; AX, BX, CX, DX, SI
|
---|
[3] | 490 | ;--------------------------------------------------------------------
|
---|
| 491 | ALIGN JUMP_ALIGN
|
---|
[88] | 492 | BootMenuPrint_TheBottomOfScreen:
|
---|
| 493 | call FloppyDrive_GetCount
|
---|
| 494 | mov bl, cl ; Floppy Drive count to BL
|
---|
| 495 | call RamVars_GetHardDiskCountFromBDAtoCX
|
---|
| 496 | mov bh, cl ; Hard Disk count to BH
|
---|
| 497 | call BootMenuPrint_GetCoordinatesForBottomStrings
|
---|
| 498 | call BootMenuPrint_SetCursorPosition
|
---|
| 499 | call BootMenuPrint_FloppyHotkeyString
|
---|
| 500 | jmp BootMenuPrint_HardDiskHotkeyString
|
---|
[3] | 501 |
|
---|
| 502 |
|
---|
| 503 | ;--------------------------------------------------------------------
|
---|
[88] | 504 | ; Returns coordinates for bottom strings.
|
---|
[3] | 505 | ;
|
---|
[88] | 506 | ; BootMenuPrint_GetCoordinatesForBottomStrings
|
---|
[3] | 507 | ; Parameters:
|
---|
[88] | 508 | ; BL: Number of floppy drives in system
|
---|
| 509 | ; BH: Number of hard disks in system
|
---|
| 510 | ; Returns:
|
---|
| 511 | ; DL: Cursor X coordinate
|
---|
| 512 | ; DH: Cursor Y coordinate
|
---|
| 513 | ; Corrupts registers:
|
---|
[3] | 514 | ; Nothing
|
---|
[88] | 515 | ;--------------------------------------------------------------------
|
---|
| 516 | ALIGN JUMP_ALIGN
|
---|
| 517 | BootMenuPrint_GetCoordinatesForBottomStrings:
|
---|
| 518 | mov dx, 1800h ; (0, 24)
|
---|
| 519 | cmp dl, bl ; Set CF if any floppy drives
|
---|
| 520 | sbb dh, dl ; Decrement Y-coordinate if necessary
|
---|
| 521 | cmp dl, bh ; Set CF if any hard disks
|
---|
| 522 | sbb dh, dl ; Decrement Y-coordinate if necessary
|
---|
| 523 | ret
|
---|
| 524 |
|
---|
| 525 |
|
---|
| 526 | ;--------------------------------------------------------------------
|
---|
| 527 | ; Sets cursor to wanted screen coordinates.
|
---|
| 528 | ;
|
---|
| 529 | ; BootMenuPrint_SetCursorPosition
|
---|
| 530 | ; Parameters:
|
---|
| 531 | ; DL: Cursor X coordinate
|
---|
| 532 | ; DH: Cursor Y coordinate
|
---|
[3] | 533 | ; Returns:
|
---|
[88] | 534 | ; Nothing
|
---|
[3] | 535 | ; Corrupts registers:
|
---|
[88] | 536 | ; AX
|
---|
[3] | 537 | ;--------------------------------------------------------------------
|
---|
| 538 | ALIGN JUMP_ALIGN
|
---|
[88] | 539 | BootMenuPrint_SetCursorPosition:
|
---|
| 540 | push di
|
---|
| 541 | mov ax, dx
|
---|
| 542 | CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
|
---|
| 543 | pop di
|
---|
| 544 | ret
|
---|