Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.0 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: misc.c
  3. *
  4. * Miscellaneous common routines.
  5. *
  6. * Copyright (c) 1992-1994 Microsoft Corporation
  7. *
  8. \**************************************************************************/
  9. #include "precomp.h"
  10. /******************************Public*Routine******************************\
  11. * VOID vDataPortOutB
  12. \**************************************************************************/
  13. VOID vDataPortOutB(
  14. PDEV* ppdev,
  15. VOID* pb,
  16. ULONG cj)
  17. {
  18. ULONG pixtrans = (ULONG) (ppdev->ioPix_trans);
  19. _asm {
  20. mov ecx, cj
  21. mov esi, pb
  22. mov edx, pixtrans
  23. rep outsb
  24. }
  25. }
  26. /******************************Public*Routine******************************\
  27. * VOID vDataPortOut
  28. \**************************************************************************/
  29. VOID vDataPortOut(
  30. PDEV* ppdev,
  31. VOID* pw,
  32. ULONG cw)
  33. {
  34. ULONG pixtrans = (ULONG) (ppdev->ioPix_trans);
  35. _asm {
  36. mov ecx, cw
  37. mov esi, pw
  38. mov edx, pixtrans
  39. rep outsw
  40. }
  41. }
  42. /******************************Public*Routine******************************\
  43. * VOID vDataPortIn
  44. \**************************************************************************/
  45. VOID vDataPortIn(
  46. PDEV* ppdev,
  47. VOID* pw,
  48. ULONG cw)
  49. {
  50. ULONG pixtrans = (ULONG) (ppdev->ioPix_trans);
  51. _asm {
  52. mov ecx, cw
  53. mov edi, pw
  54. mov edx, pixtrans
  55. rep insw
  56. }
  57. }
  58. /******************************Public*Routine******************************\
  59. * VOID vResetClipping
  60. \**************************************************************************/
  61. VOID vResetClipping(
  62. PDEV* ppdev)
  63. {
  64. IO_FIFO_WAIT(ppdev, 4);
  65. IO_ABS_SCISSORS_L(ppdev, 0);
  66. IO_ABS_SCISSORS_T(ppdev, 0);
  67. IO_ABS_SCISSORS_R(ppdev, ppdev->cxMemory - 1);
  68. IO_ABS_SCISSORS_B(ppdev, ppdev->cyMemory - 1);
  69. }
  70. /******************************Public*Routine******************************\
  71. * VOID vSetClipping
  72. \**************************************************************************/
  73. VOID vSetClipping(
  74. PDEV* ppdev,
  75. RECTL* prclClip) // In relative coordinates
  76. {
  77. LONG xOffset;
  78. LONG yOffset;
  79. ASSERTDD(prclClip->left + ppdev->xOffset >= 0,
  80. "Can't have a negative left!");
  81. ASSERTDD(prclClip->top + ppdev->yOffset >= 0,
  82. "Can't have a negative top!");
  83. IO_FIFO_WAIT(ppdev, 4);
  84. xOffset = ppdev->xOffset;
  85. IO_ABS_SCISSORS_L(ppdev, prclClip->left + xOffset);
  86. IO_ABS_SCISSORS_R(ppdev, prclClip->right - 1 + xOffset);
  87. ASSERTDD(prclClip->right + xOffset <= 1024,
  88. "Exceeded right scissors bounds");
  89. yOffset = ppdev->yOffset;
  90. IO_ABS_SCISSORS_T(ppdev, prclClip->top + yOffset);
  91. IO_ABS_SCISSORS_B(ppdev, prclClip->bottom - 1 + yOffset);
  92. ASSERTDD(prclClip->bottom + yOffset <= 1024,
  93. "Exceeded bottom scissors bounds");
  94. }