Changeset 48 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu
- Timestamp:
- Oct 8, 2010, 3:44:05 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library/Src/Menu
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Menu/Dialog/Dialog.asm
r46 r48 2 2 ; Project name : Assembly Library 3 3 ; Created date : 6.8.2010 4 ; Last update : 1.10.20104 ; Last update : 7.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Common functions for many dialogs. … … 291 291 ALIGN JUMP_ALIGN 292 292 .RedrawDialogAreaAndWholeParentWindow: 293 push si 294 call MenuBorders_AdjustDisplayContextForDrawingBorders 295 pop si 293 296 mov al, SCREEN_BACKGROUND_ATTRIBUTE 294 297 CALL_DISPLAY_LIBRARY SetCharacterAttributeFromAL 295 call MenuLocation_GetTitleBordersTopLeftCoordinatesToAX296 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX297 298 mov ax, [bp+MENUINIT.wWidthAndHeight] 298 299 CALL_DISPLAY_LIBRARY ClearAreaWithHeightInAHandWidthInAL -
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r46 r48 260 260 mov bx, di 261 261 CALL_DISPLAY_LIBRARY PushDisplayContext 262 263 xchg ax, bx 264 mov bx, es 265 CALL_DISPLAY_LIBRARY SetCharacterPointerFromBXAX 266 mov bl, ATTRIBUTES_NOT_USED 267 mov ax, BUFFER_OUTPUT_WITH_CHAR_ONLY 268 CALL_DISPLAY_LIBRARY SetCharOutputFunctionFromAXwithAttribFlagInBL 262 CALL_DISPLAY_LIBRARY PrepareOffScreenBufferInESBXtoESDI 269 263 270 264 call .FormatFileOrDirectoryToBufferFromDTAinDSSI 271 265 272 266 CALL_DISPLAY_LIBRARY GetCharacterPointerToBXAX 273 mov es, bx274 267 xchg bx, ax 275 268 CALL_DISPLAY_LIBRARY PopDisplayContext -
trunk/Assembly_Library/Src/Menu/Dialog/DialogProgress.asm
r45 r48 33 33 ; Nothing 34 34 ; Corrupts registers: 35 ; AX, BX, DX, SI, DI35 ; AX, BX, CX, DX, SI, DI 36 36 ;-------------------------------------------------------------------- 37 37 ALIGN JUMP_ALIGN -
trunk/Assembly_Library/Src/Menu/Menu.asm
r41 r48 2 2 ; Project name : Assembly Library 3 3 ; Created date : 3.8.2010 4 ; Last update : 15.9.20104 ; Last update : 7.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Menu Library functions for CALL_MENU_LIBRARY macro … … 46 46 47 47 ;at MENU_LIB.SetTitleHeightFromAL, dw MenuInit_SetTitleHeightFromAL ; Special case in CALL_MENU_LIBRARY 48 at MENU_LIB.ClearTitleArea, dw MenuText_ClearTitleArea 48 49 at MENU_LIB.RefreshTitle, dw MenuText_RefreshTitle 49 50 … … 53 54 54 55 ;at MENU_LIB.SetInformationHeightFromAL, dw MenuInit_SetInformationHeightFromAL ; Special case in CALL_MENU_LIBRARY 56 at MENU_LIB.ClearInformationArea, dw MenuText_ClearInformationArea 55 57 at MENU_LIB.RefreshInformation, dw MenuText_RefreshInformation 56 58 -
trunk/Assembly_Library/Src/Menu/MenuCharOut.asm
r41 r48 2 2 ; Project name : Assembly Library 3 3 ; Created date : 15.7.2010 4 ; Last update : 4.8.20104 ; Last update : 8.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Character out function for printing withing menu window. … … 29 29 ALIGN JUMP_ALIGN 30 30 .PrintCRandAdjustColumnToMenuBorders: 31 call DisplayCharOut_ TeletypeOutputWithAttribute31 call DisplayCharOut_BiosTeletypeOutput 32 32 xor ax, ax ; No offset, cursor to start of border 33 33 jmp SHORT SetCursorToNextMenuLine … … 35 35 36 36 ;-------------------------------------------------------------------- 37 ; MenuCharOut_MenuTextTeletypeOutputWithAttributeAndAutomaticLineChange 37 38 ; MenuCharOut_MenuTextTeletypeOutputWithAttribute 38 39 ; Parameters: … … 47 48 ;-------------------------------------------------------------------- 48 49 ALIGN JUMP_ALIGN 50 MenuCharOut_MenuTextTeletypeOutputWithAttributeAndAutomaticLineChange: 51 push di 52 push ax 53 mov al, DOUBLE_VERTICAL 54 add di, BYTE MENU_TEXT_COLUMN_OFFSET ; Border char comes after space 55 WAIT_RETRACE_IF_NECESSARY_THEN scasb 56 pop ax 57 pop di 58 je SHORT MovePartialWordToNewTextLineAndPrintCharacterFromAX 59 ; Fall to MenuCharOut_MenuTextTeletypeOutputWithAttribute 60 61 ALIGN JUMP_ALIGN 49 62 MenuCharOut_MenuTextTeletypeOutputWithAttribute: 50 63 cmp al, CR ; Carriage return? 51 je SHORT .PrintCRandAdjustColumnToMenuText64 je SHORT PrintCRfromALandAdjustColumnToMenuText 52 65 jmp DisplayCharOut_TeletypeOutputWithAttribute 53 66 54 ALIGN JUMP_ALIGN 55 .PrintCRandAdjustColumnToMenuText: 56 call DisplayCharOut_TeletypeOutputWithAttribute 67 68 ;-------------------------------------------------------------------- 69 ; MovePartialWordToNewTextLineAndPrintCharacterFromAX 70 ; Parameters: 71 ; AL: Character to output 72 ; AH: Attribute to output 73 ; DS: BDA segment (zero) 74 ; ES:DI: Ptr to end of text line in video memory 75 ; Returns: 76 ; DI: Incremented for next character 77 ; Corrupts registers: 78 ; AX, DX 79 ;-------------------------------------------------------------------- 80 ALIGN JUMP_ALIGN 81 MovePartialWordToNewTextLineAndPrintCharacterFromAX: 82 cmp al, ' ' 83 je SHORT .MoveCursorInDItoBeginningOfNextLine 84 push si 85 push cx 86 push ax 87 88 call .GetOffsetToPartialWordToSIandSizeToCX 89 call .MoveCursorInDItoBeginningOfNextLine 90 jcxz .NothingToMove 91 call .MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX 92 .NothingToMove: 93 pop ax 94 pop cx 95 pop si 96 jmp DisplayCharOut_TeletypeOutputWithAttribute 97 98 ;-------------------------------------------------------------------- 99 ; .GetOffsetToPartialWordToSIandSizeToCX 100 ; Parameters: 101 ; ES:DI: Ptr to space before border character 102 ; Returns: 103 ; CX: Number of bytes that needs to be moved 104 ; ES:SI: Ptr to beginning of partial word that needs to be moved to new line 105 ; Corrupts registers: 106 ; Nothing 107 ;-------------------------------------------------------------------- 108 ALIGN JUMP_ALIGN 109 .GetOffsetToPartialWordToSIandSizeToCX: 110 xor cx, cx 111 mov si, di 112 ALIGN JUMP_ALIGN 113 .ScanNextCharacter: ; Space will always be found since one comes after border 114 dec si 115 dec si 116 cmp BYTE [es:si], ' ' 117 je SHORT .PartialWordFound 118 inc cx 119 jmp SHORT .ScanNextCharacter 120 ALIGN JUMP_ALIGN 121 .PartialWordFound: 122 inc si 123 inc si ; SI now points one past space 124 shl cx, 1 ; Characters to bytes 125 ret 126 127 ;-------------------------------------------------------------------- 128 ; .MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX 129 ; Parameters: 130 ; CX: Number of bytes in partial word 131 ; DS: BDA segment (zero) 132 ; ES:SI: Ptr to partial word on previous line 133 ; ES:DI: Ptr to new empty line 134 ; Returns: 135 ; ES:DI: Ptr where to store next character 136 ; Corrupts registers: 137 ; AX, CX, DX, SI 138 ;-------------------------------------------------------------------- 139 ALIGN JUMP_ALIGN 140 .MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX: 141 push si 142 push cx 143 WAIT_RETRACE_IF_NECESSARY_THEN rep movsb 144 pop cx 145 pop si 146 xchg di, si 147 shr cx, 1 ; Bytes to characters 148 mov al, ' ' 149 call DisplayPrint_RepeatCharacterFromALwithCountInCX 150 mov di, si 151 ret 152 153 ;-------------------------------------------------------------------- 154 ; .MoveCursorInDItoBeginningOfNextLine 155 ; Parameters: 156 ; DS: BDA segment (zero) 157 ; ES:DI: Ptr to cursor location 158 ; Returns: 159 ; ES:DI: Ptr to beginning of new line 160 ; Corrupts registers: 161 ; AX, DX 162 ;-------------------------------------------------------------------- 163 ALIGN JUMP_ALIGN 164 .MoveCursorInDItoBeginningOfNextLine: 165 mov al, LF 166 call DisplayCharOut_BiosTeletypeOutput 167 mov al, CR 168 ; Fall to PrintCRfromALandAdjustColumnToMenuText 169 170 171 ;-------------------------------------------------------------------- 172 ; PrintCRfromALandAdjustColumnToMenuText 173 ; Parameters: 174 ; AL: Character to output (CR) 175 ; DS: BDA segment (zero) 176 ; ES:DI: Ptr to video memory where to output 177 ; Returns: 178 ; DI: Incremented for next text line 179 ; Corrupts registers: 180 ; AX, DX 181 ;-------------------------------------------------------------------- 182 ALIGN JUMP_ALIGN 183 PrintCRfromALandAdjustColumnToMenuText: 184 call DisplayCharOut_BiosTeletypeOutput 57 185 mov al, MENU_TEXT_COLUMN_OFFSET ; Offset to start of text 58 186 ; Fall to SetCursorToNextMenuLine -
trunk/Assembly_Library/Src/Menu/MenuEvent.asm
r41 r48 2 2 ; Project name : Assembly Library 3 3 ; Created date : 13.7.2010 4 ; Last update : 11.8.20104 ; Last update : 5.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for initializing menu system. … … 65 65 ; MenuEvent_RefreshInformation 66 66 ; Parameters 67 ; SS:BP: Ptr to MENU 67 68 ; Cursor will be positioned to beginning of window 68 69 ; Returns: … … 70 71 ; Cleared if event not processed 71 72 ; Corrupts registers: 72 ; AX, BX, DX73 ; AX, CX, BX, DX 73 74 ;-------------------------------------------------------------------- 74 75 ALIGN JUMP_ALIGN 75 76 MenuEvent_RefreshTitle: 76 77 mov bx, MENUEVENT.RefreshTitle 77 jmp SHORT MenuEvent_SendFromBX 78 jmp SHORT LoadHighlightedItemToCXandSendMessageFromBX 79 78 80 ALIGN JUMP_ALIGN 79 81 MenuEvent_RefreshInformation: 80 82 mov bx, MENUEVENT.RefreshInformation 83 LoadHighlightedItemToCXandSendMessageFromBX: 84 mov cx, [bp+MENU.wHighlightedItem] 81 85 jmp SHORT MenuEvent_SendFromBX 82 86 … … 86 90 ; Parameters 87 91 ; CX: Index of item to refresh 92 ; SS:BP: Ptr to MENU 88 93 ; Cursor has been positioned to the beginning of item line 89 94 ; Returns: … … 103 108 ; Parameters 104 109 ; CX: Index of item to highlight 110 ; SS:BP: Ptr to MENU 105 111 ; Returns: 106 112 ; Nothing … … 128 134 ; AL: ASCII character for the key 129 135 ; AH: Keyboard library scan code for the key 136 ; SS:BP: Ptr to MENU 130 137 ; Returns: 131 138 ; CF: Set if event processed … … 144 151 ; Parameters 145 152 ; CX: Index of selected item 153 ; SS:BP: Ptr to MENU 146 154 ; Returns: 147 155 ; CF: Set if event processed -
trunk/Assembly_Library/Src/Menu/MenuInit.asm
r46 r48 2 2 ; Project name : Assembly Library 3 3 ; Created date : 13.7.2010 4 ; Last update : 1.10.20104 ; Last update : 5.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for initializing menu system. … … 113 113 jmp MenuScrollbars_MoveHighlightedItemByAX 114 114 115 ;-------------------------------------------------------------------- 116 ; MenuInit_GetHighlightedItemToAX 117 ; Parameters 118 ; SS:BP: Ptr to MENU 119 ; Returns: 120 ; AX: Index of highlighted item or NO_ITEM_HIGHLIGHTED 121 ; Corrupts registers: 122 ; Nothing 123 ;-------------------------------------------------------------------- 124 ALIGN JUMP_ALIGN 125 MenuInit_GetHighlightedItemToAX: 126 mov ax, [bp+MENU.wHighlightedItem] 127 ret 128 115 129 116 130 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/Menu/MenuText.asm
r45 r48 2 2 ; Project name : Assembly Library 3 3 ; Created date : 21.7.2010 4 ; Last update : 28.9.20104 ; Last update : 7.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for drawing menu texts by the user. … … 10 10 11 11 ;-------------------------------------------------------------------- 12 ; MenuText_ClearTitleArea 13 ; MenuText_ClearInformationArea 14 ; Parameters 15 ; SS:BP: Ptr to MENU 16 ; Returns: 17 ; Nothing 18 ; Corrupts registers: 19 ; AX, BX, CX, DX, SI, DI 20 ;-------------------------------------------------------------------- 21 ALIGN JUMP_ALIGN 22 MenuText_ClearTitleArea: 23 call PrepareToDrawTitleArea 24 mov cl, [bp+MENUINIT.bTitleLines] 25 jmp SHORT ClearCLlinesOfText 26 27 ALIGN JUMP_ALIGN 28 MenuText_ClearInformationArea: 29 call PrepareToDrawInformationArea 30 mov cl, [bp+MENUINIT.bInfoLines] 31 ClearCLlinesOfText: 32 mov al, [bp+MENUINIT.bWidth] 33 sub al, MENU_HORIZONTAL_BORDER_LINES+MENU_TEXT_COLUMN_OFFSET 34 mul cl 35 xchg cx, ax 36 mov al, ' ' 37 CALL_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX 38 ret 39 40 41 ;-------------------------------------------------------------------- 12 42 ; MenuText_RefreshTitle 13 43 ; MenuText_RefreshInformation … … 17 47 ; Nothing 18 48 ; Corrupts registers: 19 ; AX, BX, DX, SI, DI49 ; AX, BX, CX, DX, SI, DI 20 50 ;-------------------------------------------------------------------- 21 51 ALIGN JUMP_ALIGN … … 23 53 cmp BYTE [bp+MENUINIT.bTitleLines], 0 24 54 jz SHORT NothingToRefresh 25 26 mov si, ATTRIBUTE_CHARS.cTitle 27 call AdjustDisplayContextForDrawingTexts 28 call MenuLocation_GetTitleTextTopLeftCoordinatesToAX 29 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 55 call PrepareToDrawTitleArea 30 56 jmp MenuEvent_RefreshTitle 31 57 … … 34 60 cmp BYTE [bp+MENUINIT.bInfoLines], 0 35 61 jz SHORT NothingToRefresh 36 62 call PrepareToDrawInformationArea 63 jmp MenuEvent_RefreshInformation 64 65 ;-------------------------------------------------------------------- 66 ; PrepareToDrawTitleArea 67 ; PrepareToDrawInformationArea 68 ; Parameters 69 ; SS:BP: Ptr to MENU 70 ; Returns: 71 ; Nothing 72 ; Corrupts registers: 73 ; AX, BX, DX, SI, DI 74 ;-------------------------------------------------------------------- 75 ALIGN JUMP_ALIGN 76 PrepareToDrawTitleArea: 77 mov si, ATTRIBUTE_CHARS.cTitle 78 mov ax, MenuCharOut_MenuTextTeletypeOutputWithAttributeAndAutomaticLineChange 79 call AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX 80 call MenuLocation_GetTitleTextTopLeftCoordinatesToAX 81 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 82 ret 83 84 ALIGN JUMP_ALIGN 85 PrepareToDrawInformationArea: 37 86 mov si, ATTRIBUTE_CHARS.cInformation 38 call AdjustDisplayContextForDrawingTexts 87 mov ax, MenuCharOut_MenuTextTeletypeOutputWithAttributeAndAutomaticLineChange 88 call AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX 39 89 call MenuLocation_GetInformationTextTopLeftCoordinatesToAX 40 90 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 41 jmp MenuEvent_RefreshInformation91 ret 42 92 43 93 … … 109 159 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 110 160 call .GetItemTextAttributeTypeToSIforItemInCX 111 jmp SHORT AdjustDisplayContextForDrawingTexts 161 mov ax, MenuCharOut_MenuTextTeletypeOutputWithAttribute 162 jmp SHORT AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX 112 163 113 164 ;-------------------------------------------------------------------- … … 142 193 ; Nothing 143 194 ; Corrupts registers: 144 ; AX, DX, SI, DI195 ; AX, BX, DX, SI, DI 145 196 ;-------------------------------------------------------------------- 146 197 ALIGN JUMP_ALIGN … … 188 239 ; Nothing 189 240 ; Corrupts registers: 190 ; AX, DX, SI, DI241 ; AX, BX, DX, SI, DI 191 242 ;-------------------------------------------------------------------- 192 243 ALIGN JUMP_ALIGN … … 194 245 push cx 195 246 196 mov si, ATTRIBUTE_CHARS.cBordersAndBackground 197 call MenuAttribute_SetToDisplayContextFromTypeInSI 247 call MenuBorders_AdjustDisplayContextForDrawingBorders 198 248 199 249 mov ax, cx … … 211 261 212 262 ;-------------------------------------------------------------------- 213 ; AdjustDisplayContextForDrawingTexts 214 ; Parameters 263 ; AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX 264 ; Parameters 265 ; AX: Character output function 215 266 ; SI: Attribute type (from ATTRIBUTE_CHARS) 216 267 ; SS:BP: Ptr to MENU … … 221 272 ;-------------------------------------------------------------------- 222 273 ALIGN JUMP_ALIGN 223 AdjustDisplayContextForDrawingTexts :274 AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX: 224 275 mov bl, ATTRIBUTES_ARE_USED 225 mov ax, MenuCharOut_MenuTextTeletypeOutputWithAttribute226 276 CALL_DISPLAY_LIBRARY SetCharOutputFunctionFromAXwithAttribFlagInBL 227 277
Note:
See TracChangeset
for help on using the changeset viewer.