DELAY.CPP 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 A S S O C I A T E S **
  20. ***************************************************************************
  21. * *
  22. * Project Name : LIBRARY *
  23. * *
  24. * File Name : DELAY.C *
  25. * *
  26. * Programmer : Christopher Yates *
  27. * *
  28. * Last Update : 27 March, 1991 [CY] *
  29. * *
  30. *-------------------------------------------------------------------------*
  31. * Functions: *
  32. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  33. #include "wwstd.h"
  34. #include <timer.h>
  35. void Delay(int duration)
  36. {
  37. unsigned long count;
  38. TimerClass timer(BT_SYSTEM,TRUE);
  39. while (duration--) {
  40. count = timer.Time() + 1L;
  41. while (count >= timer.Time()) {
  42. ;
  43. }
  44. }
  45. #if(FALSE)
  46. while (duration--)
  47. Wait_Vert_Blank(VertBlank);
  48. #endif
  49. }
  50. #if(FALSE)
  51. void Vsync()
  52. {
  53. Wait_Vert_Blank(VertBlank);
  54. }
  55. #endif
  56.