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 |
|
---|
5 | ;
|
---|
6 | ; XTIDE Universal BIOS and Associated Tools
|
---|
7 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
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.
|
---|
13 | ;
|
---|
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
|
---|
17 | ; GNU General Public License for more details.
|
---|
18 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
19 | ;
|
---|
20 |
|
---|
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 | ;--------------------------------------------------------------------
|
---|
34 | ALIGN DISPLAY_JUMP_ALIGN
|
---|
35 | Display_FunctionFromDI:
|
---|
36 | push es
|
---|
37 | push ds
|
---|
38 | push dx
|
---|
39 |
|
---|
40 | %ifdef CLD_NEEDED
|
---|
41 | cld
|
---|
42 | %endif
|
---|
43 | LOAD_BDA_SEGMENT_TO ds, dx
|
---|
44 | mov dx, di
|
---|
45 | les di, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
|
---|
46 | call dx
|
---|
47 | mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
|
---|
48 |
|
---|
49 | pop dx
|
---|
50 | pop ds
|
---|
51 | pop es
|
---|
52 | ret
|
---|
53 |
|
---|
54 | ;--------------------------------------------------------------------
|
---|
55 | ; Display_FormatNullTerminatedStringFromCSSI
|
---|
56 | ; Parameters:
|
---|
57 | ; Same as DisplayPrint_FormattedNullTerminatedStringFromCSSI
|
---|
58 | ; Returns:
|
---|
59 | ; Stack variables will be cleaned
|
---|
60 | ; Corrupts registers:
|
---|
61 | ; AX
|
---|
62 | ;--------------------------------------------------------------------
|
---|
63 | ALIGN DISPLAY_JUMP_ALIGN
|
---|
64 | Display_FormatNullTerminatedStringFromCSSI:
|
---|
65 | pop ax ; Discard return address to inside Display_FunctionFromDI
|
---|
66 | call DisplayPrint_FormattedNullTerminatedStringFromCSSI
|
---|
67 | mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
|
---|
68 |
|
---|
69 | pop dx
|
---|
70 | pop ds
|
---|
71 | pop es
|
---|
72 |
|
---|
73 | pop ax ; Pop return address
|
---|
74 | mov sp, bp ; Clean stack variables
|
---|
75 | jmp ax
|
---|
76 |
|
---|
77 |
|
---|
78 | %define InitializeDisplayContext DisplayContext_Initialize
|
---|
79 |
|
---|
80 | %ifndef EXCLUDE_FROM_XUB
|
---|
81 | %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX
|
---|
82 | %endif
|
---|
83 | %define SetCharOutputFunctionFromAXwithAttribFlagInBL DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
|
---|
84 | %define SetCharacterOutputParameterFromAX DisplayContext_SetCharacterOutputParameterFromAX
|
---|
85 | %define SetCharacterAttributeFromAL DisplayContext_SetCharacterAttributeFromAL
|
---|
86 | %define SetCursorShapeFromAX DisplayCursor_SetShapeFromAX
|
---|
87 | %define SetCursorCoordinatesFromAX DisplayCursor_SetCoordinatesFromAX
|
---|
88 | %ifndef EXCLUDE_FROM_XTIDECFG
|
---|
89 | %define SetNewPageFromAL DisplayPage_SetFromAL
|
---|
90 | %endif
|
---|
91 | %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware
|
---|
92 |
|
---|
93 | %ifndef EXCLUDE_FROM_XUB
|
---|
94 | %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX
|
---|
95 | %endif
|
---|
96 | %define GetSoftwareCoordinatesToAX DisplayCursor_GetSoftwareCoordinatesToAX
|
---|
97 | %define GetColumnsToALandRowsToAH DisplayPage_GetColumnsToALandRowsToAH
|
---|
98 |
|
---|
99 | %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI
|
---|
100 | %ifndef EXCLUDE_FROM_XUB
|
---|
101 | %define PrintSignedWordFromAXWithBaseInBL DisplayPrint_SignedWordFromAXWithBaseInBL
|
---|
102 | %endif
|
---|
103 | %define PrintWordFromAXWithBaseInBL DisplayPrint_WordFromAXWithBaseInBL
|
---|
104 | %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
|
---|
105 | %define PrintQWordFromSSBPwithBaseInBX DisplayPrint_QWordFromSSBPwithBaseInBX
|
---|
106 | %endif
|
---|
107 | %define PrintCharBufferFromBXSIwithLengthInCX DisplayPrint_CharacterBufferFromBXSIwithLengthInCX
|
---|
108 | %define PrintNullTerminatedStringFromBXSI DisplayPrint_NullTerminatedStringFromBXSI
|
---|
109 | %define PrintNullTerminatedStringFromCSSI DisplayPrint_NullTerminatedStringFromCSSI
|
---|
110 | %define PrintRepeatedCharacterFromALwithCountInCX DisplayPrint_RepeatCharacterFromALwithCountInCX
|
---|
111 | %define PrintCharacterFromAL DisplayPrint_CharacterFromAL
|
---|
112 | %define PrintNewlineCharacters DisplayPrint_Newline
|
---|
113 | %ifndef EXCLUDE_FROM_XUB
|
---|
114 | %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
|
---|
115 | %endif
|
---|
116 | %define ClearScreenWithCharInALandAttrInAH DisplayPrint_ClearScreenWithCharInALandAttributeInAH
|
---|
117 |
|
---|