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 C 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. ret
  54. mov ecx,[shakes]
  55. ;;; push es
  56. ;;; mov ax,40h
  57. ;;; mov es,ax
  58. ;;; mov dx,[es:63h]
  59. ;;; pop es
  60. mov eax,[0463h] ; get CRTC I/O port
  61. mov dx,ax
  62. add dl,6 ; video status port
  63. ??top_loop:
  64. ??start_retrace:
  65. in al,dx
  66. test al,8
  67. jz ??start_retrace
  68. ??end_retrace:
  69. in al,dx
  70. test al,8
  71. jnz ??end_retrace
  72. cli
  73. sub dl,6 ; dx = 3B4H or 3D4H
  74. mov ah,01 ; top word of start address
  75. mov al,0Ch
  76. out dx,al
  77. xchg ah,al
  78. inc dx
  79. out dx,al
  80. xchg ah,al
  81. dec dx
  82. mov ah,040h ; bottom word = 40 (140h)
  83. inc al
  84. out dx,al
  85. xchg ah,al
  86. inc dx
  87. out dx,al
  88. xchg ah,al
  89. sti
  90. add dl,5
  91. ??start_retrace2:
  92. in al,dx
  93. test al,8
  94. jz ??start_retrace2
  95. ??end_retrace2:
  96. in al,dx
  97. test al,8
  98. jnz ??end_retrace2
  99. ??start_retrace3:
  100. in al,dx
  101. test al,8
  102. jz ??start_retrace3
  103. ??end_retrace3:
  104. in al,dx
  105. test al,8
  106. jnz ??end_retrace3
  107. cli
  108. sub dl,6 ; dx = 3B4H or 3D4H
  109. mov ah,0
  110. mov al,0Ch
  111. out dx,al
  112. xchg ah,al
  113. inc dx
  114. out dx,al
  115. xchg ah,al
  116. dec dx
  117. mov ah,0
  118. inc al
  119. out dx,al
  120. xchg ah,al
  121. inc dx
  122. out dx,al
  123. xchg ah,al
  124. sti
  125. add dl,5
  126. loop ??top_loop
  127. ret
  128. ENDP Shake_Screen
  129. ;***********************************************************
  130. END