]> 4ch.mooo.com Git - 16.git/blob - 16/x/mxwp.asm
wwww
[16.git] / 16 / x / mxwp.asm
1 ;-----------------------------------------------------------\r
2 ;\r
3 ; MXWP.ASM - Set write/read plane functions\r
4 ; Copyright (c) 1993,1994 by Alessandro Scotti\r
5 ;\r
6 ;-----------------------------------------------------------\r
7 WARN    PRO\r
8 INCLUDE MODEX.DEF\r
9 \r
10 PUBLIC  mxWritePlane\r
11 PUBLIC  mxReadPlane\r
12 \r
13 MX_TEXT         SEGMENT USE16 PARA PUBLIC 'CODE'\r
14                 ASSUME cs:MX_TEXT, ds:NOTHING, es:NOTHING\r
15 \r
16 ;-----------------------------------------------------------\r
17 ;\r
18 ; Sets the write plane(s).\r
19 ;\r
20 ; Input:\r
21 ;       Plane   = write plane(s) to set (bit 0 enables plane 0,\r
22 ;                 bit 1 enables plane 1 and so on, different planes\r
23 ;                 may be selected at the same time)\r
24 ; Output:\r
25 ;       none\r
26 ;\r
27 mxWritePlane    PROC    FAR\r
28         ARG     Plane:BYTE:2    = ARG_SIZE\r
29         .enter  0\r
30 \r
31         mov     ah, [Plane]\r
32         and     ah, 00001111b           ; Mask off unused bits\r
33         mov     al, 02h\r
34         mov     dx, TS\r
35         out     dx, ax\r
36 \r
37         .leave  ARG_SIZE\r
38 mxWritePlane    ENDP\r
39 \r
40 ;-----------------------------------------------------------\r
41 ;\r
42 ; Sets the read plane.\r
43 ;\r
44 ; Input:\r
45 ;       Plane   = read plane to set (0,1,2,3)\r
46 ; Output:\r
47 ;       none\r
48 ;\r
49 mxReadPlane     PROC    FAR\r
50         ARG     Plane:BYTE:2    = ARG_SIZE\r
51         ASSUME  ds:NOTHING\r
52         .enter  0\r
53         mov     al, 04h\r
54         mov     ah, [Plane]\r
55         and     ah, 0000011b            ; Mask off unused bits\r
56         mov     dx, GDC\r
57         out     dx, ax\r
58         .leave  ARG_SIZE\r
59 mxReadPlane     ENDP\r
60 \r
61 MX_TEXT         ENDS\r
62 END\r