]> 4ch.mooo.com Git - 16.git/blobdiff - 16/x_/mxwp.asm
wwww
[16.git] / 16 / x_ / mxwp.asm
diff --git a/16/x_/mxwp.asm b/16/x_/mxwp.asm
new file mode 100755 (executable)
index 0000000..19ca99d
--- /dev/null
@@ -0,0 +1,62 @@
+;-----------------------------------------------------------\r
+;\r
+; MXWP.ASM - Set write/read plane functions\r
+; Copyright (c) 1993,1994 by Alessandro Scotti\r
+;\r
+;-----------------------------------------------------------\r
+WARN    PRO\r
+INCLUDE MODEX.DEF\r
+\r
+PUBLIC  mxWritePlane\r
+PUBLIC  mxReadPlane\r
+\r
+MX_TEXT         SEGMENT USE16 PARA PUBLIC 'CODE'\r
+                ASSUME cs:MX_TEXT, ds:NOTHING, es:NOTHING\r
+\r
+;-----------------------------------------------------------\r
+;\r
+; Sets the write plane(s).\r
+;\r
+; Input:\r
+;       Plane   = write plane(s) to set (bit 0 enables plane 0,\r
+;                 bit 1 enables plane 1 and so on, different planes\r
+;                 may be selected at the same time)\r
+; Output:\r
+;       none\r
+;\r
+mxWritePlane    PROC    FAR\r
+        ARG     Plane:BYTE:2    = ARG_SIZE\r
+        .enter  0\r
+\r
+        mov     ah, [Plane]\r
+        and     ah, 00001111b           ; Mask off unused bits\r
+        mov     al, 02h\r
+        mov     dx, TS\r
+        out     dx, ax\r
+\r
+        .leave  ARG_SIZE\r
+mxWritePlane    ENDP\r
+\r
+;-----------------------------------------------------------\r
+;\r
+; Sets the read plane.\r
+;\r
+; Input:\r
+;       Plane   = read plane to set (0,1,2,3)\r
+; Output:\r
+;       none\r
+;\r
+mxReadPlane     PROC    FAR\r
+        ARG     Plane:BYTE:2    = ARG_SIZE\r
+        ASSUME  ds:NOTHING\r
+        .enter  0\r
+        mov     al, 04h\r
+        mov     ah, [Plane]\r
+        and     ah, 0000011b            ; Mask off unused bits\r
+        mov     dx, GDC\r
+        out     dx, ax\r
+        .leave  ARG_SIZE\r
+mxReadPlane     ENDP\r
+\r
+MX_TEXT         ENDS\r
+END\r