Changeset 67 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu
- Timestamp:
- Dec 9, 2010, 5:14:25 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library/Src/Menu
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Menu/MenuBorders.asm
r62 r67 2 2 ; Project name : Assembly Library 3 3 ; Created date : 14.7.2010 4 ; Last update : 30.11.20104 ; Last update : 9.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for drawing menu borders. … … 29 29 MenuBorders_RefreshAll: 30 30 call MenuBorders_AdjustDisplayContextForDrawingBorders 31 call GetNumberOfMiddleCharactersToDX31 call MenuBorders_GetNumberOfMiddleCharactersToDX 32 32 call RefreshTitleBorders 33 33 call RefreshItemBorders … … 51 51 call MenuLocation_GetBottomBordersTopLeftCoordinatesToAX 52 52 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 53 call GetNumberOfMiddleCharactersToDX53 call MenuBorders_GetNumberOfMiddleCharactersToDX 54 54 jmp SHORT DrawBottomBorderLine 55 55 … … 95 95 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 96 96 97 call GetNumberOfMiddleCharactersToDX97 call MenuBorders_GetNumberOfMiddleCharactersToDX 98 98 jmp SHORT RefreshItemBorders 99 99 100 100 101 101 ;-------------------------------------------------------------------- 102 ; GetNumberOfMiddleCharactersToDX102 ; MenuBorders_GetNumberOfMiddleCharactersToDX 103 103 ; Parameters 104 104 ; SS:BP: Ptr to MENU … … 109 109 ;-------------------------------------------------------------------- 110 110 ALIGN JUMP_ALIGN 111 GetNumberOfMiddleCharactersToDX:111 MenuBorders_GetNumberOfMiddleCharactersToDX: 112 112 eMOVZX dx, BYTE [bp+MENUINIT.bWidth] 113 113 sub dx, BYTE MENU_HORIZONTAL_BORDER_LINES … … 300 300 pop bx 301 301 302 call PrintMultipleBorderCharactersFromAL ; AL does not matter302 call MenuBorders_PrintMultipleBorderCharactersFromAL ; AL does not matter 303 303 304 304 CALL_DISPLAY_LIBRARY PopDisplayContext … … 326 326 eSEG cs 327 327 lodsb ; Load from [si+BORDER_CHARS.cMiddle] to AL 328 call PrintMultipleBorderCharactersFromAL328 call MenuBorders_PrintMultipleBorderCharactersFromAL 329 329 330 330 eSEG cs … … 334 334 ;-------------------------------------------------------------------- 335 335 ; MenuBorders_PrintSingleBorderCharacterFromAL 336 ; PrintMultipleBorderCharactersFromAL336 ; MenuBorders_PrintMultipleBorderCharactersFromAL 337 337 ; Parameters 338 338 ; AL: Character to print 339 ; DX: Repeat count ( PrintMultipleBorderCharactersFromAL)339 ; DX: Repeat count (MenuBorders_PrintMultipleBorderCharactersFromAL) 340 340 ; SS:BP: Ptr to MENU 341 341 ; Returns: … … 350 350 351 351 ALIGN JUMP_ALIGN 352 PrintMultipleBorderCharactersFromAL:352 MenuBorders_PrintMultipleBorderCharactersFromAL: 353 353 push cx 354 354 mov cx, dx -
trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm
r52 r67 2 2 ; Project name : Assembly Library 3 3 ; Created date : 20.7.2010 4 ; Last update : 12.10.20104 ; Last update : 9.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for drawing scroll bars over menu borders. … … 17 17 ; Cleared if no scroll bars needed 18 18 ; Corrupts registers: 19 ; CX19 ; AX 20 20 ;-------------------------------------------------------------------- 21 21 ALIGN JUMP_ALIGN 22 22 MenuScrollbars_AreScrollbarsNeeded: 23 xchg ax, cx 23 24 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 24 25 cmp cx, [bp+MENUINIT.wItems] ; Set CF if max visible < total items 26 xchg cx, ax 25 27 ret 26 28 -
trunk/Assembly_Library/Src/Menu/MenuText.asm
r54 r67 2 2 ; Project name : Assembly Library 3 3 ; Created date : 21.7.2010 4 ; Last update : 24.10.20104 ; Last update : 9.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for drawing menu texts by the user. … … 126 126 MenuText_RefreshItemFromAX: 127 127 push cx 128 mov cx, ax ; Backup item to CX 129 128 push ax 129 130 xchg cx, ax 130 131 call MenuScrollbars_IsItemInCXonVisiblePage 131 132 jnc SHORT .InvalidItem 132 133 call MenuText_AdjustDisplayContextForDrawingItemFromCX 134 call ClearPreviousItem 133 135 call MenuEvent_RefreshItemFromCX 134 call DrawScrollbar IfNecessary136 call DrawScrollbarCharacterForItemInCXifNecessary 135 137 .InvalidItem: 136 xchg ax, cx ; Restore AX138 pop ax 137 139 pop cx 138 140 ret … … 181 183 182 184 ;-------------------------------------------------------------------- 185 ; ClearPreviousItem 186 ; Parameters 187 ; SS:BP: Ptr to MENU 188 ; Returns: 189 ; Nothing 190 ; Corrupts registers: 191 ; AX, BX, DX, DI 192 ;-------------------------------------------------------------------- 193 ALIGN JUMP_ALIGN 194 ClearPreviousItem: 195 CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX 196 xchg bx, ax 197 198 call MenuBorders_GetNumberOfMiddleCharactersToDX 199 sub dx, BYTE MENU_TEXT_COLUMN_OFFSET 200 mov al, [cs:g_rgbTextBorderCharacters+BORDER_CHARS.cMiddle] 201 call MenuBorders_PrintMultipleBorderCharactersFromAL 202 203 xchg ax, bx 204 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 205 ret 206 207 208 ;-------------------------------------------------------------------- 183 209 ; GetItemTextAttributeTypeToSIforItemInCX 184 210 ; Parameters … … 205 231 206 232 ;-------------------------------------------------------------------- 207 ; DrawScrollbar IfNecessary233 ; DrawScrollbarCharacterForItemInCXifNecessary 208 234 ; Parameters 209 235 ; CX: Item to refresh … … 212 238 ; Nothing 213 239 ; Corrupts registers: 214 ; AX, BX, DX, SI, DI 215 ;-------------------------------------------------------------------- 216 ALIGN JUMP_ALIGN 217 DrawScrollbarIfNecessary: 218 push cx 219 call .DrawSpacesBeforeScrollbarCharacter 240 ; AX, CX, BX, DX, SI, DI 241 ;-------------------------------------------------------------------- 242 ALIGN JUMP_ALIGN 243 DrawScrollbarCharacterForItemInCXifNecessary: 220 244 call MenuScrollbars_AreScrollbarsNeeded 221 pop cx222 245 jc SHORT .DrawScrollbarCharacter 223 246 ret 224 247 225 ;--------------------------------------------------------------------226 ; .DrawSpacesBeforeScrollbarCharacter227 ; Parameters228 ; CX: Item to refresh229 ; SS:BP: Ptr to MENU230 ; Returns:231 ; Nothing232 ; Corrupts registers:233 ; AX, CX, DX, DI234 ;--------------------------------------------------------------------235 ALIGN JUMP_ALIGN236 .DrawSpacesBeforeScrollbarCharacter:237 CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX238 xchg dx, ax ; Current coordinates to DX239 mov ax, cx240 call MenuLocation_GetScrollbarCoordinatesToAXforItemInAX241 sub al, dl242 sub al, MENU_TEXT_COLUMN_OFFSET/2243 244 eMOVZX cx, al245 jcxz .NoSpacesNeeded246 mov al, ' '247 CALL_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX248 ALIGN JUMP_ALIGN, ret249 .NoSpacesNeeded:250 ret251 252 ;--------------------------------------------------------------------253 ; .DrawScrollbarCharacter254 ; Parameters255 ; CX: Item to refresh256 ; SS:BP: Ptr to MENU257 ; Returns:258 ; Nothing259 ; Corrupts registers:260 ; AX, BX, DX, SI, DI261 ;--------------------------------------------------------------------262 248 ALIGN JUMP_ALIGN 263 249 .DrawScrollbarCharacter: 264 push cx265 266 250 call MenuBorders_AdjustDisplayContextForDrawingBorders 267 268 251 mov ax, cx 269 252 call MenuLocation_GetScrollbarCoordinatesToAXforItemInAX … … 273 256 sub di, [bp+MENU.wFirstVisibleItem] ; Item to line 274 257 call MenuScrollbars_GetScrollCharacterToALForLineInDI 275 CALL_DISPLAY_LIBRARY PrintCharacterFromAL 276 277 pop cx 278 ret 258 jmp MenuBorders_PrintSingleBorderCharacterFromAL
Note:
See TracChangeset
for help on using the changeset viewer.