Changeset 104 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/MenuBorders.asm
- Timestamp:
- Feb 2, 2011, 3:53:52 AM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Menu/MenuBorders.asm
r67 r104 1 ; File name : MenuBorders.asm2 1 ; Project name : Assembly Library 3 ; Created date : 14.7.20104 ; Last update : 9.12.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for drawing menu borders. 7 3 … … 56 52 57 53 ;-------------------------------------------------------------------- 54 ; MenuBorders_RefreshItemBorders 55 ; Parameters 56 ; SS:BP: Ptr to MENU 57 ; Returns: 58 ; Nothing 59 ; Corrupts registers: 60 ; AX, BX, CX, DX, SI, DI 61 ;-------------------------------------------------------------------- 62 ALIGN JUMP_ALIGN 63 MenuBorders_RefreshItemBorders: 64 call MenuBorders_AdjustDisplayContextForDrawingBorders 65 call MenuLocation_GetItemBordersTopLeftCoordinatesToAX 66 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 67 68 call MenuBorders_GetNumberOfMiddleCharactersToDX 69 jmp SHORT RefreshItemBorders 70 71 72 ;-------------------------------------------------------------------- 58 73 ; MenuBorders_AdjustDisplayContextForDrawingBorders 59 74 ; Parameters … … 81 96 82 97 ;-------------------------------------------------------------------- 83 ; MenuBorders_RefreshItemBorders84 ; Parameters85 ; SS:BP: Ptr to MENU86 ; Returns:87 ; Nothing88 ; Corrupts registers:89 ; AX, BX, CX, DX, SI, DI90 ;--------------------------------------------------------------------91 ALIGN JUMP_ALIGN92 MenuBorders_RefreshItemBorders:93 call MenuBorders_AdjustDisplayContextForDrawingBorders94 call MenuLocation_GetItemBordersTopLeftCoordinatesToAX95 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX96 97 call MenuBorders_GetNumberOfMiddleCharactersToDX98 jmp SHORT RefreshItemBorders99 100 101 ;--------------------------------------------------------------------102 98 ; MenuBorders_GetNumberOfMiddleCharactersToDX 103 99 ; Parameters … … 161 157 call DrawSeparationBorderLine 162 158 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 159 ; Fall to DrawTextBorderLinesByCXtimes 160 161 ;-------------------------------------------------------------------- 162 ; DrawTextBorderLinesByCXtimes 163 ; Parameters 164 ; CX: Number of border lines to draw 165 ; DX: Number of times to repeat middle character 166 ; SS:BP: Ptr to MENU 167 ; Returns: 168 ; Nothing 169 ; Corrupts registers: 170 ; AX, CX, SI, DI 171 ;-------------------------------------------------------------------- 163 172 DrawTextBorderLinesByCXtimes: 164 mov bx, DrawTextBorderLine 165 ; Fall to DrawBorderLinesByCXtimes 166 167 ;-------------------------------------------------------------------- 168 ; DrawBorderLinesByCXtimes 169 ; Parameters 170 ; BX: Offset to border drawing function 171 ; CX: Number of border lines to draw 172 ; DX: Number of times to repeat middle character 173 ; SS:BP: Ptr to MENU 174 ; Returns: 175 ; Nothing 176 ; Corrupts registers: 177 ; AX, CX, SI, DI 178 ;-------------------------------------------------------------------- 179 DrawBorderLinesByCXtimes: 180 jcxz .Return 173 jcxz .NoBorderLinesToDraw 181 174 ALIGN JUMP_ALIGN 182 175 .DrawBordersWithFunctionInBX: 183 call bx176 call DrawTextBorderLine 184 177 loop .DrawBordersWithFunctionInBX 185 . Return:178 .NoBorderLinesToDraw: 186 179 ret 187 180 … … 228 221 ALIGN JUMP_ALIGN 229 222 DrawBottomShadowLine: 230 mov ax, 1 ; Increment column 231 call MenuLocation_MoveCursorByALcolumnsAndAHrows 223 CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX 224 inc ax ; Move one column left 225 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 232 226 inc dx ; Increment repeat count... 233 227 inc dx ; ...for both corner characters … … 319 313 ALIGN JUMP_ALIGN 320 314 PrintBorderCharactersFromCSSI: 321 cld322 315 eSEG cs 323 lodsb ; Load from [ si+BORDER_CHARS.cLeft] to AL316 lodsb ; Load from [cs:si+BORDER_CHARS.cLeft] to AL 324 317 call MenuBorders_PrintSingleBorderCharacterFromAL 325 318 326 319 eSEG cs 327 lodsb ; Load from [ si+BORDER_CHARS.cMiddle] to AL320 lodsb ; Load from [cs:si+BORDER_CHARS.cMiddle] to AL 328 321 call MenuBorders_PrintMultipleBorderCharactersFromAL 329 322 330 323 eSEG cs 331 lodsb ; Load from [ si+BORDER_CHARS.cRight] to AL324 lodsb ; Load from [cs:si+BORDER_CHARS.cRight] to AL 332 325 ; Fall to MenuBorders_PrintSingleBorderCharacterFromAL 333 326 … … 382 375 ; AX, SI, DI 383 376 ;-------------------------------------------------------------------- 384 ;ALIGN JUMP_ALIGN385 377 .PrintTimeoutStringWithSecondsInAX: 378 ; Get attribute to AX 379 xchg di, ax 380 mov si, ATTRIBUTE_CHARS.cNormalTimeout 381 cmp di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY 382 eCMOVB si, ATTRIBUTE_CHARS.cHurryTimeout 383 call MenuAttribute_GetToAXfromTypeInSI 384 386 385 push bp 387 388 xchg di, ax389 386 mov bp, sp 390 call .GetTimeoutAttributeToAXfromSecondsInDI391 387 mov si, .szSelectionTimeout 392 388 push ax ; Push attribute … … 399 395 db DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL 400 396 db "%AAutoselection in %2u s",NULL 401 402 ;--------------------------------------------------------------------403 ; .GetTimeoutAttributeToAXfromSecondsInDI404 ; Parameters405 ; DI: Seconds to print406 ; Returns:407 ; AX: Attribute byte for seconds408 ; Corrupts registers:409 ; SI410 ;--------------------------------------------------------------------411 ALIGN JUMP_ALIGN412 .GetTimeoutAttributeToAXfromSecondsInDI:413 mov si, ATTRIBUTE_CHARS.cNormalTimeout414 cmp di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY415 eCMOVB si, ATTRIBUTE_CHARS.cHurryTimeout416 jmp MenuAttribute_GetToAXfromTypeInSI417 397 418 398
Note:
See TracChangeset
for help on using the changeset viewer.