SHAKESCR.ASM 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ;
  2. ; Command & Conquer Red Alert(tm)
  3. ; Copyright 2025 Electronic Arts Inc.
  4. ;
  5. ; This program is free software: you can redistribute it and/or modify
  6. ; it under the terms of the GNU General Public License as published by
  7. ; the Free Software Foundation, either version 3 of the License, or
  8. ; (at your option) any later version.
  9. ;
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ; GNU General Public License for more details.
  14. ;
  15. ; You should have received a copy of the GNU General Public License
  16. ; along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ;
  18. ;***************************************************************************
  19. ;** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
  20. ;***************************************************************************
  21. ;* *
  22. ;* Project Name : Westwood Library *
  23. ;* *
  24. ;* File Name : SHAKESCR.ASM *
  25. ;* *
  26. ;* Programmer : Joe L. Bostic *
  27. ;* *
  28. ;* Start Date : August 19, 1993 *
  29. ;* *
  30. ;* Last Update : February 10, 1995 [BWG] *
  31. ;* *
  32. ;*-------------------------------------------------------------------------*
  33. ;* Functions: *
  34. ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
  35. IDEAL
  36. P386
  37. MODEL USE32 FLAT
  38. GLOBAL Shake_Screen :NEAR
  39. CODESEG
  40. ;***********************************************************
  41. ; SHAKE_SCREEN
  42. ;
  43. ; VOID Shake_Screen(int shakes);
  44. ;
  45. ; This routine shakes the screen the number of times indicated.
  46. ;
  47. ; Bounds Checking: None
  48. ;
  49. ;*
  50. PROC Shake_Screen C near
  51. USES ecx, edx
  52. ARG shakes:DWORD
  53. mov ecx,[shakes]
  54. ;;; push es
  55. ;;; mov ax,40h
  56. ;;; mov es,ax
  57. ;;; mov dx,[es:63h]
  58. ;;; pop es
  59. mov eax,[0463h] ; get CRTC I/O port
  60. mov dx,ax
  61. add dl,6 ; video status port
  62. ??top_loop:
  63. ??start_retrace:
  64. in al,dx
  65. test al,8
  66. jz ??start_retrace
  67. ??end_retrace:
  68. in al,dx
  69. test al,8
  70. jnz ??end_retrace
  71. cli
  72. sub dl,6 ; dx = 3B4H or 3D4H
  73. mov ah,01 ; top word of start address
  74. mov al,0Ch
  75. out dx,al
  76. xchg ah,al
  77. inc dx
  78. out dx,al
  79. xchg ah,al
  80. dec dx
  81. mov ah,040h ; bottom word = 40 (140h)
  82. inc al
  83. out dx,al
  84. xchg ah,al
  85. inc dx
  86. out dx,al
  87. xchg ah,al
  88. sti
  89. add dl,5
  90. ??start_retrace2:
  91. in al,dx
  92. test al,8
  93. jz ??start_retrace2
  94. ??end_retrace2:
  95. in al,dx
  96. test al,8
  97. jnz ??end_retrace2
  98. ??start_retrace3:
  99. in al,dx
  100. test al,8
  101. jz ??start_retrace3
  102. ??end_retrace3:
  103. in al,dx
  104. test al,8
  105. jnz ??end_retrace3
  106. cli
  107. sub dl,6 ; dx = 3B4H or 3D4H
  108. mov ah,0
  109. mov al,0Ch
  110. out dx,al
  111. xchg ah,al
  112. inc dx
  113. out dx,al
  114. xchg ah,al
  115. dec dx
  116. mov ah,0
  117. inc al
  118. out dx,al
  119. xchg ah,al
  120. inc dx
  121. out dx,al
  122. xchg ah,al
  123. sti
  124. add dl,5
  125. loop ??top_loop
  126. ret
  127. ENDP Shake_Screen
  128. ;***********************************************************
  129. END
  130.