Changeset 54 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/Dialog
- Timestamp:
- Oct 24, 2010, 11:01:17 AM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library/Src/Menu/Dialog
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r53 r54 2 2 ; Project name : Assembly Library 3 3 ; Created date : 6.9.2010 4 ; Last update : 13.10.20104 ; Last update : 24.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Displays file dialog. … … 49 49 .ItemSelectedFromCX: 50 50 call LoadItemStringBufferToESDI 51 call Memory_CopyESDItoDSSI51 call Registers_CopyESDItoDSSI 52 52 call ItemLineSplitter_GetLineToDSSIandLengthToCXfromStringInDSSIwithIndexInCX 53 53 jmp ParseSelectionFromItemLineInDSSI … … 113 113 114 114 ;-------------------------------------------------------------------- 115 ; ReInitializeMenuinitFromSSBP 115 116 ; InitializeMenuinitFromSSBP 116 117 ; Parameters: 117 ; DS:SI: Ptr to MENUINIT to initialize (also points to DIALOG)118 118 ; SS:BP: Ptr to DIALOG 119 119 ; Returns: … … 123 123 ;-------------------------------------------------------------------- 124 124 ALIGN JUMP_ALIGN 125 ReInitializeMenuinitFromSSBP: 126 call DisplayLoadingMessageInInformationArea 125 127 InitializeMenuinitFromSSBP: 126 128 call LoadItemStringBufferToESDI … … 129 131 call SortDirectoryContentsStringFromESDIwithCountInCX 130 132 call RemoveLastLFandTerminateESDIwithNull 131 call Memory_CopySSBPtoDSSI 133 134 call Registers_CopySSBPtoDSSI 132 135 xor ax, ax 133 136 call Dialog_EventInitializeMenuinitFromDSSIwithHighlightedItemInAX … … 199 202 ALIGN JUMP_ALIGN 200 203 .ClearDLifInRootDirectory: 201 call Memory_CopyESDItoDSSI204 call Registers_CopyESDItoDSSI 202 205 call Directory_WriteCurrentPathToDSSI 203 206 mov dl, [si] … … 375 378 ALIGN JUMP_ALIGN 376 379 SortDirectoryContentsStringFromESDIwithCountInCX: 377 call Memory_CopyESDItoDSSI380 call Registers_CopyESDItoDSSI 378 381 call .AddDirectoryContentsStringLengthToDI 379 382 mov bx, .FileStringComparator … … 431 434 cmp bh, bl 432 435 jmp SHORT .ReturnFromComparison 436 437 438 ;-------------------------------------------------------------------- 439 ; RemoveLastLFandTerminateESDIwithNull 440 ; Parameters: 441 ; ES:DI: Ptr to end of buffer to terminate 442 ; Returns: 443 ; Nothing 444 ; Corrupts registers: 445 ; AX 446 ;-------------------------------------------------------------------- 447 ALIGN JUMP_ALIGN 448 RemoveLastLFandTerminateESDIwithNull: 449 dec di 450 xor ax, ax 451 stosb 452 ret 433 453 434 454 … … 547 567 ALIGN JUMP_ALIGN 548 568 RefreshFilesToDisplay: 549 call InitializeMenuinitFromSSBP569 call ReInitializeMenuinitFromSSBP 550 570 jmp MenuInit_RefreshMenuWindow 551 571 … … 661 681 jz SHORT ReturnWithoutHandlingKeystroke 662 682 663 call .ShowDriveSelectionDialogAndGetDriveNumberToDL 664 jnc SHORT RefreshFilesToDisplay 683 call DisplayLoadingMessageInInformationArea 684 mov cx, DRIVE_DIALOG_IO_size 685 call Memory_ReserveCXbytesFromStackToDSSI 686 call .DisplayDriveSelectionDialogWithIoInDSSI 687 call .ChangeDriveToUserSelectionFromIoInDSSI 688 add sp, BYTE DRIVE_DIALOG_IO_size 689 ret 690 691 ;-------------------------------------------------------------------- 692 ; .DisplayDriveSelectionDialogWithIoInDSSI 693 ; Parameters: 694 ; DS:SI: Ptr to uninitialized DRIVE_DIALOG_IO 695 ; SS:BP: Ptr to DIALOG 696 ; Returns: 697 ; DS:SI: Ptr to DRIVE_DIALOG_IO 698 ; Corrupts registers: 699 ; AX, DI 700 ;-------------------------------------------------------------------- 701 ALIGN JUMP_ALIGN 702 .DisplayDriveSelectionDialogWithIoInDSSI: 703 call InitializeNullStringsToDialogInputInDSSI 704 mov WORD [si+DIALOG_INPUT.fszTitle], g_szSelectNewDrive 705 CALL_MENU_LIBRARY GetDriveWithIoInDSSI 706 ret 707 708 ;-------------------------------------------------------------------- 709 ; .ChangeDriveToUserSelectionFromIoInDSSI 710 ; Parameters: 711 ; DS:SI: Ptr to DRIVE_DIALOG_IO 712 ; SS:BP: Ptr to DIALOG 713 ; Returns: 714 ; Nothing 715 ; Corrupts registers: 716 ; All, except BP 717 ;-------------------------------------------------------------------- 718 ALIGN JUMP_ALIGN 719 .ChangeDriveToUserSelectionFromIoInDSSI: 720 cmp BYTE [si+DRIVE_DIALOG_IO.bUserCancellation], FALSE 721 jne SHORT .UserCancelledDriveChange 722 723 mov dl, [si+DRIVE_DIALOG_IO.bReturnDriveNumber] 665 724 call Drive_SetDefaultFromDL 666 jmp SHORT RefreshFilesToDisplay 667 668 ;-------------------------------------------------------------------- 669 ; .ShowDriveSelectionDialogAndGetDriveNumberToDL 670 ; Parameters: 671 ; SS:BP: Ptr to DIALOG 672 ; Returns: 673 ; DL: Drive selected by user 674 ; CF: Set if new drive selected 675 ; Cleared if selection cancelled by user 676 ; Corrupts registers: 677 ; All, except BP 678 ;-------------------------------------------------------------------- 679 ALIGN JUMP_ALIGN 680 .ShowDriveSelectionDialogAndGetDriveNumberToDL: 681 mov cx, DIALOG_INPUT_size 682 call Memory_ReserveCXbytesFromStackToDSSI 683 call .InitializeDialogInputInDSSIforDriveSelection 684 call DialogSelection_GetSelectionToAXwithInputInDSSI 685 add sp, BYTE DIALOG_INPUT_size 686 cmp ax, BYTE NO_ITEM_SELECTED ; Clear CF if equal 687 jne SHORT .ConvertDriveNumberToDLfromItemIndexInAX 688 ret 689 690 ALIGN JUMP_ALIGN 691 .InitializeDialogInputInDSSIforDriveSelection: 692 call InitializeNullStringsToDialogInputInDSSI 693 call LoadItemStringBufferToESDI 694 mov WORD [si+DIALOG_INPUT.fszTitle], g_szSelectNewDrive 695 mov [si+DIALOG_INPUT.fszItems], di 696 mov [si+DIALOG_INPUT.fszItems+2], es 697 call Drive_GetFlagsForAvailableDrivesToDXAX 698 ; Fall to .GenerateDriveSelectionStringToESDIfromDriveFlagsInDXAX 699 700 ;-------------------------------------------------------------------- 701 ; .GenerateDriveSelectionStringToESDIfromDriveFlagsInDXAX 702 ; Parameters: 703 ; DX:AX: Drive letter flags 704 ; ES:DI: Ptr to item string buffer 705 ; SS:BP: Ptr to DIALOG 706 ; Returns: 707 ; Nothing 708 ; Corrupts registers: 709 ; AX, BX, CX, DX, DI, ES 710 ;-------------------------------------------------------------------- 711 ;ALIGN JUMP_ALIGN 712 .GenerateDriveSelectionStringToESDIfromDriveFlagsInDXAX: 713 cld 714 xchg cx, ax 715 mov ax, 3A41h ; A: 716 ALIGN JUMP_ALIGN 717 .BitShiftLoop: 718 shr dx, 1 719 rcr cx, 1 720 jnc SHORT .CheckIfMoreDrivesLeft 721 stosw 722 mov BYTE [es:di], LF 723 inc di 724 ALIGN JUMP_ALIGN 725 .CheckIfMoreDrivesLeft: 726 inc ax ; Next drive letter 727 mov bx, dx 728 or bx, cx 729 jnz SHORT .BitShiftLoop 730 jmp SHORT TerminateESDIwithNull 731 732 ;-------------------------------------------------------------------- 733 ; .ConvertDriveNumberToDLfromItemIndexInAX 734 ; Parameters: 735 ; AX: Selected drive item 736 ; Returns: 737 ; DL: Drive number 738 ; CF: Set since drive selected 739 ; Corrupts registers: 740 ; AX, CX, DH 741 ;-------------------------------------------------------------------- 742 ALIGN JUMP_ALIGN 743 .ConvertDriveNumberToDLfromItemIndexInAX: 744 mov ah, -1 745 xchg cx, ax 746 call Drive_GetFlagsForAvailableDrivesToDXAX 747 ALIGN JUMP_ALIGN 748 .BitScanLoop: 749 shr dx, 1 750 rcr ax, 1 751 inc ch ; Increment drive number 752 sbb cl, 0 ; Decrement selection index 753 jnc SHORT .BitScanLoop 754 mov dl, ch 755 stc ; Drive selected by user 756 ret 757 758 759 ;-------------------------------------------------------------------- 760 ; RemoveLastLFandTerminateESDIwithNull 761 ; TerminateESDIwithNull 762 ; Parameters: 763 ; ES:DI: Ptr to end of buffer to terminate 764 ; Returns: 765 ; Nothing 766 ; Corrupts registers: 767 ; AX 768 ;-------------------------------------------------------------------- 769 ALIGN JUMP_ALIGN 770 RemoveLastLFandTerminateESDIwithNull: 771 dec di 772 ALIGN JUMP_ALIGN 773 TerminateESDIwithNull: 774 xor ax, ax 775 stosb 725 jmp RefreshFilesToDisplay 726 .UserCancelledDriveChange: 727 ret 728 729 730 ;-------------------------------------------------------------------- 731 ; DisplayLoadingMessageInInformationArea 732 ; Parameters: 733 ; SS:BP: Ptr to DIALOG 734 ; Returns: 735 ; Nothing 736 ; Corrupts registers: 737 ; AX, BX, CX, DX, SI, DI 738 ;-------------------------------------------------------------------- 739 ALIGN JUMP_ALIGN 740 DisplayLoadingMessageInInformationArea: 741 call MenuText_ClearInformationArea 742 call MenuText_PrepareToDrawInformationArea 743 mov si, g_szLoadingPleaseWait 744 CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI 776 745 ret 777 746 -
trunk/Assembly_Library/Src/Menu/Dialog/StringsForDialogs.asm
r46 r54 2 2 ; Project name : Assembly Library 3 3 ; Created date : 14.9.2010 4 ; Last update : 1.10.20104 ; Last update : 23.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Strings used by dialogs. … … 11 11 g_szTimeFormat: db " %2-u min %2-u sec",LF,CR,NULL 12 12 13 ; Strings for Drive Dialog 14 g_szDriveFormat: db "%c:",NULL 15 13 16 ; Strings for File Dialog 14 17 g_szChangeDrive: db "F2 Change Drive",LF,CR,NULL … … 18 21 g_szSelectNewDrive: 19 22 db "Select new drive.",NULL 23 g_szLoadingPleaseWait: 24 db "Loading. Please wait...",NULL 20 25 21 26 g_szEnterNewFileOrDirectory:
Note:
See TracChangeset
for help on using the changeset viewer.