1 | ; Project name : Assembly Library
|
---|
2 | ; Description : Functions for managing display page.
|
---|
3 |
|
---|
4 | ; Section containing code
|
---|
5 | SECTION .text
|
---|
6 |
|
---|
7 | ;--------------------------------------------------------------------
|
---|
8 | ; DisplayPage_SetFromAL
|
---|
9 | ; Parameters:
|
---|
10 | ; AL: New display page
|
---|
11 | ; DS: BDA segment (zero)
|
---|
12 | ; Returns:
|
---|
13 | ; Nothing
|
---|
14 | ; Corrupts registers:
|
---|
15 | ; AX, DX
|
---|
16 | ;--------------------------------------------------------------------
|
---|
17 | %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
|
---|
18 | ALIGN DISPLAY_JUMP_ALIGN
|
---|
19 | DisplayPage_SetFromAL:
|
---|
20 | xor ah, ah
|
---|
21 | mul WORD [VIDEO_BDA.wBytesPerPage] ; AX = Offset to page
|
---|
22 | mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], ax
|
---|
23 | ret
|
---|
24 | %endif
|
---|
25 |
|
---|
26 |
|
---|
27 | ;--------------------------------------------------------------------
|
---|
28 | ; DisplayPage_GetColumnsToALandRowsToAH
|
---|
29 | ; Parameters:
|
---|
30 | ; DS: BDA segment (zero)
|
---|
31 | ; Returns:
|
---|
32 | ; AL: Number of columns in selected text mode
|
---|
33 | ; AH: Number of rows in selected text mode
|
---|
34 | ; Corrupts registers:
|
---|
35 | ; Nothing
|
---|
36 | ;--------------------------------------------------------------------
|
---|
37 | ALIGN DISPLAY_JUMP_ALIGN
|
---|
38 | DisplayPage_GetColumnsToALandRowsToAH:
|
---|
39 | mov al, [VIDEO_BDA.wColumns] ; 40 or 80
|
---|
40 | mov ah, 25 ; Always 25 rows on standard text modes
|
---|
41 | ret
|
---|
42 |
|
---|
43 |
|
---|
44 | ;--------------------------------------------------------------------
|
---|
45 | ; DisplayPage_SynchronizeToHardware
|
---|
46 | ; Parameters:
|
---|
47 | ; DS: BDA segment (zero)
|
---|
48 | ; Returns:
|
---|
49 | ; Nothing
|
---|
50 | ; Corrupts registers:
|
---|
51 | ; AX, DX
|
---|
52 | ;--------------------------------------------------------------------
|
---|
53 | ALIGN DISPLAY_JUMP_ALIGN
|
---|
54 | DisplayPage_SynchronizeToHardware:
|
---|
55 | xor dx, dx
|
---|
56 | mov ax, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
|
---|
57 | div WORD [VIDEO_BDA.wBytesPerPage] ; AX = Page
|
---|
58 |
|
---|
59 | cmp al, [VIDEO_BDA.bActivePage]
|
---|
60 | je SHORT .Return ; Same page, no need to synchronize
|
---|
61 | mov ah, SELECT_ACTIVE_DISPLAY_PAGE
|
---|
62 | int BIOS_VIDEO_INTERRUPT_10h
|
---|
63 | .Return:
|
---|
64 | ret
|
---|