DS_TABLE.ASM 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 : Draw Shape Routines for library. *
  23. ;* *
  24. ;* File Name : DS_TABLE.ASM *
  25. ;* *
  26. ;* Programmer : Scott K. Bowen *
  27. ;* *
  28. ;* Start Date : August 20, 1993 *
  29. ;* *
  30. ;* Last Update : September 6, 1994 [IML] *
  31. ;* *
  32. ;* This module sets up a table of procedure addresses for combinations of *
  33. ;* NORMAL, HORZ_REV and SCALING flags. *
  34. ;*-------------------------------------------------------------------------*
  35. ;* Functions: *
  36. ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
  37. ;********************** Model & Processor Directives ************************
  38. IDEAL
  39. P386
  40. MODEL USE32 FLAT
  41. ;******************************** Includes *********************************
  42. INCLUDE "shape.inc"
  43. ;******************************** Equates **********************************
  44. ;*=========================================================================*/
  45. ;* The following are defines used to control what functions are linked *
  46. ;* in for Draw_Shape. *
  47. ;*=========================================================================*/
  48. USE_NORMAL EQU TRUE
  49. USE_HORZ_REV EQU TRUE
  50. USE_VERT_REV EQU TRUE
  51. USE_SCALING EQU TRUE
  52. ;---------------------------------------------------------------------------
  53. ;
  54. ; Use a macro to make code a little cleaner.
  55. ; The parameter varname is optional.
  56. ; Syntax to use macro is :
  57. ; WANT equ expression
  58. ; USE func [,varname]
  59. ; If the 'varname' is defined, a table declaration is created like:
  60. ; GLOBAL TableName:DWORD
  61. ; Then, the table entry is created:
  62. ; If WANT is true, the table entry is created for the given function:
  63. ; varname DD func
  64. ; If WANT is not TRUE, a Not_Supported entry is put in the table:
  65. ; varname DD Not_Supported
  66. ; The resulting tables look like:
  67. ;
  68. ; GLOBAL ExampTable:DWORD
  69. ; ExampTable DD routine1
  70. ; DD routine2
  71. ; DD routine3
  72. ; ...
  73. ; Thus, each table is an array of function pointers.
  74. ;
  75. ;---------------------------------------------------------------------------
  76. MACRO USE func, varname
  77. IFNB <varname>
  78. GLOBAL varname:DWORD
  79. ENDIF
  80. IF WANT
  81. varname DD func
  82. ELSE
  83. varname DD Not_Supported
  84. ENDIF
  85. ENDM
  86. ;---------------------------------------------------------------------------
  87. ; Data Segment Tables:
  88. ; This code uses the USE macro to set up tables of function addresses.
  89. ; The tables have the following format:
  90. ; Tables defined are:
  91. ; LSkipTable
  92. ; RSkipTable
  93. ; DrawTable
  94. ;---------------------------------------------------------------------------
  95. DATASEG
  96. ;---------------------------------------------------------------------------
  97. WANT equ <TRUE>
  98. USE Left_Skip, LSkipTable
  99. WANT equ <TRUE>
  100. USE Left_Reverse_Skip
  101. WANT equ <TRUE>
  102. USE Left_Skip
  103. WANT equ <TRUE>
  104. USE Left_Reverse_Skip
  105. WANT equ <USE_SCALING>
  106. USE Left_Scale_Skip
  107. WANT equ <USE_SCALING>
  108. USE Left_Scale_Reverse_Skip
  109. WANT equ <USE_SCALING>
  110. USE Left_Scale_Skip
  111. WANT equ <USE_SCALING>
  112. USE Left_Scale_Reverse_Skip
  113. ;---------------------------------------------------------------------------
  114. WANT equ <TRUE>
  115. USE Right_Skip, RSkipTable
  116. WANT equ <TRUE>
  117. USE Right_Reverse_Skip
  118. WANT equ <TRUE>
  119. USE Right_Skip
  120. WANT equ <TRUE>
  121. USE Right_Reverse_Skip
  122. WANT equ <USE_SCALING>
  123. USE Right_Scale_Skip
  124. WANT equ <USE_SCALING>
  125. USE Right_Scale_Reverse_Skip
  126. WANT equ <USE_SCALING>
  127. USE Right_Scale_Skip
  128. WANT equ <USE_SCALING>
  129. USE Right_Scale_Reverse_Skip
  130. ;---------------------------------------------------------------------------
  131. WANT equ <TRUE>
  132. USE Draw_Normal, DrawTable
  133. WANT equ <TRUE>
  134. USE Draw_Reverse
  135. WANT equ <TRUE>
  136. USE Draw_Normal
  137. WANT equ <TRUE>
  138. USE Draw_Reverse
  139. WANT equ <USE_SCALING>
  140. USE Draw_Scale
  141. WANT equ <USE_SCALING>
  142. USE Draw_Scale_Reverse
  143. WANT equ <USE_SCALING>
  144. USE Draw_Scale
  145. WANT equ <USE_SCALING>
  146. USE Draw_Scale_Reverse
  147. ;---------------------------------------------------------------------------
  148. ;---------------------------------------------------------------------------
  149. END
  150. ;************************** End of ds_table.asm ****************************