1 | ; Project name : Assembly Library
|
---|
2 | ; Description : Character out function for printing within menu window.
|
---|
3 |
|
---|
4 | ;
|
---|
5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
7 | ;
|
---|
8 | ; This program is free software; you can redistribute it and/or modify
|
---|
9 | ; it under the terms of the GNU General Public License as published by
|
---|
10 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
11 | ; (at your option) any later version.
|
---|
12 | ;
|
---|
13 | ; This program is distributed in the hope that it will be useful,
|
---|
14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | ; GNU General Public License for more details.
|
---|
17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
18 | ;
|
---|
19 |
|
---|
20 |
|
---|
21 | ; Section containing code
|
---|
22 | SECTION .text
|
---|
23 |
|
---|
24 | ;--------------------------------------------------------------------
|
---|
25 | ; MenuCharOut_MenuTeletypeOutputWithAutomaticLineChange
|
---|
26 | ; MenuCharOut_MenuTeletypeOutput
|
---|
27 | ; Parameters:
|
---|
28 | ; AL: Character to output
|
---|
29 | ; AH: Attribute to output
|
---|
30 | ; DS: BDA segment (zero)
|
---|
31 | ; ES:DI: Ptr to video memory where to output
|
---|
32 | ; [DISPLAY_CONTEXT.wCharOutParam]:
|
---|
33 | ; Low byte = First column offset (after CR)
|
---|
34 | ; High byte = Last column offset (when using automatic line change)
|
---|
35 | ; Returns:
|
---|
36 | ; DI: Incremented for next character
|
---|
37 | ; Corrupts registers:
|
---|
38 | ; AX, DX
|
---|
39 | ;--------------------------------------------------------------------
|
---|
40 | ALIGN MENU_JUMP_ALIGN
|
---|
41 | MenuCharOut_MenuTeletypeOutputWithAutomaticLineChange:
|
---|
42 | call CharOutLineSplitter_IsCursorAtTheEndOfTextLine
|
---|
43 | jnc SHORT MenuCharOut_MenuTeletypeOutput
|
---|
44 | cmp al, ' '
|
---|
45 | jb SHORT ReturnSinceNoNeedToStartLineWithControlCharacter
|
---|
46 | call CharOutLineSplitter_MovePartialWordToNewTextLine
|
---|
47 | ; Fall to MenuCharOut_MenuTextTeletypeOutputWithAttribute
|
---|
48 |
|
---|
49 | ALIGN MENU_JUMP_ALIGN
|
---|
50 | MenuCharOut_MenuTeletypeOutput:
|
---|
51 | cmp al, CR
|
---|
52 | je SHORT PrintCRandAdjustOffsetForStartOfLine
|
---|
53 | jmp DisplayCharOut_TeletypeOutputWithAttribute
|
---|
54 |
|
---|
55 |
|
---|
56 | ;--------------------------------------------------------------------
|
---|
57 | ; MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine
|
---|
58 | ; PrintCRandAdjustOffsetForStartOfLine
|
---|
59 | ; Parameters:
|
---|
60 | ; DS: BDA segment (zero)
|
---|
61 | ; ES:DI: Ptr to cursor location
|
---|
62 | ; [DISPLAY_CONTEXT.wCharOutParam]:
|
---|
63 | ; Low byte = First column offset (after CR)
|
---|
64 | ; High byte = Last column offset (when using automatic line change)
|
---|
65 | ; Returns:
|
---|
66 | ; ES:DI: Ptr to beginning of new line
|
---|
67 | ; Corrupts registers:
|
---|
68 | ; AX, DX
|
---|
69 | ;--------------------------------------------------------------------
|
---|
70 | ALIGN MENU_JUMP_ALIGN
|
---|
71 | MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine:
|
---|
72 | mov al, LF
|
---|
73 | call DisplayCharOut_BiosTeletypeOutput
|
---|
74 | ; Fall to PrintCRandAdjustOffsetForStartOfLine
|
---|
75 |
|
---|
76 | ALIGN MENU_JUMP_ALIGN
|
---|
77 | PrintCRandAdjustOffsetForStartOfLine:
|
---|
78 | mov al, CR
|
---|
79 | call DisplayCharOut_BiosTeletypeOutput
|
---|
80 | eMOVZX ax, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
|
---|
81 | add di, ax
|
---|
82 | ReturnSinceNoNeedToStartLineWithControlCharacter:
|
---|
83 | ret
|
---|