Advertisement
Ham62

UpdateScreen.C

Aug 22nd, 2017
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.32 KB | None | 0 0
  1. extern void UpdateScreen(void);
  2. #pragma aux UpdateScreen =      \
  3.     "mov si, ScreenBuff"        \
  4.     "mov di, 00h"               \
  5.     "mov ax, [ScreenSeg]"       \
  6.     "mov es, ax"                \
  7.     "mov cx, SCREEN_SIZE"       \
  8.     "mov dx, 03DAh"  /* Port to read vblank status */ \
  9.                                 \
  10.     /* Check for reduced snow flag */ \
  11.     "cmp [ReduceCGASnow], 1"    \
  12.     "je _LessSnow"              \
  13.                                 \
  14.     /* Check for VSYNC flag */  \
  15.     "cmp [UseVSYNC], 1"         \
  16.     "jne _SkipSync"             \
  17.                                 \
  18.     "_blk:"                     \
  19.     "in al, dx"                 \
  20.     "test al, 8"                \
  21.     "jz _blk"                   \
  22.     "_SkipSync:"                \
  23.     "rep movsw"                 \
  24.     "jmp End"                   \
  25.                                 \
  26.     /* Reduced CGA snow routine */ \
  27.     "_LessSnow:"                \
  28.     "in al, dx"                 \
  29.     "test al, 9"                \
  30.     "jz _LessSnow"              \
  31.     "movsw"                     \
  32.     "movsw"                     \
  33.     "movsw"                     \
  34.     "movsw"                     \
  35.     "sub cx, 4"                 \
  36.     "jnz _LessSnow"             \
  37.     "End:"                      \
  38.     modify [ax cx dx si di es];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement