Changeset 181 in xtideuniversalbios for trunk/Assembly_Library/Src
- Timestamp:
- Nov 13, 2011, 3:38:40 PM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/Assembly_Library/Src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Display/Display.asm
r177 r181 57 57 jmp ax 58 58 59 60 %define InitializeDisplayContext DisplayContext_Initialize59 60 %define InitializeDisplayContext DisplayContext_Initialize 61 61 62 62 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 63 %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX63 %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX 64 64 %endif 65 %define SetCharOutputFunctionFromAXwithAttribFlagInBL DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL66 %define SetCharacterOutputParameterFromAX DisplayContext_SetCharacterOutputParameterFromAX67 %define SetCharacterAttributeFromAL DisplayContext_SetCharacterAttributeFromAL68 %define SetCursorShapeFromAX DisplayCursor_SetShapeFromAX69 %define SetCursorCoordinatesFromAX DisplayCursor_SetCoordinatesFromAX70 %define SetNewPageFromAL DisplayPage_SetFromAL71 %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware65 %define SetCharOutputFunctionFromAXwithAttribFlagInBL DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL 66 %define SetCharacterOutputParameterFromAX DisplayContext_SetCharacterOutputParameterFromAX 67 %define SetCharacterAttributeFromAL DisplayContext_SetCharacterAttributeFromAL 68 %define SetCursorShapeFromAX DisplayCursor_SetShapeFromAX 69 %define SetCursorCoordinatesFromAX DisplayCursor_SetCoordinatesFromAX 70 %define SetNewPageFromAL DisplayPage_SetFromAL 71 %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware 72 72 73 73 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 74 %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX74 %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX 75 75 %endif 76 %define GetSoftwareCoordinatesToAX DisplayCursor_GetSoftwareCoordinatesToAX77 %define GetColumnsToALandRowsToAH DisplayPage_GetColumnsToALandRowsToAH76 %define GetSoftwareCoordinatesToAX DisplayCursor_GetSoftwareCoordinatesToAX 77 %define GetColumnsToALandRowsToAH DisplayPage_GetColumnsToALandRowsToAH 78 78 79 %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI79 %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI 80 80 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 81 %define PrintSignedWordFromAXWithBaseInBX DisplayPrint_SignedWordFromAXWithBaseInBX81 %define PrintSignedWordFromAXWithBaseInBX DisplayPrint_SignedWordFromAXWithBaseInBX 82 82 %endif 83 %define PrintWordFromAXwithBaseInBX DisplayPrint_WordFromAXWithBaseInBX84 %define PrintCharBufferFromBXSIwithLengthInCX DisplayPrint_CharacterBufferFromBXSIwithLengthInCX85 %define PrintNullTerminatedStringFromBXSI DisplayPrint_NullTerminatedStringFromBXSI86 %define PrintNullTerminatedStringFromCSSI DisplayPrint_NullTerminatedStringFromCSSI87 %define PrintRepeatedCharacterFromALwithCountInCX DisplayPrint_RepeatCharacterFromALwithCountInCX88 %define PrintCharacterFromAL DisplayPrint_CharacterFromAL89 %define PrintNewlineCharacters DisplayPrint_Newline83 %define PrintWordFromAXwithBaseInBX DisplayPrint_WordFromAXWithBaseInBX 84 %define PrintCharBufferFromBXSIwithLengthInCX DisplayPrint_CharacterBufferFromBXSIwithLengthInCX 85 %define PrintNullTerminatedStringFromBXSI DisplayPrint_NullTerminatedStringFromBXSI 86 %define PrintNullTerminatedStringFromCSSI DisplayPrint_NullTerminatedStringFromCSSI 87 %define PrintRepeatedCharacterFromALwithCountInCX DisplayPrint_RepeatCharacterFromALwithCountInCX 88 %define PrintCharacterFromAL DisplayPrint_CharacterFromAL 89 %define PrintNewlineCharacters DisplayPrint_Newline 90 90 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 91 %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL91 %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL 92 92 %endif 93 %define ClearScreenWithCharInALandAttrInAH DisplayPrint_ClearScreenWithCharInALandAttributeInAH93 %define ClearScreenWithCharInALandAttrInAH DisplayPrint_ClearScreenWithCharInALandAttributeInAH 94 94 -
trunk/Assembly_Library/Src/Display/DisplayContext.asm
r162 r181 268 268 ; Nothing 269 269 ;-------------------------------------------------------------------- 270 ;%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS ; This appears to be completely unused 271 ;ALIGN JUMP_ALIGN272 ;DisplayContext_GetCharacterOutputParameterToDX:273 ;mov dx, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]274 ;ret275 ;%endif270 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG ; This is currently unused (dead code) 271 ALIGN JUMP_ALIGN 272 DisplayContext_GetCharacterOutputParameterToDX: 273 mov dx, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam] 274 ret 275 %endif 276 276 277 277 -
trunk/Assembly_Library/Src/Display/DisplayFormat.asm
r134 r181 52 52 dec bp 53 53 dec bp ; SS:BP now points to next parameter 54 test cx,cx55 jnz SHORTPrependOrAppendSpaces54 inc cx 55 loop PrependOrAppendSpaces 56 56 ReturnFromFormat: 57 57 ret -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r162 r181 158 158 loop .PrintNextCharacter 159 159 160 mov ds, cx ; Restore DS to BDA. Not needed unless DisplayPrint_CharacterFromAL changes DS.160 ;mov ds, cx ; Restore DS to BDA. Not needed unless DisplayPrint_CharacterFromAL changes DS. 161 161 pop cx 162 162 pop si … … 304 304 ; DI: Updated offset to video RAM 305 305 ; Corrupts registers: 306 ; AX,DX306 ; DX 307 307 ;-------------------------------------------------------------------- 308 308 ALIGN JUMP_ALIGN -
trunk/Assembly_Library/Src/File/Drive.asm
r133 r181 72 72 call Drive_SetDefaultFromDL 73 73 eMOVZX cx, al ; Number of potentially valid drive letters available 74 MIN_U cx, 32 74 cmp cl, 32 75 jb SHORT .Return 76 mov cl, 32 77 ALIGN JUMP_ALIGN, ret 78 .Return: 75 79 ret 76 80 -
trunk/Assembly_Library/Src/Menu/CharOutLineSplitter.asm
r104 r181 104 104 ;-------------------------------------------------------------------- 105 105 .GetOffsetToPartialWordToSIandSizeToCX: 106 xor cx, cx106 mov cx, di 107 107 mov si, di 108 108 ALIGN JUMP_ALIGN … … 111 111 dec si 112 112 cmp BYTE [es:si], ' ' 113 je SHORT .PartialWordFound 114 inc cx 115 jmp SHORT .ScanNextCharacter 116 ALIGN JUMP_ALIGN 117 .PartialWordFound: 113 jne SHORT .ScanNextCharacter 118 114 inc si 119 115 inc si ; SI now points one past space 120 s hl cx, 1 ; Characters to bytes116 sub cx, si 121 117 ; Fall to .ChangeLine 122 118 -
trunk/Assembly_Library/Src/Menu/Dialog/Dialog.asm
r162 r181 127 127 ret 128 128 129 129 130 ;-------------------------------------------------------------------- 130 131 ; .GetWidthBasedOnParentMenuToAL … … 141 142 mov al, [ss:bx+MENUINIT.bWidth] 142 143 sub al, DIALOG_DELTA_WIDTH_FROM_PARENT 143 MIN_U al, DIALOG_MAX_WIDTH 144 ret 144 cmp al, DIALOG_MAX_WIDTH 145 jb .ALlessThanDIALOG_MAX_WIDTH 146 mov al, DIALOG_MAX_WIDTH 147 ALIGN JUMP_ALIGN, ret 148 .ALlessThanDIALOG_MAX_WIDTH: 149 ret 150 145 151 146 152 ;-------------------------------------------------------------------- … … 161 167 add ah, [bp+MENUINIT.bInfoLines] 162 168 add ah, BYTE MENU_VERTICAL_BORDER_LINES 163 MIN_U ah, bh 164 MIN_U ah, DIALOG_MAX_HEIGHT 169 cmp ah, bh 170 jb .AHlessThanBH 171 xchg bx, ax 172 ALIGN JUMP_ALIGN 173 .AHlessThanBH: 174 cmp ah, DIALOG_MAX_HEIGHT 175 jb .AHlessThanDIALOG_MAX_HEIGHT 176 mov ah, DIALOG_MAX_HEIGHT 177 ALIGN JUMP_ALIGN, ret 178 .AHlessThanDIALOG_MAX_HEIGHT: 165 179 ret 166 180 -
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r170 r181 265 265 .FilterCurrentDirectory: 266 266 cmp WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS 267 je SHORT . ReturnWithFiltering267 je SHORT .DoFilter 268 268 ret 269 269 … … 274 274 cmp WORD [si+DTA.szFile], UPDIR_CHARACTERS 275 275 jne SHORT .ReturnWithoutFiltering 276 . ReturnWithFiltering:276 .DoFilter: 277 277 add sp, BYTE 2 ; Remove return address from stack 278 278 ALIGN JUMP_ALIGN, ret … … 375 375 SortDirectoryContentsStringFromESDIwithCountInCX: 376 376 call Registers_CopyESDItoDSSI 377 call .AddDirectoryContentsStringLengthToDI 378 mov bx, .FileStringComparator 379 xchg dx, cx 380 mov cx, FILE_STRING_LENGTH 381 jmp Sort_ItemsFromDSSIwithCountInDXsizeInCXandComparatorInBX 382 383 ALIGN JUMP_ALIGN 384 .AddDirectoryContentsStringLengthToDI: 377 378 ; Add directory contents string length to DI 385 379 mov ax, FILE_STRING_LENGTH 380 push ax 386 381 mul cx 387 382 add di, ax 388 ret 383 384 mov dx, cx 385 pop cx 386 mov bx, .FileStringComparator 387 jmp Sort_ItemsFromDSSIwithCountInDXsizeInCXandComparatorInBX 389 388 390 389 ;-------------------------------------------------------------------- … … 395 394 ; ES:DI: Ptr to second item to compare 396 395 ; Returns: 397 ; FLAGS: Signed compari tion between first and second item396 ; FLAGS: Signed comparison between first and second item 398 397 ; Corrupts registers: 399 398 ; Nothing -
trunk/Assembly_Library/Src/Menu/Dialog/DialogProgress.asm
r73 r181 1 ; File name : DialogProgress.asm2 1 ; Project name : Assembly Library 3 ; Created date : 15.8.20104 ; Last update : 10.12.20105 ; Author : Tomi Tilli6 2 ; Description : Displays progress bar dialog and starts progress task. 7 3 … … 41 37 lds si, [bp+DIALOG.fpDialogIO] 42 38 mov bx, [si+PROGRESS_DIALOG_IO.wMaxProgressValue] 43 MIN_U ax, bx 44 cmp ax, bx ; Make sure that last progress character is shown 45 je SHORT .UpdateProgressBar 46 39 cmp ax, bx 40 jb SHORT .AXlessThanBX 41 mov ax, bx 42 jmp SHORT .UpdateProgressBar 43 ALIGN JUMP_ALIGN 44 .AXlessThanBX: 47 45 mov bx, ax 48 46 sub bx, [si+PROGRESS_DIALOG_IO.wCurrentProgressValue] … … 172 170 ALIGN JUMP_ALIGN 173 171 DrawProgressBarFromDialogIoInDSSI: 174 call .GetFullCharsToCXandEmptyCharsToDXwithDialogIoInDSSI 175 176 mov al, PROGRESS_COMPLETE_CHARACTER 177 call .RepeatProgressCharacterCXtimesFromAL 178 179 mov cx, dx 180 mov al, PROGRESS_INCOMPLETE_CHARACTER 181 jmp SHORT .RepeatProgressCharacterCXtimesFromAL 182 183 ;-------------------------------------------------------------------- 184 ; .GetFullCharsToCXandEmptyCharsToDXwithDialogIoInDSSI 185 ; Parameters: 186 ; DS:SI: Ptr to PROGRESS_DIALOG_IO 187 ; SS:BP: Ptr to DIALOG 188 ; Returns: 189 ; CX: Number of full progress bar characters 190 ; DX: Number of empty progress bar characters 191 ; Corrupts: 192 ; AX, BX 193 ;-------------------------------------------------------------------- 194 ALIGN JUMP_ALIGN 195 .GetFullCharsToCXandEmptyCharsToDXwithDialogIoInDSSI: 172 ; Get full chars to CX and empty chars to DX 196 173 call MenuLocation_GetMaxTextLineLengthToAX 197 174 mov cx, ax … … 200 177 div bx 201 178 xchg cx, ax ; AX = Text line length, CX = Number of full chars 202 203 179 sub ax, cx 204 180 xchg dx, ax ; DX = Number of empty chars 205 ret 181 182 mov al, PROGRESS_COMPLETE_CHARACTER 183 call .RepeatProgressCharacterCXtimesFromAL 184 185 mov cx, dx 186 mov al, PROGRESS_INCOMPLETE_CHARACTER 187 ; Fall to .RepeatProgressCharacterCXtimesFromAL 206 188 207 189 ;-------------------------------------------------------------------- … … 239 221 ret 240 222 241 223 242 224 ;-------------------------------------------------------------------- 243 225 ; DrawTimeElapsedFromDX … … 286 268 287 269 sub cx, [si+PROGRESS_DIALOG_IO.wMinProgressValue] 288 j cxz.PreventDivisionByZero270 jz SHORT .PreventDivisionByZero 289 271 div cx ; AX = Estimated ticks left 290 272 xchg dx, ax 291 jmp SHORT FormatTicksFromDX273 SKIP2B f ; cmp ax, <next instruction> 292 274 .PreventDivisionByZero: 293 275 xor dx, dx -
trunk/Assembly_Library/Src/Menu/Dialog/ItemLineSplitter.asm
r133 r181 115 115 ALIGN JUMP_ALIGN 116 116 .CheckLineLength: 117 cmp cx, [bp+ITEM_LINE_SPLITTER.wMaxTextLineLength] 118 ja SHORT .ChangeToNextLine 119 clc 120 ret 117 cmp [bp+ITEM_LINE_SPLITTER.wMaxTextLineLength], cx 118 jb SHORT .ChangeToNextLine 119 ret ; With CF cleared 121 120 122 121 ALIGN JUMP_ALIGN -
trunk/Assembly_Library/Src/Menu/Menu.asm
r177 r181 31 31 32 32 33 %define DisplayWithHandlerInBXandUserDataInDXAXMenuInit_DisplayMenuWithHandlerInBXandUserDataInDXAX34 ;%define CloseMenuInit_CloseMenuWindow ; Special case in CALL_MENU_LIBRARY35 %define RefreshWindowMenuInit_RefreshMenuWindow33 %define DisplayWithHandlerInBXandUserDataInDXAX MenuInit_DisplayMenuWithHandlerInBXandUserDataInDXAX 34 ;%define Close MenuInit_CloseMenuWindow ; Special case in CALL_MENU_LIBRARY 35 %define RefreshWindow MenuInit_RefreshMenuWindow 36 36 37 ;%define SetUserDataFromDSSIMenuInit_SetUserDataFromDSSI ; Special case in CALL_MENU_LIBRARY38 ;%define GetUserDataToDSSIMenuInit_GetUserDataToDSSI ; Special case in CALL_MENU_LIBRARY37 ;%define SetUserDataFromDSSI MenuInit_SetUserDataFromDSSI ; Special case in CALL_MENU_LIBRARY 38 ;%define GetUserDataToDSSI MenuInit_GetUserDataToDSSI ; Special case in CALL_MENU_LIBRARY 39 39 40 ;%define SetTitleHeightFromALMenuInit_SetTitleHeightFromAL ; Special case in CALL_MENU_LIBRARY41 %define ClearTitleAreaMenuText_ClearTitleArea42 %define RefreshTitleMenuText_RefreshTitle40 ;%define SetTitleHeightFromAL MenuInit_SetTitleHeightFromAL ; Special case in CALL_MENU_LIBRARY 41 %define ClearTitleArea MenuText_ClearTitleArea 42 %define RefreshTitle MenuText_RefreshTitle 43 43 44 %define HighlightItemFromAXMenuInit_HighlightItemFromAX45 ;%define SetTotalItemsFromAXMenuInit_SetTotalItemsFromAX ; Special case in CALL_MENU_LIBRARY46 %define RefreshItemFromAXMenuText_RefreshItemFromAX44 %define HighlightItemFromAX MenuInit_HighlightItemFromAX 45 ;%define SetTotalItemsFromAX MenuInit_SetTotalItemsFromAX ; Special case in CALL_MENU_LIBRARY 46 %define RefreshItemFromAX MenuText_RefreshItemFromAX 47 47 48 ;%define SetInformationHeightFromAL MenuInit_SetInformationHeightFromAL ; Special case in CALL_MENU_LIBRARY49 %define ClearInformationArea MenuText_ClearInformationArea50 %define RefreshInformation MenuText_RefreshInformation48 ;%define SetInformationHeightFromAL MenuInit_SetInformationHeightFromAL ; Special case in CALL_MENU_LIBRARY 49 %define ClearInformationArea MenuText_ClearInformationArea 50 %define RefreshInformation MenuText_RefreshInformation 51 51 52 %define StartSelectionTimeoutWithTicksInAX MenuTime_StartSelectionTimeoutWithTicksInAX52 %define StartSelectionTimeoutWithTicksInAX MenuTime_StartSelectionTimeoutWithTicksInAX 53 53 54 54 %ifdef INCLUDE_MENU_DIALOGS 55 %define StartProgressTaskWithIoInDSSIandParamInDXAX DialogProgress_StartProgressTaskWithIoInDSSIandParamInDXAX56 %define SetProgressValueFromAX DialogProgress_SetProgressValueFromAX55 %define StartProgressTaskWithIoInDSSIandParamInDXAX DialogProgress_StartProgressTaskWithIoInDSSIandParamInDXAX 56 %define SetProgressValueFromAX DialogProgress_SetProgressValueFromAX 57 57 58 %define DisplayMessageWithInputInDSSI DialogMessage_DisplayMessageWithInputInDSSI59 %define GetSelectionToAXwithInputInDSSI DialogSelection_GetSelectionToAXwithInputInDSSI60 %define GetWordWithIoInDSSI DialogWord_GetWordWithIoInDSSI61 %define GetStringWithIoInDSSI DialogString_GetStringWithIoInDSSI62 %define GetFileNameWithIoInDSSI DialogFile_GetFileNameWithIoInDSSI63 %define GetDriveWithIoInDSSI DialogDrive_GetDriveWithIoInDSSI58 %define DisplayMessageWithInputInDSSI DialogMessage_DisplayMessageWithInputInDSSI 59 %define GetSelectionToAXwithInputInDSSI DialogSelection_GetSelectionToAXwithInputInDSSI 60 %define GetWordWithIoInDSSI DialogWord_GetWordWithIoInDSSI 61 %define GetStringWithIoInDSSI DialogString_GetStringWithIoInDSSI 62 %define GetFileNameWithIoInDSSI DialogFile_GetFileNameWithIoInDSSI 63 %define GetDriveWithIoInDSSI DialogDrive_GetDriveWithIoInDSSI 64 64 %endif 65 65 -
trunk/Assembly_Library/Src/Menu/MenuLocation.asm
r104 r181 4 4 ; Section containing code 5 5 SECTION .text 6 7 ;--------------------------------------------------------------------8 ; MenuLocation_GetTitleTextTopLeftCoordinatesToAX9 ; MenuLocation_GetInformationTextTopLeftCoordinatesToAX10 ; Parameters11 ; SS:BP: Ptr to MENU12 ; Returns:13 ; AL: Column (X)14 ; AH: Row (Y)15 ; Corrupts registers:16 ; Nothing17 ;--------------------------------------------------------------------18 ALIGN JUMP_ALIGN19 MenuLocation_GetTitleTextTopLeftCoordinatesToAX:20 mov ax, (MENU_TEXT_ROW_OFFSET<<8) | MENU_TEXT_COLUMN_OFFSET21 jmp SHORT MenuLocation_AddTitleBordersTopLeftCoordinatesToAX22 23 ALIGN JUMP_ALIGN24 MenuLocation_GetInformationTextTopLeftCoordinatesToAX:25 mov ax, (MENU_TEXT_ROW_OFFSET<<8) | MENU_TEXT_COLUMN_OFFSET26 jmp SHORT AddInformationBordersTopLeftCoordinatesToAX27 28 6 29 7 ;-------------------------------------------------------------------- … … 43 21 xchg al, ah ; Line to AH, clear AL 44 22 add ax, (MENU_TEXT_ROW_OFFSET<<8) | MENU_TEXT_COLUMN_OFFSET 45 jmp SHORT AddItemBordersTopLeftCoordinatesToAX46 23 SKIP2B f ; cmp ax, <next instruction> 24 ; Fall to MenuLocation_GetItemBordersTopLeftCoordinatesToAX 47 25 48 26 ;-------------------------------------------------------------------- 27 ; MenuLocation_GetItemBordersTopLeftCoordinatesToAX 28 ; MenuLocation_GetTitleTextTopLeftCoordinatesToAX 49 29 ; MenuLocation_GetTitleBordersTopLeftCoordinatesToAX 50 ; MenuLocation_GetI temBordersTopLeftCoordinatesToAX30 ; MenuLocation_GetInformationTextTopLeftCoordinatesToAX 51 31 ; MenuLocation_GetBottomBordersTopLeftCoordinatesToAX 52 32 ; Parameters … … 58 38 ; Nothing 59 39 ;-------------------------------------------------------------------- 40 MenuLocation_GetItemBordersTopLeftCoordinatesToAX: 41 xor ax, ax 42 jmp SHORT AddItemBordersTopLeftCoordinatesToAX 43 60 44 ALIGN JUMP_ALIGN 45 MenuLocation_GetTitleTextTopLeftCoordinatesToAX: 46 mov ax, (MENU_TEXT_ROW_OFFSET<<8) | MENU_TEXT_COLUMN_OFFSET 47 SKIP2B f ; cmp ax, <next instruction> 61 48 MenuLocation_GetTitleBordersTopLeftCoordinatesToAX: 62 49 xor ax, ax … … 64 51 65 52 ALIGN JUMP_ALIGN 66 MenuLocation_GetI temBordersTopLeftCoordinatesToAX:67 xor ax, ax68 jmp SHORT AddI temBordersTopLeftCoordinatesToAX53 MenuLocation_GetInformationTextTopLeftCoordinatesToAX: 54 mov ax, (MENU_TEXT_ROW_OFFSET<<8) | MENU_TEXT_COLUMN_OFFSET 55 jmp SHORT AddInformationBordersTopLeftCoordinatesToAX 69 56 70 57 ALIGN JUMP_ALIGN -
trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm
r133 r181 37 37 MenuScrollbars_GetScrollCharacterToALForLineInDI: 38 38 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 39 call .GetFirstThumbLineToAX 39 ; Get first thumb line to AX 40 mov ax, [bp+MENU.wFirstVisibleItem] 41 call .CalculateFirstOrLastThumbLineToAX 42 40 43 cmp di, ax ; Before first thumb line? 41 44 jb SHORT .ReturnTrackCharacter 42 45 call .GetLastThumbLineToAX 43 cmp di, ax ; After last thumb line? 44 ja SHORT .ReturnTrackCharacter 45 mov al, SCROLL_THUMB_CHARACTER 46 ret 46 cmp ax, di ; After last thumb line? 47 47 ALIGN JUMP_ALIGN 48 48 .ReturnTrackCharacter: 49 49 mov al, SCROLL_TRACK_CHARACTER 50 jb SHORT .Return 51 mov al, SCROLL_THUMB_CHARACTER 52 ALIGN JUMP_ALIGN, ret 53 .Return: 50 54 ret 51 55 … … 63 67 .GetLastThumbLineToAX: 64 68 call MenuScrollbars_GetLastVisibleItemOnPageToAX 65 jmp SHORT .CalculateFirstOrLastThumbLineToAX 66 67 ;-------------------------------------------------------------------- 68 ; .GetFirstThumbLineToAX 69 ; Parameters 69 ; Fall to .CalculateFirstOrLastThumbLineToAX 70 71 ;-------------------------------------------------------------------- 72 ; .CalculateFirstOrLastThumbLineToAX 73 ; Parameters 74 ; AX: Index of first or last visible item on page 70 75 ; CX: Max visible items on page 71 76 ; SS:BP: Ptr to MENU … … 76 81 ;-------------------------------------------------------------------- 77 82 ALIGN JUMP_ALIGN 78 .GetFirstThumbLineToAX:79 mov ax, [bp+MENU.wFirstVisibleItem]80 83 .CalculateFirstOrLastThumbLineToAX: 81 84 mul cx … … 98 101 mov cx, [bp+MENUINIT.wHighlightedItem] 99 102 add cx, ax 100 call .RotateItemInCX 103 ; Fall to .RotateItemInCX 104 105 ;-------------------------------------------------------------------- 106 ; .RotateItemInCX 107 ; Parameters 108 ; CX: Possibly under of overflown item to be rotated 109 ; SS:BP: Ptr to MENU 110 ; Returns: 111 ; CX: Valid item index 112 ; Corrupts registers: 113 ; DX 114 ;-------------------------------------------------------------------- 115 ;.RotateItemInCX: 116 mov dx, [bp+MENUINIT.wItems] 117 test cx, cx 118 js SHORT .RotateNegativeItemInCX 119 sub cx, dx 120 jae SHORT .ScrollPageForNewItemInCX 121 122 ALIGN JUMP_ALIGN 123 .RotateNegativeItemInCX: 124 add cx, dx 101 125 ; Fall to .ScrollPageForNewItemInCX 102 126 … … 111 135 ; AX, BX, CX, DX, SI, DI 112 136 ;-------------------------------------------------------------------- 137 ALIGN JUMP_ALIGN 113 138 .ScrollPageForNewItemInCX: 114 139 call MenuScrollbars_IsItemInCXonVisiblePage … … 117 142 mov dx, [bp+MENU.wFirstVisibleItem] 118 143 sub dx, [bp+MENUINIT.wHighlightedItem] 144 145 ; Get MaxFirstVisibleItem to AX 146 push cx 147 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 148 mov ax, [bp+MENUINIT.wItems] 149 sub ax, cx 150 pop cx 151 119 152 add dx, cx 120 MAX_S dx, 0 121 call .GetMaxFirstVisibleItemToAX 122 MIN_U ax, dx 153 jns .DXisPositive 154 cwd ; This won't work if MaxFirstVisibleItem > 32767 155 156 ALIGN JUMP_ALIGN 157 .DXisPositive: 158 cmp ax, dx 159 jb .AXisLessThanDX 160 xchg dx, ax 161 162 ALIGN JUMP_ALIGN 163 .AXisLessThanDX: 123 164 mov [bp+MENU.wFirstVisibleItem], ax 124 165 call MenuText_RefreshAllItems … … 127 168 .HighlightNewItemOnCX: 128 169 jmp MenuEvent_HighlightItemFromCX 129 130 ;--------------------------------------------------------------------131 ; .GetMaxFirstVisibleItemToAX132 ; Parameters133 ; SS:BP: Ptr to MENU134 ; Returns:135 ; AX: Max first visible item136 ; Corrupts registers:137 ; Nothing138 ;--------------------------------------------------------------------139 ALIGN JUMP_ALIGN140 .GetMaxFirstVisibleItemToAX:141 push cx142 143 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX144 mov ax, [bp+MENUINIT.wItems]145 sub ax, cx146 147 pop cx148 ret149 150 ;--------------------------------------------------------------------151 ; .RotateItemInCX152 ; Parameters153 ; CX: Possibly under of overflown item to be rotated154 ; SS:BP: Ptr to MENU155 ; Returns:156 ; CX: Valid item index157 ; Corrupts registers:158 ; DX159 ;--------------------------------------------------------------------160 ALIGN JUMP_ALIGN161 .RotateItemInCX:162 mov dx, [bp+MENUINIT.wItems]163 test cx, cx164 js SHORT .RotateNegativeItemInCX165 cmp cx, dx166 jae SHORT .RotatePositiveItemInCX167 ret168 169 ALIGN JUMP_ALIGN170 .RotatePositiveItemInCX:171 sub cx, dx172 ;jae SHORT .RotatePositiveItemInCX ; Not needed by scrolling173 ret174 175 ALIGN JUMP_ALIGN176 .RotateNegativeItemInCX:177 add cx, dx178 ;js SHORT .RotateNegativeItemInCX ; Not needed by scrolling179 ret180 170 181 171 … … 216 206 ALIGN JUMP_ALIGN 217 207 MenuScrollbars_GetLastVisibleItemOnPageToAX: 218 push cx 219 208 xchg cx, ax 220 209 call MenuScrollbars_GetActualVisibleItemsOnPageToCX 221 210 xchg ax, cx 222 211 dec ax 223 212 add ax, [bp+MENU.wFirstVisibleItem] 224 225 pop cx226 213 ret 227 214 … … 239 226 MenuScrollbars_GetActualVisibleItemsOnPageToCX: 240 227 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 241 MIN_U cx, [bp+MENUINIT.wItems] 228 cmp cx, [bp+MENUINIT.wItems] 229 jb SHORT .Return 230 mov cx, [bp+MENUINIT.wItems] 231 ALIGN JUMP_ALIGN, ret 232 .Return: 242 233 ret 243 234 -
trunk/Assembly_Library/Src/String/Char.asm
r162 r181 161 161 Char_ALtoLowerCaseLetter: 162 162 call Char_IsUpperCaseLetterInAL ; Is upper case character? 163 jnc SHORT .Return ; If not, return 164 add al, 'a'-'A' ; Convert to lower case 165 .Return: 166 ret 163 jmp SHORT Char_ALtoUpperCaseLetter.CheckCF 167 164 %endif 168 165 … … 179 176 Char_ALtoUpperCaseLetter: 180 177 call Char_IsLowerCaseLetterInAL ; Is lower case character? 181 jnc SHORT .Return ; If not, return 182 sub al, 'a'-'A' ; Convert to upper case 178 .CheckCF: 179 jnc SHORT Char_ChangeCaseInAL.Return 180 ; Fall to Char_ChangeCaseInAL 181 182 ;-------------------------------------------------------------------- 183 ; Char_ChangeCaseInAL 184 ; Parameters: 185 ; AL: Character to convert (must be A-Z or a-z) 186 ; Returns: 187 ; AL: Character converted 188 ; Corrupts registers: 189 ; Nothing 190 ;-------------------------------------------------------------------- 191 Char_ChangeCaseInAL: 192 xor al, 32 183 193 .Return: 184 194 ret 185 186 195 187 196 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/Util/Math.asm
r174 r181 17 17 ; AX 18 18 ;-------------------------------------------------------------------- 19 %ifndef EXCLUDE_FROM_XTIDECFG ; Not used in XTIDECFG 19 20 ALIGN JUMP_ALIGN 20 Math_DivQWatSSBPbyCX: ; This procedure is included but not used in XTIDECFG21 Math_DivQWatSSBPbyCX: 21 22 xor dx, dx 22 23 mov ax, [bp+6] ; Load highest divident WORD to DX:AX … … 36 37 mov [bp], ax 37 38 ret 39 %endif 38 40 39 41 … … 49 51 ; Nothing 50 52 ;-------------------------------------------------------------------- 51 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 53 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG 52 54 ALIGN JUMP_ALIGN 53 Math_DivDXAXbyCX: ; This procedure is included but not used in XTIDECFG55 Math_DivDXAXbyCX: ; This is currently unused (dead code) 54 56 xor bx, bx 55 57 xchg bx, ax
Note:
See TracChangeset
for help on using the changeset viewer.