home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / graphics / acksrc.zip / MEASM.ASM < prev    next >
Assembly Source File  |  1993-06-20  |  2KB  |  99 lines

  1. PAGE 80,132
  2. TITLE - MEASM.ASM - Assembly routines for 3D engine
  3. ;;;;.286P
  4. ;==============================================================================
  5. ; COMMAND LINE ASSEMBLY
  6. ;    MASM /B63 /Z /D_Mx FILENAME;
  7. ;
  8. ;  WHERE Mx SPECIFIES MODEL (l OR c) FOR LARGE OR COMPACT MODELS
  9. ;==============================================================================
  10.     INCLUDE        ET.EQU
  11.     INCLUDE        ET.MAC
  12.  
  13.     PUBLIC        _SetPalette
  14.     PUBLIC        _SetVGAmode
  15.     PUBLIC        _inkey
  16.  
  17. _TEXT    segment byte public 'CODE'
  18. DGROUP    group    _DATA,_BSS
  19.     assume    cs:_TEXT,ds:DGROUP
  20. _TEXT    ends
  21. _DATA    segment word public 'DATA'
  22. _d@    label    byte
  23. _DATA    ends
  24. _BSS    segment word public 'BSS'
  25. _b@    label    byte
  26. _BSS    ends
  27.  
  28.  
  29. _TEXT    SEGMENT byte public 'CODE'
  30.     ASSUME cs:_TEXT
  31.  
  32. ;==============================================================================
  33. ; void SetPalette(unsigned char far *PalBuf);
  34. ;==============================================================================
  35. SPbuf    equ    [bp+ABASE]
  36.  
  37. PBEGIN    _SetPalette
  38.     push    bp
  39.     mov    bp,sp
  40.     push    ds
  41.     push    si
  42.  
  43.     lds    si,dword ptr SPbuf
  44.     mov    cx,256
  45.     xor    bx,bx
  46.     cld
  47.     mov    dx,3C8H
  48. sp010:
  49.     mov    al,bl
  50.     out    dx,al
  51.     inc    dx
  52.     lodsb
  53.     out    dx,al
  54.     lodsb
  55.     out    dx,al
  56.     lodsb
  57.     out    dx,al
  58.     dec    dx
  59.     inc    bx
  60.     loop    sp010
  61.  
  62.     pop    si
  63.     pop    ds
  64.     pop    bp
  65.     ret
  66. _SetPalette endp
  67.  
  68. ;==============================================================================
  69. ; void SetVGAmode(void);
  70. ;==============================================================================
  71. PBEGIN    _SetVGAmode
  72.     push    bp
  73.     mov    ax,13h
  74.     int    10h        ; Set 320x200x256
  75.     pop    bp
  76.     ret
  77. _SetVGAmode endp
  78.  
  79. ;==============================================================================
  80. ;
  81. ;==============================================================================
  82. PBEGIN    _inkey
  83.     mov    ah,1        ;see if key available
  84.     int    16h
  85.     jz    ink080        ;nope
  86.     xor    ax,ax
  87.     int    16h
  88.     jmp    short ink090
  89.  
  90. ink080:
  91.     xor    ax,ax
  92. ink090:
  93.     ret
  94. _inkey    endp
  95.  
  96. _TEXT    ENDS
  97.     END
  98.  
  99.