;       name    retrace
; void Vwait_vretrace(void);
; void Vwait_hretrace(void);
;
InputStatus1    EQU     03DAh
;
RETRACE_TEXT   SEGMENT byte public 'CODE'
        ASSUME  cs:RETRACE_TEXT, ds:NOTHING
        PUBLIC  _Vwait_vretrace
        PUBLIC  _Vwait_hretrace

_Vwait_vretrace PROC    far
        mov     dx,InputStatus1
        mov     cl,08h
        jmp     @start
_Vwait_vretrace ENDP

_Vwait_hretrace PROC    far
        mov     dx,InputStatus1
        mov     cl,01h
        jmp     @start
_Vwait_hretrace ENDP

wait_retrace    PROC    far
@start:
        in      al,dx
        and     al,cl
        jnz     @start
@again:
        in      al,dx
        and     al,cl
        jz      @again
@out:
        xor     ah,ah
        ret             ; return to C
wait_retrace   ENDP
RETRACE_TEXT   ENDS
        END

