home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 421_01 / global.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-05  |  10.6 KB  |  386 lines

  1. // GLOBAL DEFINITIONS
  2.  
  3. #ifndef _GLOBAL_H
  4. #define _GLOBAL_H
  5.  
  6. // DEBUG
  7.  
  8. //#define SBSUPPORT // 1 - whether SB should be supported
  9. #define FILLMASKOK // 0 - make fillmask? (not currently supported)
  10. #define HISCOREFILTER  // 1 - should homemade-levels give hiscores?
  11. #define QUICK // 0 - skips some menus
  12. //#define BLANKHISCORE // 0 - blanks hiscore on initialization
  13. //#define REALLIMITS // 1 - whether the player should be limited to levels
  14.     // he has completed
  15. #define ALLOWHOMEMADE // 0 - should homemade levels be allowed in
  16.     // linkup-game?
  17. //#define STRIPPED // 0 - no undo feature in editor
  18. //#define UNFINISHED // 0
  19. //#define NOMODEM    // 0
  20. //#define BOSS // 0
  21. //#define JOYDEFAULT // 0
  22. #define DEBUG // 0
  23. #define FREEZE asm push es;asm pusha; getch(); asm popa; asm pop es
  24.  
  25. #define ALIGNX // 1 - should the player automatically be x-aligned
  26. #define HANGON // ? - is it possible to eat blocks suspended in thin air?
  27. #define EASYFLYING // ? - should jetpack hang still in the air?
  28. #define COPYPLAYER // ? - should the duplicators copy the players?
  29.  
  30. // FIXED DEFINES ////////////////////////////////////////////////////////////
  31.  
  32. #define VGAINT         geninterrupt(0x10)
  33. #define DOSINT     geninterrupt(0x21)
  34. #define MOUSEINT     geninterrupt(0x33)
  35.  
  36. #define VERBIT     1024
  37. #define MAXKEYS         128
  38.  
  39. #define XRES       320
  40. #define YRES       240
  41.  
  42. //#define NPA        "That's all folks!      " // 23
  43.  
  44. #define GRAFOFF    (10*XRES/4)    // default start of visible page (vram)
  45.  
  46. #define READ       1
  47. #define WRITE      2
  48.  
  49. #define ON                 1
  50. #define OFF        0
  51.  
  52. #define AC_INDEX        0x03c0        // VGA-registers
  53. #define MISC_OUTPUT     0x03c2
  54. #define SC_INDEX        0x03c4
  55. #define GC_INDEX                0x03ce
  56. #define CRTC_INDEX      0x03d4
  57. #define INPUT_STATUS_0  0x03da
  58. #define MAP_MASK                0x02
  59. #define READ_MAP        0x04
  60. #define BIT_MASK                0x08
  61.  
  62. #define LCTRL    100
  63. #define RCTRL    101
  64. #define LALT     102
  65. #define RALT     103
  66. #define NUMON    120
  67. #define CAPSON   121
  68. #define SCROLLON 122
  69. #define INSON    123
  70.  
  71. #define _LSHIFT  0x02
  72. #define _CAPSON  0x40
  73. #define _LCTRL   0x0100
  74. #define _LALT    0x0200
  75. #define _RCTRL   0x0400
  76. #define _RALT    0x0800
  77. #define _NUMON   0x20
  78. #define _SCROLLON 0x40
  79. #define _INSON   0x80
  80.  
  81. #define GAMEPORT                0x0201        // joystick-port
  82.  
  83. // ALTERABLE PARAMETERS /////////////////////////////////////////////////////
  84.  
  85. // BLOCKS/PLAYFIELD
  86.  
  87. // (also remember to change world_C::update()!)
  88.  
  89. #define BLOCKX         24                         // width of blocks (pixels)
  90. #define BLOCKY     24                            // height of blocks (pixels)
  91.  
  92. #define PLAYX      240                         // width of playfield (pixels)
  93. #define PLAYY             240                        // height of playfield (pixels)
  94. #define COOKIE     101202303
  95.  
  96. #define PWIDTH     (PLAYX/BLOCKX) // width of playfield (blocks)
  97. #define PHEIGHT    (PLAYY/BLOCKY) // height of playfield (blocks)
  98.  
  99. #define PLAYSTART  0                            // upper left corner of playfield
  100.                                                                     // (adress in vram)
  101. #define PATTERNS     10                            // # of different explosion-patterns
  102.  
  103. // TEXTSCREEN
  104.  
  105. // (also remember to change text_C::update()!)
  106.  
  107. //#define FLIPTEXT
  108. #define DETPOS 50000
  109.  
  110. #define BKGROUND   0                            // Background color
  111. #define HILITE         40                            // Color of frame around selected func.
  112.  
  113. #define FONTX      8                          // width of font (pixels)
  114. #define FONTY      8              // height of font (pixels)
  115. #define TEXTX      40             // width of text page (chars)
  116. #define TEXTY      30             // height of text page (chars)
  117.  
  118. #define TEXTPAGES     5              // max # of text windows on top of each
  119.                                                                     // other (each using 2400b)
  120.  
  121. #define SPC              85
  122. #define BLANK             (ADRSMALL+16*SPC)    // ptr to blank char (vram)
  123. #define ADRFRAME   21360                    // adress of frame blocks (vram)
  124. #define NUMFRAME    20
  125. #define ADRSMALL   (ADRFRAME+16*NUMFRAME)
  126.                                                                     // adress of small letters (vram)
  127. #define NUMSMALL   178            // total number of small letters
  128. #define NUMTRI         46                            // # of letters available in 3 colors
  129. #define ADRLARGE   (ADRSMALL+16*NUMSMALL)
  130.                                                                     // adress of large letters (vram)
  131. #define NUMLARGE   232                        // Note! this is the number of SMALL
  132.                                                                     // letters!
  133. #define ADRPL1         (ADRLARGE)     // Note! These large letters are loaded
  134.                                                                     // into the same position as the heroes'
  135.                                                                     // bmp.
  136.                                                                     // start of animation player 1 (vram)
  137. #define LENPL1       6912                        // # of quadruples in player #1's animation
  138. #define ADRPL2         ((long)ADRPL1+LENPL1)
  139. #define LENPL2       6912                        // # of quarduples in player #2's animation
  140.                                                                     // start of animation player 2 (vram)
  141. #define ADRMENUIKON (ADRLARGE+16*NUMLARGE+25600/4)
  142.                                                                     // start of big icons
  143. #define NUMMENUIKON 225                        // # of 8x8 blocks building the big icons
  144.  
  145. #define ETCH            ((long)ADRPL2+LENPL2) // Where the players are
  146.                                                                     // manipulated
  147. #define POOL             ((long)ETCH+2*576)
  148.                                                                     // adress in vram of first block. From here
  149.                                                                     // on, all vram is occupied by the bmp
  150.                                                     // for the blocks
  151. #define POOLEND    65534L
  152.  
  153. // WORLD
  154.  
  155. #define WORLDX     40             // width of world (squares)
  156. #define WORLDY     30             // height of world (squares). Both of
  157.                                                                     // these include the surrounding wall
  158.  
  159. #define WORLDS         5                            // # of worlds, total
  160. #define ZONES             5                            // # of zones/world
  161. #define LEVELS         3                            // # of levels/zone
  162. #define MAXLEVEL     (WORLDS*ZONES*LEVELS)
  163.  
  164. // FILES
  165.  
  166. #define FBUFFER    512                        // size of filebuffer (bytes)
  167. #define CONFIGNAME "B2.CFG"                // name of config-file
  168. #define DATANAME     "DATA\\DATA.000" // default filename, data
  169. #define DATANAMEL  13
  170. #define LEVELNAME  "PREDEF\\1PLAYER\\PREDEF.000"
  171.                                                                     // default filename, predefined levels
  172. #define LEVELNAMEL 25
  173. #define LEVELCHOOSE 7
  174.  
  175. #define CUSTOMNAME "HOMEMADE\\1PLAYER\\HOMEMADE.000"
  176.                                                                     // default filename, customized levels
  177. #define CUSTOMNAMEL 29
  178. #define CUSTOMCHOOSE 9
  179.  
  180. // MISC
  181.  
  182. #define WALK             1              // modes of movement
  183. #define FLY        2
  184.  
  185. #define SAVE             1
  186. #define RESTORE    2
  187. #define NUMNAMES   10                         // # of registered players one
  188.                                                                     // one/two-player
  189.  
  190. #define LEVMENUX   18
  191. #define LEVMENUY   14
  192. #define LEVNAMELEN 15                            // length of name of the level
  193.  
  194. #define LIVES      5
  195.  
  196. #define HINAMELEN     12                            // characters in name on hiscore-list
  197. #define LISTLEN         7                            // # of entries on each of the hiscore-
  198.                                                                     // lists
  199. #define EXTRALEN     70                            // # of extra bytes saved with each level
  200. #define MAXMIX         75                          // max # of differen bmp/bitcode comb.
  201.                                                                     // on a level
  202. #define SEVENSIXEIGHT    768                    // to be 0 when colors aren't included
  203.                                                                     // in minidata
  204. #define MAXACT         (7*12)
  205.  
  206. // MOUSE
  207.  
  208. #define MAXBUTTON  130
  209. #define MAXAREA         15
  210.  
  211. #define MOUSEDELAY 11
  212. #define MOUSEX     18             // width of mouse ptr (pixels)
  213. #define MOUSEY     18                            // height of mouse ptr (pixels)
  214. #define MAXPIXELS  324                      // maximum # of pixels in any ptr
  215. #define SAFEPTR    20800          // place to make a copy of the area behind
  216.                                                                     // the mouse (vram)
  217. #define SAFEFRAME  21200          // place to make a copy of the area behind
  218.                                                                     // the frame (vram)
  219. #define NUMPTRS         15
  220.  
  221. #define MLINE             97                            // above this line wait...
  222. #define MPAUSE         9                            // ... MPAUSE ms with mouse removal
  223. #define LBUTTON    2
  224. #define RBUTTON    1
  225.  
  226. #define NONE             -1
  227. #define DEFAULT    0
  228. #define ARROW      1
  229.  
  230. // PLAYERS
  231.  
  232. #define ONEPLAYER  0
  233. #define TWOPLAYER  1
  234. #define LINKUP     2
  235.  
  236. #define KEYBOARD1  1                            // used with player_C::player_C(int)
  237. #define KEYBOARD2  2
  238. #define JOYSTICK1  3
  239. #define JOYSTICK2  4
  240. #define MODEM      5
  241. #define PLAYBACK   6
  242.  
  243. #define PREDEF     0
  244. #define HOMEMADE   1
  245.  
  246. // LEVEL-EDITOR
  247.  
  248. #define DRAW       0                             // modes of operation
  249. #define CLR                 1
  250. #define CUT1       90
  251. #define CUT2             91
  252. #define CUT3       92
  253. #define CUT4       93
  254. #define FILL       100
  255. #define COPY1      120
  256. #define COPY2      121
  257. #define COPY3             122
  258. #define COPY4      123
  259. #define TEST             200
  260.  
  261. // KEYS
  262.  
  263. #define NUMKEYS    6             // # of keys pr. player (2=shared keys)
  264.  
  265. #define KEYUP      0
  266. #define KEYRIGHT   1
  267. #define KEYDOWN    2
  268. #define KEYLEFT    3
  269. #define KEYPUSH    4
  270. #define KEYACT     5
  271. #define KEYSAVE    0
  272. #define KEYRESTART 1
  273. #define KEYQUIT    2
  274. #define KEYAUTO    3
  275. #define KEYSOUND   4
  276.  
  277. // ERRORS
  278.  
  279. #define OUTOFMEM   0
  280. #define NOVGA      1
  281. #define FILEERROR  2
  282. #define NO386      3
  283.  
  284. // COLORS
  285.  
  286. #define FRAME_COL  1
  287.  
  288. // FLAGS
  289.  
  290. #define Ifl                 64
  291. #define Vfl        512
  292. #define Dfl                 128
  293. #define Mfl                 32768
  294. #define Hfl                 4096
  295. #define Ffl                 16384
  296. #define Sfl                 2048
  297.  
  298. #define NUMMINI         (264/2)                // # of miniature blocks (half the size of
  299.                                                                     // DATA\DATA.113 in bytes)
  300.  
  301. // BLOCKS
  302.  
  303. #define MAXBLOCKS  2996                        // total # of entries in 'trans'. Static/
  304.                                                                     // dynamic things count as 1/41
  305. #define TOTALBLOCKS 540                        // total # of blocks. Dynamic things
  306.                                                                     // (like stones) count as ONE.
  307. #define EDITBLOCKS 90              // max # of blocks to place in the level-
  308.                                                                     // editor
  309.  
  310. #define AIR                 576                        // offset into 'trans', where the
  311. #define WALL             588                  // vram-ptr and width is given
  312. #define    EARTH             582
  313. #define DIA1BMP
  314. #define TUBBMP0 5484
  315. #define TUBBMP1 5526
  316.  
  317. #define BITAIR     0x9800                    // bitwise codes
  318. #define BITWALL    0xa000
  319. #define BITEARTH   0xb800
  320. #define TIMEBMP    15588
  321. #define TIMEBIT         0x1c07
  322.  
  323. #define BITAIREX     0x0826
  324. #define BMPAIREX   1134
  325. #define BITDIAEX   0x0806
  326. #define BMPDIAEX   1188
  327. #define BITDIAEX2  0x0806
  328. #define BMPDIAEX2  1248
  329. #define BITSTONEX  0x0806
  330. #define BMPSTONEX  0
  331. #define PLAYERBIT  (0x2d07 | Vfl)
  332.  
  333. // SOUND
  334.  
  335. #define BEEPER         0
  336. #define SBLASTER     1
  337. #define SILENCE    2
  338.  
  339.  
  340. // GAMEPLAY
  341.  
  342. #define LEAPHEIGHT 2
  343. #define MAXLEAP    5
  344. #define SPEEDTIMER 300
  345. #define RADARTIMER 1500
  346. #define STONEFAC   28
  347. #define FUELAMOUNT 25
  348. #define FUELFAC    65l
  349.  
  350. // 'SCROLLTEXT'
  351.  
  352. #define LEFT             0
  353. #define CENTER     1
  354. #define INITSCROLL 2
  355. #define ENDSCROLL  3
  356.  
  357. // SCORES
  358.  
  359. #define QSCORE1    25
  360. #define QSCORE2    50
  361. #define QSCORE3    100
  362. #define BONUSSTEP  10
  363. #define DIASCORE     1
  364. #define GREENSCORE 3
  365.  
  366. // TYPEDEFS
  367.  
  368. #ifdef __LARGE
  369. typedef unsigned char near byte;
  370. typedef unsigned int near word;
  371. #else
  372. typedef unsigned char byte;
  373. typedef unsigned int word;
  374. #endif
  375. typedef void (* func0)(void);
  376.  
  377. // Definert av j¢rn
  378.  
  379. #define FALSE 0
  380. #define TRUE !FALSE
  381.  
  382. typedef int boolean;
  383. typedef unsigned int uint;
  384.  
  385. #endif
  386.