Changeset 592 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/Dialog
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r589 r592 249 249 ALIGN JUMP_ALIGN 250 250 AppendFileFromDTAinDSSItoOffScreenBuffer: 251 call .FilterCurrentDirectory ; We never want "." 252 call .FilterUpDirectoryWhenInRoot ; No ".." when in root directory 251 cmp WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS 252 je SHORT .Return ; We never want "." 253 test dl, dl 254 jnz SHORT .NotInRootDirectory 255 cmp WORD [si+DTA.szFile], UPDIR_CHARACTERS 256 je SHORT .Return ; No ".." when in root directory 257 .NotInRootDirectory: 253 258 inc cx ; Nothing filtered so increment files/directories 254 259 … … 262 267 pop si 263 268 pop bp 264 ret 265 266 ;-------------------------------------------------------------------- 267 ; .FilterCurrentDirectory 268 ; .FilterUpDirectoryWhenInRoot 269 ; Parameters: 270 ; DL: Zero if root directory selected 271 ; DS:SI: Ptr to DTA containing file information 272 ; Returns: 273 ; Nothing 274 ; Returns from AppendFileToBufferInESDIfromDtaInDSSI when filtering 275 ; Corrupts registers: 276 ; AX 277 ;-------------------------------------------------------------------- 278 ALIGN JUMP_ALIGN 279 .FilterCurrentDirectory: 280 cmp WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS 281 je SHORT .DoFilter 282 ret 283 284 ALIGN JUMP_ALIGN 285 .FilterUpDirectoryWhenInRoot: 286 test dl, dl ; Set ZF if root directory selected 287 jnz SHORT .ReturnWithoutFiltering 288 cmp WORD [si+DTA.szFile], UPDIR_CHARACTERS 289 jne SHORT .ReturnWithoutFiltering 290 .DoFilter: 291 add sp, BYTE 2 ; Remove return address from stack 292 ALIGN JUMP_ALIGN, ret 293 .ReturnWithoutFiltering: 269 .Return: 294 270 ret 295 271 … … 473 449 ALIGN JUMP_ALIGN 474 450 GetInfoLinesToCXandDialogFlagsToAX: 475 xor ax, ax476 call GetDialogFlagsToAL477 jmp Bit_GetSetCountToCXfromAX451 ePUSH_T ax, Bit_GetSetCountToCXfromAX 452 xor ah, ah 453 ; Fall to GetDialogFlagsToAL 478 454 479 455 ;-------------------------------------------------------------------- … … 696 672 call .ChangeDriveToUserSelectionFromIoInDSSI 697 673 add sp, BYTE DRIVE_DIALOG_IO_size 674 .UserCancelledDriveChange: 698 675 ret 699 676 … … 729 706 jne SHORT .UserCancelledDriveChange 730 707 708 ; Install our Custom Critical Error Handler to catch "Drive Not Ready" errors. This handler only works on DOS 3.0+ systems 709 ; but that should be OK because only DOS 3.1+ will trigger it. Under older DOS versions drives are enumerated using 710 ; GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE which will access the drive so we know it is available at this point. 711 mov dx, DosCritical_CustomHandler 712 call DosCritical_InstallNewHandlerFromCSDX 713 714 ; Save the current drive on stack in case the selected drive is not ready and the user decides to cancel the change. 715 call Drive_GetDefaultToAL 716 xchg dx, ax 717 718 .RetryDrive: 719 push dx ; Save the previous current drive to stack 720 731 721 mov dl, [si+DRIVE_DIALOG_IO.bReturnDriveNumber] 732 722 call Drive_SetDefaultFromDL 723 724 ; Now we must try to force a media access to catch "Drive Not Ready". 725 push ds 726 push ss 727 pop ds 728 ePUSH_T ax, CURRENTDIR_CHARACTERS 729 mov cx, FLG_FILEATTR_DIRECTORY 730 mov dx, sp 731 mov ax, FIND_FIRST_MATCHING_FILE<<8 732 int DOS_INTERRUPT_21h 733 pop ax 734 pop ds 735 736 pop dx ; Restore the previous current drive from stack 737 738 xchg ah, [cs:bLastCriticalError] ; Zero bLastCriticalError and fetch error code to AH 739 cmp ah, ERR_DOS_DRIVE_NOT_READY 740 jne SHORT .DriveIsReady 741 742 mov bx, g_szDlgDriveNotReady 743 call Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX 744 jz SHORT .RetryDrive 745 ; The user cancelled the drive change. Restore current drive to what it was previously. 746 call Drive_SetDefaultFromDL 747 jmp DosCritical_RestoreDosHandler 748 749 .DriveIsReady: 750 call DosCritical_RestoreDosHandler 733 751 jmp RefreshFilesToDisplay 734 .UserCancelledDriveChange:735 ret736 752 737 753
Note:
See TracChangeset
for help on using the changeset viewer.