]> 4ch.mooo.com Git - 16.git/blob - 16/tauron/ASM_SRC/DUAL.ASM
0ee3105543e29010a251f77f98e17343ca33585b
[16.git] / 16 / tauron / ASM_SRC / DUAL.ASM
1 ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
2 ;=-                                                                         -=\r
3 ;=-                   Tauron VGA Utilities Version 3.0                      -=\r
4 ;=-                      Released September 20, 1998                        -=\r
5 ;=-                                                                         -=\r
6 ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
7 ;=- Copyright (c) 1997, 1998 by Jeff Morgan  =-= This code is FREE provided -=\r
8 ;=- All Rights Reserved.                     =-= that you put my name some- -=\r
9 ;=-                                          =-= where in your credits.     -=\r
10 ;=- DISCLAIMER:                              =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
11 ;=- I assume no responsibility whatsoever for any effect that this package, -=\r
12 ;=- the information contained therein or the use thereof has on you, your   -=\r
13 ;=- sanity, computer, spouse, children, pets or anything else related to    -=\r
14 ;=- you or your existance. No warranty is provided nor implied with this    -=\r
15 ;=- source code.                                                            -=\r
16 ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
17 ; 3C4H, 03H\r
18 ; Bit positions for font maps:\r
19 ;\r
20 ; +--7--+--6--+--5--+--4--+--3--+--2--+--1--+--0--+\r
21 ; |     |     | SAH | SBH |    SA     |    SB     |\r
22 ; +-----+-----+-----+-----+-----+-----+-----+-----+\r
23 ;\r
24 ; SA  - bits 1, 0 of Character Map A\r
25 ; SAH - bit 2 (high order) of Charcter Map A\r
26 ;\r
27 ; SB  - bits 1, 0 of Character Map B\r
28 ; SBH - bit 2 (high order) of Charcter Map B\r
29 ;\r
30 \r
31 ; Points to fonts for Map A              Memory Address\r
32 DFM_MAPA_FONT1     EQU     00H          ;  0K\r
33 DFM_MAPA_FONT2     EQU     04H          ; 16K\r
34 DFM_MAPA_FONT3     EQU     08H          ; 32K\r
35 DFM_MAPA_FONT4     EQU     0CH          ; 48K\r
36 DFM_MAPA_FONT5     EQU     20H          ;  8K\r
37 DFM_MAPA_FONT6     EQU     24H          ; 24K\r
38 DFM_MAPA_FONT7     EQU     28H          ; 40K\r
39 DFM_MAPA_FONT8     EQU     2CH          ; 56K\r
40 \r
41 ; Points to fonts for Map B\r
42 DFM_MAPB_FONT1     EQU     00H          ;  0K\r
43 DFM_MAPB_FONT2     EQU     01H          ; 16K\r
44 DFM_MAPB_FONT3     EQU     02H          ; 32K\r
45 DFM_MAPB_FONT4     EQU     03H          ; 48K\r
46 DFM_MAPB_FONT5     EQU     10H          ;  8K\r
47 DFM_MAPB_FONT6     EQU     11H          ; 24K\r
48 DFM_MAPB_FONT7     EQU     12H          ; 40K\r
49 DFM_MAPB_FONT8     EQU     13H          ; 56K\r
50 \r
51 \r
52 ; To set dual font mode, just set the character map select register to point\r
53 ; to 2 different fonts.  There can be up to 8 fonts resident in memory at\r
54 ; once but only 2 can be active at a time.\r
55 ;\r
56 ; ** NOTE ** If you set both font maps the same you are no longer in dual font\r
57 ; mode.  But what this allows you to do is to put up to 8 fonts in VGA memory\r
58 ; and switch between them at any time.\r
59 ;\r
60 ; Both fonts were made with my font editor.  I just read the BIOS and \r
61 ; modified the second font so a solid line goes through the middle of it.\r
62 ;\r
63 ; This procedure sets up dual font mode and loads 2 fonts into video memory.\r
64 SETDUAL PROC\r
65 \r
66    ; Sequencer address\r
67    MOV DX,SEQ_ADDR\r
68 \r
69    ; 2 different font maps\r
70    MOV AH,DFM_MAPA_FONT1\r
71    OR AH,DFM_MAPB_FONT5\r
72 \r
73    ; Sequencer register\r
74    MOV AL,03H\r
75 \r
76    ; Send it\r
77    OUT DX,AX\r
78 \r
79    ; Load font 1 into 0K\r
80    PUSH 16                 ; Bytes per character\r
81    PUSH 0                  ; Offset of font in Video Memory\r
82    PUSH 0A000H\r
83    PUSH OFFSET FONT1       ; Offset of Font in our Data Segment\r
84    PUSH DS\r
85    CALL LOADFONT\r
86 \r
87    ; Load font 2 into 8K\r
88    PUSH 16                 ; Bytes per character\r
89    PUSH 0                  ; Offset of font in Video Memory\r
90    PUSH 0A200H\r
91    PUSH OFFSET FONT2       ; Offset of Font in our Data Segment\r
92    PUSH DS\r
93    CALL LOADFONT\r
94 \r
95    RET\r
96 SETDUAL ENDP\r
97 \r
98 ; This procedure reset the character map select register to point to only\r
99 ; one font.\r
100 UNSETDUAL PROC\r
101 \r
102    ; Set both fonts to point to font 1\r
103    MOV DX,SEQ_ADDR\r
104    MOV AX,0003H\r
105    OUT DX,AX\r
106 \r
107    RET\r
108 UNSETDUAL ENDP\r
109 \r
110 ; In dual font modes, the palette is in effect half of what it is.  The \r
111 ; bottom 8 colors for the first font, and the top 8 colors for the second \r
112 ; font.\r
113 ;\r
114 ; What I do here is to set them to the same 8 colors.\r
115 ; Black, Blue, Green, Red, Purple, Yellow, Light Gray, and White\r
116 ;\r
117 SETDUALPALETTE PROC\r
118 \r
119    PUSH 0\r
120    PUSH 0\r
121    PUSH 0\r
122    PUSH 0\r
123    CALL SETPAL\r
124 \r
125    PUSH 42\r
126    PUSH 0\r
127    PUSH 0\r
128    PUSH 1\r
129    CALL SETPAL\r
130 \r
131    PUSH 0\r
132    PUSH 42\r
133    PUSH 0\r
134    PUSH 2\r
135    CALL SETPAL\r
136 \r
137    PUSH 42\r
138    PUSH 42\r
139    PUSH 0\r
140    PUSH 3\r
141    CALL SETPAL\r
142 \r
143    PUSH 0\r
144    PUSH 0\r
145    PUSH 42\r
146    PUSH 4\r
147    CALL SETPAL\r
148 \r
149    PUSH 21\r
150    PUSH 63\r
151    PUSH 63\r
152    PUSH 5\r
153    CALL SETPAL\r
154 \r
155    PUSH 42\r
156    PUSH 42\r
157    PUSH 42\r
158    PUSH 6\r
159    CALL SETPAL\r
160 \r
161    PUSH 63\r
162    PUSH 63\r
163    PUSH 63\r
164    PUSH 7\r
165    CALL SETPAL\r
166 \r
167    PUSH 0\r
168    PUSH 0\r
169    PUSH 0\r
170    PUSH 8\r
171    CALL SETPAL\r
172 \r
173    PUSH 42\r
174    PUSH 0\r
175    PUSH 0\r
176    PUSH 9\r
177    CALL SETPAL\r
178 \r
179    PUSH 0\r
180    PUSH 42\r
181    PUSH 0\r
182    PUSH 10\r
183    CALL SETPAL\r
184 \r
185    PUSH 42\r
186    PUSH 42\r
187    PUSH 0\r
188    PUSH 11\r
189    CALL SETPAL\r
190 \r
191    PUSH 0\r
192    PUSH 0\r
193    PUSH 42\r
194    PUSH 12\r
195    CALL SETPAL\r
196 \r
197    PUSH 21\r
198    PUSH 63\r
199    PUSH 63\r
200    PUSH 13\r
201    CALL SETPAL\r
202 \r
203    PUSH 42\r
204    PUSH 42\r
205    PUSH 42\r
206    PUSH 14\r
207    CALL SETPAL\r
208 \r
209    PUSH 63\r
210    PUSH 63\r
211    PUSH 63\r
212    PUSH 15\r
213    CALL SETPAL\r
214 \r
215    RET\r
216 SETDUALPALETTE ENDP\r
217 \r
218 DUALTEST PROC\r
219 \r
220    MOV SI,OFFSET MODE03H\r
221    CALL SETMODE\r
222 \r
223    CALL SETDUAL\r
224    CALL SETDUALPALETTE\r
225 \r
226    PUSH 1FH        \r
227    CALL TEXTCLEAR\r
228 \r
229    ; Attribute to print text in.\r
230    ;\r
231    ; In dual font mode, attrubute bit 3 is the deciding factor as to which\r
232    ; font is printed.  0001X111B where X is 0 for font 1 or 1 for font 2.\r
233    ; The Charcter Map Select Register determines where font 1 and font 2\r
234    ; reside.\r
235    ; 00011111B - Font 2, Blue Background, with color 7 text.\r
236    MOV ATT, 1Fh    \r
237 \r
238    MOV BX,5\r
239    MOV AX,0\r
240    MOV SI,OFFSET TEXTMSG_D\r
241    CALL PRINTSTRING\r
242    MOV BX,6\r
243    MOV AX,0\r
244    MOV SI,OFFSET TEXTMSG_E\r
245    CALL PRINTSTRING\r
246    MOV BX,7\r
247    MOV AX,0\r
248    MOV SI,OFFSET TEXTMSG_F\r
249    CALL PRINTSTRING\r
250 \r
251    ; 00010111B - Font 1, Blue Background, with color 7 text.\r
252    MOV ATT, 17h\r
253 \r
254    MOV BX,0\r
255    MOV AX,0\r
256    MOV SI,OFFSET TEXTMSG_D\r
257    CALL PRINTSTRING\r
258    MOV BX,1\r
259    MOV AX,0\r
260    MOV SI,OFFSET TEXTMSG_E\r
261    CALL PRINTSTRING\r
262    MOV BX,2\r
263    MOV AX,0\r
264    MOV SI,OFFSET TEXTMSG_F\r
265    CALL PRINTSTRING\r
266 \r
267    ; Wait for a keypress\r
268    MOV AH,0\r
269    INT 16H\r
270 \r
271    CALL UNSETDUAL\r
272    RET\r
273 DUALTEST ENDP\r
274 \r
275 ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r