filef200.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. File format for the .MZX world file (w/o password protection)
  2. -----------------------------------
  3. This file format is for version 2.00. No attempt at compatibility with
  4. version 1.0? is made within the format. Megazeux version 2.00 will,
  5. however, recognize and load version 1.0? .MZX files.
  6. Byte(s) Is
  7. 00-24 Title of game (name of first board) w/terminating null. Padded
  8. with junk.
  9. 25 Protection method (0=none, 1=no-save/test, 2=no-edit, 3=total)
  10. If not a 0, followed by a fifteen character password
  11. (encrypted) The rest of the file, after the "MZ2", is entirely
  12. encrypted.
  13. 26-28 The letters "MZ2". If the last letter is an X, this is a ver
  14. 1.0? file. If the last letter is anything else, it is a more
  15. recent, incompatible version file. 3-9 will represent versions
  16. 3.00 to 9.00, and A-Z for anything after that.
  17. 29-3612 The character set (14 bytes per character, 256 characters)
  18. Each character is 14 bytes, from the top row to the bottom
  19. row, one byte per pixel row.
  20. 3613-4067 IdChars array (455 bytes) This is the info in Global Chars,
  21. as well as anything that can be edited with CHANGE CHAR ID.
  22. 4068-4157 The SIX status counters, IE those counters shown on the
  23. status screen. Each is 15 chars long, including a terminating
  24. null. Padded with junk.
  25. 4158 Color of edge border during play.
  26. 4159 Starting board number.
  27. 4160 Board for end game. (255 for no board)
  28. 4161 Board for death. (255 to restart screen, 254 for same pos)
  29. 4162-4163 X position for end game.
  30. 4164-4165 Y position for end game.
  31. 4166 1 if game over sfx are played.
  32. 4167-4168 X position for death.
  33. 4169-4170 Y position for death.
  34. 4171-4172 Starting number of lives. (word)
  35. 4173-4174 Limit to lives. (word)
  36. 4175-4176 Starting amount of health. (word)
  37. 4177-4178 Limit to health. (word)
  38. 4179 1 if enemies can hurt each other, 0 if not.
  39. 4180 1 if all messages and projectiles are cleared between screens.
  40. 4181 1 if the game is only playable via a robot SWAP WORLD command.
  41. 4182-4229 Palette- colors 0-15, R G B per. RGB are from 0 to 63.
  42. 4230-4233 Position within file of global robot.
  43. 4234 Code- 0 means SFXs follow. 1-150 means use normal SFX and this
  44. number is equal to the number of boards.
  45. SFXs- 50 of them (0-49) Each is any length up to 68, preceded by
  46. a length byte (1-69) of the string w/null termination. Normal
  47. SFX format. The very first two bytes is a WORD of how long
  48. this entire section is, not including the first WORD. After
  49. this section is a number for the number of boards.
  50. 4235-???? Per board- 25 char title, including null terminator. Padded
  51. with junk.
  52. ????-???? Per board- Length of board in bytes (dword) and position of
  53. board within file. (byte number, dword)
  54. At location of board- The board itself. (see .MZB files, exactly the same)
  55. At location of global robot- The robot itself. (See .MZB files)
  56. A board of 0 length is a deleted board and has junk at it's "position
  57. within the file".
  58. Format for a .MZB board file
  59. ----------------------------
  60. This file format is for version 2.00. No attempt at compatibility with
  61. version 1.0? is made within the format. Megazeux version 2.00 will,
  62. however, recognize and load version 1.0? .MZB files.
  63. Note that INTERNAL storage of boards (other than the current board) is
  64. very similar except there the four id bytes at the start are not present
  65. and the board name is not repeated at the end.
  66. Bytes 0-3: An 0FFh, followed by the string "MB2" (not present in .MZX and
  67. .SAV files)
  68. Byte 4: 0-4 for overall sizing of board- 60x166,80x125,100x100,200x50,
  69. or 400x25.
  70. Then a byte code- if it is 0, it signifies that an overlay is present. It
  71. is followed by the overlay mode as a byte (1=normal, 2=static, 3=transparent)
  72. and the overlay, RLE2 encoded, and the overlay colors, RLE2 encoded. Blank
  73. spots in the overlay are spaces (32) of any color. The overlay is the same
  74. size of the board. This is followed as normal by the level ids, etc.
  75. If the byte is NOT 0, it is the first encoded byte of the level ids, as
  76. seen below.
  77. Next- Level ids, RLE2 encoded.
  78. Then- Level colors, RLE2 encoded.
  79. Then- Level params, RLE2 encoded.
  80. Then- Ids under stuff, RLE2 encoded.
  81. Then- Colors of ids under stuff, RLE2 encoded.
  82. Last- Params of ids under stuff, RLE2 encoded.
  83. Level id/color/param is a number representing an object, a number for it's
  84. color, (bk and fg) and a number representing it's stats. (IE robot id, or
  85. enemy stats, or custom chars, or passage destination, etc) These are all
  86. bytes. The "under stuff" is for things beneath other things, like floors and
  87. carpets. All six sets are RLE2 encoded, a simple compression method. The
  88. method works as follows- The first word is the x size (of the board) and the
  89. second word is the y size. Then the actual data follows- Read a byte. If the
  90. MSB (+128) is NOT set, then it is that byte. Otherwise, reset the MSB to get
  91. the number of times to repeat the next byte. This is called a run. Single
  92. bytes of values over 127 are represented as a run of 1. Runs can wrap around
  93. lines. The board is over when X * Y bytes have been recovered.
  94. After board design-
  95. 00-12 Name of default MOD file, w/extension and null terminator.
  96. Padded with junk.
  97. 13 X position of upper left corner of the viewport.
  98. 14 Y position of upper left corner of the viewport.
  99. 15 X size of the viewport.
  100. 16 Y size of the viewport.
  101. 17 1 if you can shoot here, 0 otherwise.
  102. 18 1 if you can bomb here, 0 otherwise.
  103. 19 1 if fire burns through brown things, 0 otherwise.
  104. 20 1 if fire burns through spaces, 0 otherwise.
  105. 21 1 if fire burns through fakes, 0 otherwise.
  106. 22 1 if fire burns through trees, 0 otherwise.
  107. 23 Code for what an explosion leaves- 0 for nothing, 1 for ash,
  108. 2 for fire.
  109. 24 1 if you can't save here, 2 if you can only save on a sensor,
  110. 0 for normal saving.
  111. 25 0 if forest becomes empty, 1 if forest becomes floor.
  112. 26 1 if you collect bombs normally, 0 if they automatically light.
  113. 27 1 if fire burns forever, 0 otherwise.
  114. 28-31 Board numbers for boards to the N S E and W. 255 for no board.
  115. 32 1 if you restart the screen when zapped, 0 otherwise.
  116. 33-34 Time limit. (word) Current time is stored as a counter (TIME)
  117. 35 The last alphabetic key that was pressed. (A-Z or 0-9)
  118. 36-37 Numeric form of the last input. (word)
  119. 38 Size in characters of the last input.
  120. 39-119 81 char string (including null terminator and junk padding) of
  121. the last string inputted.
  122. 120 Last direction the player moved. (0=None, 1=N, 2=S, 3=E, 4=W)
  123. Upper nybble (*16) is the direction faced. (0-3=NSEW)
  124. 121-201 81 char string (including null terminator and junk padding) of
  125. current message at the bottom of the screen.
  126. 202 Number of cycles until the message at the bottom of the screen
  127. disappears.
  128. 203 Lazer wall timer, from 0 to 7. (increases once per cycle and
  129. loops from 7 to 0)
  130. 204 Row for the message row.
  131. 205 Column for the message row, 255 for centered.
  132. 206-207 X scroll of the screen, signed word. (From SCROLL VIEW)
  133. 208-209 Y scroll of the screen, signed word. (From SCROLL VIEW)
  134. 210-211 Locked X position for the screen. Used for the upper left corner.
  135. 65535 for normal scrolling. Not affected by SCROLL VIEW.
  136. 212-213 Locked Y position for the screen.
  137. 214 1 if the player is locked in the ns direction.
  138. 215 1 if the player is locked in the ew direction.
  139. 216 1 if the player is locked from attacking.
  140. 217 Current MOD volume
  141. 218 Current MOD volume change amount
  142. 219 Current MOD volume target
  143. 220 Number of robots.
  144. Per robot- (these robots start counting at ID #1. ID #0 is reserved internal
  145. use.)
  146. 0-1 (unsigned word) Length of robot program
  147. 2-3 Junk.
  148. 4-18 15 character robot name, including null terminator. Padded with
  149. junk.
  150. 19 Robot character.
  151. 20-21 (unsigned word) Location within program of current line
  152. 22 (unsigned byte) Location within current line, IE countdown
  153. for WAIT and GO commands.
  154. 23 (unsigned byte) Robot cycle number.
  155. 24 (unsigned byte) Robot cycle count. Reset to 0 after robot runs
  156. a program section, then each cycle counts up 1. When it reaches
  157. the Robot cycle number, program continues and this is again
  158. reset to 0.
  159. 25 Bullet type code- 0 player, 1 neutral, 2 enemy.
  160. 26 Set to one if robot is locked from recieving messages.
  161. 27 Set to one for a lava walking robot.
  162. 28 Current direction of walk. (1 North 2 South 3 East 4 West)
  163. 29 Last direction the robot was touched. (1-4)
  164. 30 Last direction the robot was shot. (1-4)
  165. 31-32 Robot's x position
  166. 33-34 Robot's y position
  167. 35 Reserved for internal use (Value of 0, 1, or 2)
  168. 36 Future expansion (0)
  169. 37 Future expansion (0)
  170. 38 Set to 1 if actually used onscreen, 0 if this robot is
  171. irrevelant. (even irrevelant robots store a program though)
  172. 39-40 Loop count for the robot's current loop. Not reset after the
  173. loop.
  174. This is now followed by the robot's program according to it's length.
  175. Next-
  176. 0 Number of scrolls (counting from id #1)
  177. Per scroll-
  178. 0-1 (unsigned word) Number of lines in the scroll
  179. 2-3 Junk.
  180. 4-5 (unsigned word) Length in chars of the scroll.
  181. 6 Set to 1 if actually used onscreen, 0 if this one is irrevelant
  182. This is now followed by the scroll's text. Signs count as scrolls.
  183. Next-
  184. 0 Number of sensors (counting from id #1)
  185. Per sensor-
  186. 0-14 15 char name of sensor, including null terminator. Padded with
  187. junk.
  188. 15 Sensor char.
  189. 16-30 15 char name of robot to send messages to, including null
  190. terminator. Padded with junk.
  191. 31 Set to 1 if actually used onscreen, 0 if this one is irrevelant
  192. Finally, the board name (25 chars including null and junk padding) is at the
  193. end of the board ONLY IN A .MZB FILE. Within a .MZX or .SAV file, this is not
  194. present.
  195. Format for a .SAV saved game file (Megazeux)
  196. ---------------------------------
  197. This file format is for version 2.00. No attempt at compatibility with
  198. version 1.0? is made within the format. Megazeux version 2.00 will NOT
  199. recognize or load version 1.0? .SAV files.
  200. 00-05 The letters "MZSV2" and a null terminator.
  201. 06 Current board number.
  202. 07-3590 The character set (14 bytes per character, 256 characters)
  203. Each character is 14 bytes, from the top row to the bottom
  204. row, one byte per pixel row.
  205. 3591-4045 IdChars array (455 bytes) This is the info in Global Chars,
  206. as well as anything that can be edited with CHANGE CHAR ID.
  207. 4046-4105 The SIX status counters, IE those counters shown on the
  208. status screen. Each is 15 chars long, including a terminating
  209. null. Padded with junk.
  210. 4106-4121 Current keys held. Each byte is either 0-15 for a key or 127
  211. for no key.
  212. 4122-4125 (dword) Current score.
  213. 4126 Number of cycles remaining of blindness.
  214. 4127 Number of cycles remaining of firewalking.
  215. 4128 Number of cycles remaining of frozen time.
  216. 4129 Number of cycles remaining of slowed time.
  217. 4130 Number of cycles remaining of wind.
  218. 4131-4146 X positions of saved player positions. (SAVE PLAYER POSITION cmd)
  219. 4147-4162 Y positions of saved player positions. (one word each)
  220. 4163-4170 Board numbers (0-149) of saved player positions.
  221. 4171 Saved color of the player for when an energizer is active.
  222. 4172 Id under player's bomb/sensor
  223. 4173 Color under player's bomb/sensor
  224. 4174 Param under player's bomb/sensor
  225. 4175 1 if message edges are enabled
  226. 4176 Base color for scrolls.
  227. 4177 Corner color for scrolls.
  228. 4178 Pointer color for scrolls.
  229. 4179 Title color for scrolls.
  230. 4180 Arrow color for scrolls.
  231. 4181 Color of edge border during play.
  232. 4182 Starting board number.
  233. 4183 Board for end game. (255=none)
  234. 4184 Board for death. (255=restart, 254=same pos)
  235. 4185-86 X position for end game.
  236. 4187-88 Y position for end game.
  237. 4189 If sound fx play on game over.
  238. 4190-91 X position for death.
  239. 4192-93 Y position for death.
  240. 4194-95 Starting number of lives. (word)
  241. 4196-97 Limit to lives. (word)
  242. 4198-99 Starting amount of health. (word)
  243. 4200-01 Limit to health. (word)
  244. 4202 1 if enemies can hurt each other, 0 if not.
  245. 4203 1 if all messages and projectiles are cleared between screens.
  246. 4204 1 if the game is only playable via a robot SWAP WORLD command.
  247. 4205-68 Palette- colors 0-15, R G B. Each is 0-63.
  248. 4269-84 Current intensity palette, colors 0-15, each 0 to 100%.
  249. 4285 Current faded bit- 0 if faded in, 1 if faded out.
  250. 4286-87 X position of player's entry point on this screen.
  251. 4288-89 Y position of player's entry point on this screen.
  252. 4290 ID of what is under the under of the player.
  253. 4291 Param of what is under the under of the player.
  254. 4292 Color of what is under the under of the player.
  255. 4293 Number of counters
  256. Per counter-
  257. 00-14 15 char name of counter, including null terminator. Padded with
  258. junk.
  259. 15-16 (signed word) Value of counter.
  260. Then-
  261. 00-01 Position within file of global robot. (Stored as ID #0)
  262. 02 Code- 0 means SFXs follow. 1-150 means use normal SFX and this
  263. number is equal to the number of boards.
  264. SFXs- 50 of them (0-49) Each is any length up to 68, preceded by
  265. a length byte (1-69) of the string w/null termination. Normal
  266. SFX format. The very first two bytes is a WORD of how long
  267. this entire section is, not including the first WORD. After
  268. this section is a number for the number of boards.
  269. 03-???? Per board- 25 char title, including null terminator. Padded
  270. with junk.
  271. ????-???? Per board- Length of board in bytes (dword) and position of
  272. board within file. (byte number, dword)
  273. At location of board- The board itself. (see .MZB files, exactly the same)