File:  [Corridor 8: Galactic Wars] / src / corr7asm.asm
Revision (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:57:44 2018 UTC (2 years, 5 months ago) by root
Branches: corridor8, MAIN
CVS tags: HEAD, Capstone

; *   TEKASM.ASM  - assembly code for Tekwar game                           *
; *                                                                         *
; *                                                      3/29/95 Jeff S.    *
; ***************************************************************************/
; WATCOM C/C++ Assembler (WASM.EXE) Template.
; Written by Keith Harrison CIS:100431,1675 16th Nov 1994.

                .586p     ; 386, 486, Pentium

                ; Declare non-parameter registers that you alter as
                ; a #pragma in the C++ file.

                ASSUME  CS:_TEXT
                ASSUME  DS:_DATA

_DATA           SEGMENT 'DATA' USE32

return_code     dd      0
integer_data    dd      0

_DATA           ENDS


; (template to follow)
;     On entry: eax = pointer to integer number,
;               ebx = value to store at address eax.
;asm_main_       PROC    NEAR
;                call    protected_code  ; Call your own code...
;                cld                     ; Direction bit must be clear on exit.
;                mov     eax, [return_code]; EAX = return value (if required).
;                ret
;asm_main_       ENDP

                PUBLIC  asmwaitvrt_      ; Note underscore AFTER function name.

asmwaitvrt_     PROC    NEAR
                xor     edx,edx
                xor     eax,eax
                xor     dx, 0x03DA

					 ; ecx loaded via param

					 ; wait for a display signal to make sure the raster isn't 
					 ; in the middle of a sync
                in      al,dx
                test    al,8
                jnz     @@waitnosync

                in      al,dx
                test    al,8
                jz      @@waitsync

                loop    @@waitnosync

                cld                      ; Direction bit must be clear on exit.

asmwaitvrt_     ENDP

                PUBLIC  asmsetpalette_

asmsetpalette_  PROC    NEAR
					 ; pal ptr passed in esi
                xor     eax, eax
                mov     edx,0x000003C8   ; PEL_WRITE_ADR
                out     dx,al
                mov     edx,0x000003C9   ; PEL_DATA

                mov     cx,256
                out     dx,al
                out     dx,al
                out     dx,al
                loop    @@setloop


asmsetpalette_  ENDP

_TEXT           ENDS