struct.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* $Id$
  2. * MegaZeux
  3. *
  4. * Copyright (C) 1996 Greg Janson
  5. * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. /* Structure definitions */
  22. #ifndef __STRUCT_H
  23. #define __STRUCT_H
  24. struct EMSStorage {
  25. unsigned int handle;
  26. unsigned int page;
  27. };
  28. typedef struct EMSStorage EMSStorage;
  29. union bOffset {//Not applicable for nowhere, current, or tempfile
  30. unsigned char far *mem;//Memory storage
  31. long offset;//Within a group file
  32. EMSStorage EMS;//EMS
  33. };
  34. typedef union bOffset bOffset;
  35. struct Robot {
  36. unsigned int program_length;
  37. unsigned int program_location;//Offsetted from start of global robot memory
  38. char robot_name[15];
  39. unsigned char robot_char;
  40. unsigned int cur_prog_line;//Location of start of line (pt to FF for none)
  41. unsigned char pos_within_line;//Countdown for GO and WAIT
  42. unsigned char robot_cycle;
  43. unsigned char cycle_count;
  44. unsigned char bullet_type;
  45. unsigned char is_locked;
  46. unsigned char can_lavawalk;//Can always travel on fire
  47. unsigned char walk_dir;//1-4, of course
  48. unsigned char last_touch_dir;//1-4, of course
  49. unsigned char last_shot_dir;//1-4, of course
  50. int xpos,ypos;//Used for IF ALIGNED "robot", THISX/THISY, PLAYERDIST,
  51. //HORIZPLD, VERTPLD, and others. Keep udpated at all
  52. //times. Set to -1/-1 for global robot.
  53. char status;//0=Un-run yet, 1=Was run but only END'd, WAIT'd, or was
  54. //inactive, 2=To be re-run on a second robot-run due to a
  55. //rec'd message
  56. int blank;//Always 0
  57. char used;//Set to 1 if used onscreen, 0 if not
  58. int loop_count;//Loop count. Loops go back to first seen LOOP
  59. //START, loop at first seen LOOP #, and an ABORT
  60. //LOOP jumps to right after first seen LOOP #.
  61. };
  62. typedef struct Robot Robot;
  63. struct Scroll {
  64. unsigned int num_lines;
  65. unsigned int mesg_location;//Offset into global robot memory
  66. unsigned int mesg_size;
  67. char used;//Set to 1 if used onscreen, 0 if not
  68. };
  69. typedef struct Scroll Scroll;
  70. struct Counter {
  71. char counter_name[15];
  72. int counter_value;
  73. };
  74. typedef struct Counter Counter;
  75. struct Sensor {
  76. char sensor_name[15];
  77. unsigned char sensor_char;
  78. char robot_to_mesg[15];
  79. char used;//Set to 1 if used onscreen, 0 if not
  80. };
  81. typedef struct Sensor Sensor;
  82. #endif