summaryrefslogtreecommitdiff
path: root/v4.0/src/SELECT/S_DISPLY.ASM
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/SELECT/S_DISPLY.ASM
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/SELECT/S_DISPLY.ASM')
-rw-r--r--v4.0/src/SELECT/S_DISPLY.ASM112
1 files changed, 112 insertions, 0 deletions
diff --git a/v4.0/src/SELECT/S_DISPLY.ASM b/v4.0/src/SELECT/S_DISPLY.ASM
new file mode 100644
index 0000000..c04540e
--- /dev/null
+++ b/v4.0/src/SELECT/S_DISPLY.ASM
@@ -0,0 +1,112 @@
1;********************************************************************************
2; File: S_DISPLY.ASM
3;
4; This module contains a subroutine for setting the mode of the display to
5; 80X25 text mode.
6;
7; If ANSI.SYS is loaded, then the calls to change the mode go through it,
8; otherwise standard BIOS calls are performed.
9;
10; If ANSI.SYS is to be used, then a version dated July 15, 1987 or later must
11; be used.
12;
13;********************************************************************************
14.ALPHA ;AN000;
15.XLIST ;AN000;
16INCLUDE STRUC.INC ;AN000;
17.LIST ;AN000;
18
19DATA SEGMENT BYTE PUBLIC 'DATA' ;AN000;
20
21
22; Buffer for IOCTL calls
23BUFFER LABEL BYTE ;AN000;
24 DB 0 ;AN000; INFO LEVEL
25 DB 0 ;AN000; RESERVED
26 DW 14 ;AN000; SIZE
27FLAGS DW 0 ;AN000;
28D_MODE DB 0 ;AN000; 1 = TEXT, 2 = APA
29 DB 0 ;AN000; RESERVED
30COLORS DW 0 ;AN000;
31B_WIDTH DW 0 ;AN000; PELS ==> -1 FOR TEXT
32B_LENGTH DW 0 ;AN000; PELS ==> -1 FOR TEXT
33COLS DW 0 ;AN000;
34ROWS DW 0 ;AN000;
35
36DATA ENDS ;AN000;
37
38CODE_FAR SEGMENT BYTE PUBLIC 'CODE' ;AN000;
39
40 ASSUME CS:CODE_FAR, DS:DATA ;AN000;
41
42;********************************************************************************
43; SET_DISPLAY_MODE_ROUTINE: Set the display mode to 80X25 text mode.
44;
45; INPUT:
46; None.
47;
48; OUTPUT:
49; If CY = 1, then an error was encountered making a IOCTL call.
50; If CY = 0, there were no errors.
51;
52; Operation: If ANSY.SYS is loaded, then the mode is set by calls to it,
53; otherwise BIOS calls are used.
54;
55;********************************************************************************
56PUBLIC SET_DISPLAY_MODE_ROUTINE ;AN000;
57SET_DISPLAY_MODE_ROUTINE PROC FAR ;AN000;
58
59 ;**********************************************************************
60 ; See if ANSI.SYS is loaded
61 ;**********************************************************************
62 MOV AX, 1A00H ;AC086;SEH changed from 1600h to avoid MICROSOFT collision ;AN000; Fn. for determining ANSI.SYS state
63 INT 2FH ;AN000; Returns AL = 0FFh if it is loaded
64 .IF < AL NE 0FFH > ;AN000; Is it loaded?
65 MOV AH, 15 ;AN000; No! Fn. number for getting the current video state
66 INT 10H ;AN000; Get the video state
67 .IF < AL EQ 07H > OR ;AN000; If in monochrome mode,
68 .IF < AL EQ 0FH> ;AN000; or monochrome graphics mode,
69 MOV AX, 07H ;AN000; Set monochrome mode
70 .ELSE ;AN000; Otherwise...
71 MOV AX, 03H ;AN000; Set mode 3: 80 column, color enabled
72 .ENDIF ;AN000;
73 INT 10H ;AN000; Set the mode
74 .ELSE ;AN000;
75 MOV AX, 440CH ;AN000; Get the info from ANSI.
76 MOV BX, 0 ;AN000;
77 MOV CX, 037FH ;AN000;
78 MOV DX, OFFSET BUFFER ;AN000;
79 INT 21H ;AN000;
80 .IF < C > ;AN000; Was there an error?
81 JMP ERROR_SETTING ;AN000; Yes! Exit the subroutine.
82 .ENDIF ;AN000;
83 MOV D_MODE, 1 ;AN000; Set to text mode
84 MOV B_WIDTH, -1 ;AN000; -1 for text mode
85 MOV B_LENGTH, -1 ;AN000; -1 for text mode
86 MOV COLS, 80 ;AN000; Number of columns
87 MOV ROWS, 25 ;AN000; Number of rows
88 .IF < COLORS NE 0 > ;AN000; If colors = 0, monochrome
89 MOV COLORS, 16 ;AN000; Otherwise set 16 color mode
90 .ENDIF ;AN000;
91 MOV AX, 440CH ;AN000; Set the new mode
92 MOV BX, 0 ;AN000;
93 MOV CX, 035FH ;AN000;
94 MOV DX, OFFSET BUFFER ;AN000;
95 INT 21H ;AN000;
96 .IF < C > ;AN000; Was there en error?
97 JMP ERROR_SETTING ;AN000; Yes! Exit the subroutine
98 .ENDIF ;AN000;
99 CLC ;AN000; Indicate there were no errors
100 .ENDIF ;AN000;
101 JMP EXIT_SET ;AN000;
102ERROR_SETTING: ;AN000;
103 STC ;AN000; Indicate that there were errors
104EXIT_SET: ;AN000;
105 RET ;AN000;
106
107SET_DISPLAY_MODE_ROUTINE ENDP ;AN000;
108
109
110CODE_FAR ENDS ;AN000;
111
112END ;AN000;