Changeset 67 in xtideuniversalbios for trunk/Assembly_Library/Src
- Timestamp:
- Dec 9, 2010, 5:14:25 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library/Src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Display/Display.asm
r45 r67 2 2 ; Project name : Assembly Library 3 3 ; Created date : 2.7.2010 4 ; Last update : 28.9.20104 ; Last update : 7.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Display Library functions for CALL_DISPLAY_LIBRARY macro … … 90 90 at DISPLAY_LIB.PrintNewlineCharacters, dw DisplayPrint_Newline 91 91 at DISPLAY_LIB.ClearAreaWithHeightInAHandWidthInAL, dw DisplayPrint_ClearAreaWithHeightInAHandWidthInAL 92 at DISPLAY_LIB.ClearScreen , dw DisplayPrint_ClearScreen92 at DISPLAY_LIB.ClearScreenWithCharInALandAttrInAH, dw DisplayPrint_ClearScreenWithCharInALandAttributeInAH 93 93 iend -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r52 r67 2 2 ; Project name : Assembly Library 3 3 ; Created date : 26.6.2010 4 ; Last update : 11.10.20104 ; Last update : 7.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for display output. … … 222 222 223 223 ;-------------------------------------------------------------------- 224 ; DisplayPrint_ClearScreen 225 ; Parameters: 224 ; DisplayPrint_ClearScreenWithCharInALandAttributeInAH 225 ; Parameters: 226 ; AL: Character to clear with 227 ; AH: Attribute to clear with 226 228 ; DS: BDA segment (zero) 227 229 ; ES:DI: Ptr to cursor location in video RAM … … 232 234 ;-------------------------------------------------------------------- 233 235 ALIGN JUMP_ALIGN 234 DisplayPrint_ClearScreen :236 DisplayPrint_ClearScreenWithCharInALandAttributeInAH: 235 237 push di 238 push cx 239 240 xchg cx, ax 236 241 xor ax, ax 237 call DisplayCursor_SetCoordinatesFromAX 242 call DisplayCursor_SetCoordinatesFromAX ; Updates DI 238 243 call DisplayPage_GetColumnsToALandRowsToAH 239 call DisplayPrint_ClearAreaWithHeightInAHandWidthInAL 244 mul ah ; AX = AL*AH = Characters on screen 245 xchg cx, ax ; AX = Char+Attr, CX = WORDs to store 246 rep stosw 247 248 pop cx 240 249 pop di 241 250 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di -
trunk/Assembly_Library/Src/File/FileIO.asm
r66 r67 178 178 call bp ; Transfer function 179 179 jc SHORT .ErrorOccurredDuringTransfer 180 add si, SPLIT_SIZE_FOR_LARGE_TRANSFERS 180 181 dec dx 181 182 jnz SHORT .TransferNextBytes -
trunk/Assembly_Library/Src/LibraryTests.asm
r60 r67 2 2 ; Project name : Assembly Library 3 3 ; Created date : 27.6.2010 4 ; Last update : 22.11.20104 ; Last update : 7.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Tests for Assembly Library. … … 31 31 LibraryTests_Start: 32 32 CALL_DISPLAY_LIBRARY InitializeDisplayContext 33 CALL_DISPLAY_LIBRARY ClearScreen 33 mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE 34 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH 34 35 35 36 ;call LibraryTests_Sort -
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 -
trunk/Assembly_Library/Src/String/StringProcess.asm
r52 r67 2 2 ; Project name : Assembly Library 3 3 ; Created date : 12.10.2010 4 ; Last update : 12.10.20104 ; Last update : 7.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for processing characters in a string. … … 10 10 11 11 ;-------------------------------------------------------------------- 12 ; Character processing callback function prototype for StringProcess_DSSIwithFunctionIn BX.12 ; Character processing callback function prototype for StringProcess_DSSIwithFunctionInDX. 13 13 ; Parameters: 14 14 ; AL: Character to process 15 ; CX: Number of characters processed15 ; CX: Character number (index for next character) 16 16 ; DS:SI: Ptr to next character 17 17 ; BX,DI,ES: Free to use by processing function
Note:
See TracChangeset
for help on using the changeset viewer.