[41] | 1 | ; Project name : Assembly Library
|
---|
| 2 | ; Description : Display Library functions for CALL_DISPLAY_LIBRARY macro
|
---|
| 3 | ; that users should use to make library call.
|
---|
| 4 |
|
---|
[376] | 5 | ;
|
---|
[526] | 6 | ; XTIDE Universal BIOS and Associated Tools
|
---|
| 7 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
[376] | 8 | ;
|
---|
| 9 | ; This program is free software; you can redistribute it and/or modify
|
---|
| 10 | ; it under the terms of the GNU General Public License as published by
|
---|
| 11 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
| 12 | ; (at your option) any later version.
|
---|
[526] | 13 | ;
|
---|
[376] | 14 | ; This program is distributed in the hope that it will be useful,
|
---|
| 15 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 16 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
[526] | 17 | ; GNU General Public License for more details.
|
---|
[376] | 18 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
[526] | 19 | ;
|
---|
[376] | 20 |
|
---|
[41] | 21 | ; Section containing code
|
---|
| 22 | SECTION .text
|
---|
| 23 |
|
---|
| 24 | ;--------------------------------------------------------------------
|
---|
| 25 | ; DisplayFunctionFromDI
|
---|
| 26 | ; Parameters:
|
---|
| 27 | ; DI: Function to call (DISPLAY_LIB.functionName)
|
---|
| 28 | ; Others: Depends on function to call (DX cannot be parameter)
|
---|
| 29 | ; Returns:
|
---|
| 30 | ; Depends on function to call
|
---|
| 31 | ; Corrupts registers:
|
---|
| 32 | ; AX (unless used as a return register), DI
|
---|
| 33 | ;--------------------------------------------------------------------
|
---|
[369] | 34 | ALIGN DISPLAY_JUMP_ALIGN
|
---|
[41] | 35 | Display_FunctionFromDI:
|
---|
| 36 | push es
|
---|
| 37 | push ds
|
---|
| 38 | push dx
|
---|
| 39 |
|
---|
| 40 | cld
|
---|
| 41 | LOAD_BDA_SEGMENT_TO ds, dx
|
---|
[177] | 42 | mov dx, di
|
---|
[41] | 43 | les di, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
|
---|
| 44 | call dx
|
---|
| 45 | mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
|
---|
| 46 |
|
---|
| 47 | pop dx
|
---|
| 48 | pop ds
|
---|
| 49 | pop es
|
---|
| 50 | ret
|
---|
| 51 |
|
---|
| 52 | ;--------------------------------------------------------------------
|
---|
[177] | 53 | ; Display_FormatNullTerminatedStringFromCSSI
|
---|
[41] | 54 | ; Parameters:
|
---|
| 55 | ; Same as DisplayPrint_FormattedNullTerminatedStringFromCSSI
|
---|
| 56 | ; Returns:
|
---|
| 57 | ; Stack variables will be cleaned
|
---|
| 58 | ; Corrupts registers:
|
---|
| 59 | ; AX
|
---|
| 60 | ;--------------------------------------------------------------------
|
---|
[369] | 61 | ALIGN DISPLAY_JUMP_ALIGN
|
---|
[177] | 62 | Display_FormatNullTerminatedStringFromCSSI:
|
---|
[101] | 63 | pop ax ; Discard return address to inside Display_FunctionFromDI
|
---|
[41] | 64 | call DisplayPrint_FormattedNullTerminatedStringFromCSSI
|
---|
| 65 | mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
|
---|
| 66 |
|
---|
| 67 | pop dx
|
---|
| 68 | pop ds
|
---|
| 69 | pop es
|
---|
| 70 |
|
---|
| 71 | pop ax ; Pop return address
|
---|
| 72 | mov sp, bp ; Clean stack variables
|
---|
| 73 | jmp ax
|
---|
| 74 |
|
---|
| 75 |
|
---|
[181] | 76 | %define InitializeDisplayContext DisplayContext_Initialize
|
---|
| 77 |
|
---|
[133] | 78 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
|
---|
[181] | 79 | %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX
|
---|
[133] | 80 | %endif
|
---|
[181] | 81 | %define SetCharOutputFunctionFromAXwithAttribFlagInBL DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
|
---|
| 82 | %define SetCharacterOutputParameterFromAX DisplayContext_SetCharacterOutputParameterFromAX
|
---|
| 83 | %define SetCharacterAttributeFromAL DisplayContext_SetCharacterAttributeFromAL
|
---|
| 84 | %define SetCursorShapeFromAX DisplayCursor_SetShapeFromAX
|
---|
| 85 | %define SetCursorCoordinatesFromAX DisplayCursor_SetCoordinatesFromAX
|
---|
[370] | 86 | %ifndef EXCLUDE_FROM_XTIDECFG
|
---|
[181] | 87 | %define SetNewPageFromAL DisplayPage_SetFromAL
|
---|
[370] | 88 | %endif
|
---|
[181] | 89 | %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware
|
---|
[41] | 90 |
|
---|
[133] | 91 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
|
---|
[181] | 92 | %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX
|
---|
[133] | 93 | %endif
|
---|
[181] | 94 | %define GetSoftwareCoordinatesToAX DisplayCursor_GetSoftwareCoordinatesToAX
|
---|
| 95 | %define GetColumnsToALandRowsToAH DisplayPage_GetColumnsToALandRowsToAH
|
---|
[41] | 96 |
|
---|
[181] | 97 | %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI
|
---|
[134] | 98 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
|
---|
[181] | 99 | %define PrintSignedWordFromAXWithBaseInBX DisplayPrint_SignedWordFromAXWithBaseInBX
|
---|
[134] | 100 | %endif
|
---|
[181] | 101 | %define PrintWordFromAXwithBaseInBX DisplayPrint_WordFromAXWithBaseInBX
|
---|
[341] | 102 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
|
---|
[323] | 103 | %define PrintQWordFromSSBPwithBaseInBX DisplayPrint_QWordFromSSBPwithBaseInBX
|
---|
| 104 | %endif
|
---|
[181] | 105 | %define PrintCharBufferFromBXSIwithLengthInCX DisplayPrint_CharacterBufferFromBXSIwithLengthInCX
|
---|
| 106 | %define PrintNullTerminatedStringFromBXSI DisplayPrint_NullTerminatedStringFromBXSI
|
---|
| 107 | %define PrintNullTerminatedStringFromCSSI DisplayPrint_NullTerminatedStringFromCSSI
|
---|
| 108 | %define PrintRepeatedCharacterFromALwithCountInCX DisplayPrint_RepeatCharacterFromALwithCountInCX
|
---|
| 109 | %define PrintCharacterFromAL DisplayPrint_CharacterFromAL
|
---|
| 110 | %define PrintNewlineCharacters DisplayPrint_Newline
|
---|
[134] | 111 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
|
---|
[181] | 112 | %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
|
---|
[134] | 113 | %endif
|
---|
[181] | 114 | %define ClearScreenWithCharInALandAttrInAH DisplayPrint_ClearScreenWithCharInALandAttributeInAH
|
---|
[177] | 115 |
|
---|