Source code of Windows XP (NT5)
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.

124 lines
4.3 KiB

  1. ;***************************************************************************
  2. ; *
  3. ; Copyright (C) 1983,1984 by Microsoft Inc. *
  4. ; *
  5. ;***************************************************************************
  6. ; Macros for disabling and restoring hardware interrupt enable flag
  7. ;
  8. ; The LeaveCrit macro has been updated for the mask problem on
  9. ; the 80286 processor.
  10. include vint.inc
  11. EnterCrit MACRO
  12. pushf
  13. FCLI
  14. ENDM
  15. LeaveCrit macro reg ;;this macro will restore the state of
  16. ifnb <reg> ;;the interrupt flag to what is was
  17. pop reg&x ;;before EnterCrit. All other flags
  18. test reg&h, 2 ;;are discarded.
  19. jz @f
  20. FSTI
  21. @@:
  22. else
  23. push bp
  24. mov bp, sp
  25. test byte ptr [bp+3], 2
  26. jz @f
  27. FSTI
  28. @@:
  29. pop bp
  30. popf
  31. endif
  32. endm
  33. if 0
  34. POPFF equ <LeaveCrit>
  35. LeaveCrit MACRO
  36. POPFF
  37. ENDM
  38. endif
  39. POPFF MACRO ;;this macro will restore ALL flags,
  40. local a ;;EXCEPT the interrupt flag, to
  41. jmp $+3 ;;their previous state
  42. a label near
  43. iret
  44. push cs
  45. call a
  46. ENDM
  47. ;***************************************************************************
  48. ; *
  49. ; Inquire data structures for Timer, Keyboard, Mouse and Cursor modules *
  50. ; *
  51. ;***************************************************************************
  52. TIMERINFO STRUC
  53. tiResolution DD 0 ; #microseconds each timer tick
  54. TIMERINFO ENDS
  55. KBINFO STRUC
  56. kbRanges DB 4 dup (0) ; Far East ranges for KANJI
  57. kbStateSize DW 0 ; #bytes of state info maintained by TOASCII
  58. KBINFO ENDS
  59. MOUSEINFO STRUC
  60. msExists DB 0 ; true => mouse exists
  61. msRelative DB 0 ; true => relative coordinate
  62. msNumButtons DW 0 ; number of buttons on the mouse
  63. msRate DW 0 ; maximum rate of mouse input events
  64. msXThresh DW 0 ; threshold before acceleration
  65. msYThresh DW 0 ;
  66. msXRes DW 0 ; x resolution
  67. msYRes DW 0 ; y resolution
  68. MOUSEINFO ENDS
  69. CURSORINFO STRUC
  70. dpXRate DW 0 ; horizontal mickey/pixel ratio
  71. dpYRate DW 0 ; vertical mickey/pixel ratio
  72. CURSORINFO ENDS
  73. ;***************************************************************************
  74. ; *
  75. ; Cursor data structure passed to OEM routines. Defines a graphics display*
  76. ; cursor in terms of a hotspot, an AND mask and an XOR mask. The hot *
  77. ; spot defines the pixel within the cursor that is the cursor is "pointing"*
  78. ; to. So when displaying a cursor at location X,Y the pixel that *
  79. ; is the hot spot should be painted at that X,Y coordinate. The "shape" *
  80. ; of the cursor is defined by two pixel masks. The first mask is ANDed *
  81. ; with the bits in the display bitmap and the second mask is XORed with *
  82. ; the result to determine the bits that will be placed in the display *
  83. ; bitmap. The bits for the masks are in the byte array that begins *
  84. ; at the csBits field, with the AND mask bits first, followed by the *
  85. ; XOR mask bits. The csWidthBytes field is the width of ONE mask, in *
  86. ; bytes. Currently, MS-WIN will only generate cursors whose width and *
  87. ; height are both 16. *
  88. ; *
  89. ;***************************************************************************
  90. cursorShape STRUC
  91. csHotX DW 0
  92. csHotY DW 0
  93. csWidth DW 0
  94. csHeight DW 0
  95. csWidthBytes DW 0
  96. csColor DW 0
  97. ; Beginning of an array of bytes that contain the bits for the AND and
  98. ; XOR masks. The first csHeight * csWidthBytes bytes contain the bits
  99. ; for the AND mask and the next csHeight * csWidthBytes bytes contain
  100. ; the bits for the XOR mask.
  101. ;csBits DB 2*2*16 DUP (?)
  102. cursorShape ENDS