;Originally by Rich Geldreich.  Public domain.
;
;Disables the text mode's odd/even addressing and CGA emulation to allow
;modification of the character bitmaps directly, which are in plane 2. Each
;character bitmap uses 32 bytes of video RAM.
;
;To change the space character into a solid block, for instance, do this:
;
;   CALL VOn
;
;   MOV AX,0A000H
;   MOV DS,AX
;   MOV AX,32      ;ASCII # of space
;   MUL 32         ;Start of space character
;   MOV CX,16
;   MOV AL,0FFH
;1: STOSB
;   LOOP 1
;
;   CALL VOff
;
;Thanks to Dave Cooper, who helped with this part.

Von proc near

        Mov     dx, 03c4h
        Mov     ax, 0402h
        Out     dx, ax
        Mov     ax, 0704h
        Out     dx, ax

        Mov     dx, 03ceh
        Mov     ax, 0204h
        Out     dx, ax
        Mov     ax, 0005h
        Out     dx, ax
        Mov     ax, 0406h
        Out     dx, ax

        Retf    0
Von endp
;Fixes the "damage" that Von did... Re-enables odd/even and CGA emulation.

Voff proc near

        Mov     dx, 03ceh
        Mov     ax, 0104h
        Out     dx, ax
        Mov     ax, 0e06h
        Out     dx, ax
        Mov     ax, 01005h
        Out     dx, ax

        Mov     dx, 03c4h
        Mov     ax, 0302h
        Out     dx, ax
        Mov     ax, 0304h
        Out     dx, ax

        Retf    0
Voff endp
End
