fileform.txt 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. File format for the .MZX world file (w/o password protection)
  2. -----------------------------------
  3. This file format is only accurate up through version 1.03.
  4. Byte(s) Is
  5. 00-24 Title of game (name of first board) w/terminating null. Padded
  6. with junk.
  7. 25 Protection method (0=none, 1=no-save, 2=no-edit, 3=total)
  8. If not a 0, followed by the length of the password, then the
  9. fifteen character password (encrypted) The rest of the file is
  10. unaffected.
  11. 26-28 The letters "MZX"
  12. 29-3612 The character set (14 bytes per character, 256 characters)
  13. Each character is 14 bytes, from the top row to the bottom
  14. row, one byte per pixel row.
  15. 3613-3918 IdChars array (306 bytes) This is the info in Global Chars,
  16. as well as anything that can be edited with CHANGE CHAR ID.
  17. 3919-3978 The four status counters, IE those counters shown on the
  18. status screen. Each is 15 chars long, including a terminating
  19. null. Padded with junk.
  20. 3979-3982 Bullet characters- N S E W.
  21. 3983 Player character.
  22. 3984 X position of saved player position. (SAVE PLAYER POSITION cmd)
  23. 3985 Y position of saved player position.
  24. 3986 Board number (0-127) of saved player position.
  25. 3987 Color of edge border during play.
  26. 3988 Color of player.
  27. 3989 Color of bullets.
  28. 3990 Color of missiles.
  29. 3991 Starting board number.
  30. 3992 Board for end game. (128 for none)
  31. 3993 Board for death. (128 for restart board, 129 for same pos)
  32. 3994 X position for end game.
  33. 3995 Y position for end game.
  34. 3996 X position for death.
  35. 3997 Y position for death.
  36. 3998-3999 Starting number of lives. (word)
  37. 4000-4001 Limit to lives. (word)
  38. 4002-4003 Starting amount of health. (word)
  39. 4004-4005 Limit to health. (word)
  40. 4006 1 if enemies can hurt each other, 0 if not.
  41. 4007 1 if game over sfx are on, 0 if not.
  42. 4008 00.
  43. 4009 Number of boards. (1 to 127)
  44. 4010-???? Per board- 25 char title, including null terminator. Padded
  45. with junk.
  46. ????-???? Per board- Length of board in bytes (dword) and position of
  47. board within file. (byte number, dword)
  48. At location of board- The board itself. (see .MZB files, exactly the same)
  49. Format for a .MZB board file
  50. ----------------------------
  51. This file format is only accurate up through version 1.03.
  52. First- Level ids, RLE encoded.
  53. Then- Level colors, RLE encoded.
  54. Then- Level params, RLE encoded.
  55. Then- Ids under stuff, RLE encoded.
  56. Then- Colors of ids under stuff, RLE encoded.
  57. Last- Params of ids under stuff, RLE encoded.
  58. Level id/color/param is a number representing an object, a number for it's
  59. color, (bk and fg) and a number representing it's stats. (IE robot id, or
  60. enemy stats, or custom chars, or passage destination, etc) These are all
  61. bytes. The "under stuff" is for things beneath other things, like floors and
  62. carpets. All six sets are RLE encoded, a simple compression method. The
  63. method works as follows- The first byte is the x size (of the board) and the
  64. second byte is the y size. After that, read two bytes. The first is the runs
  65. byte, the second is the data byte. The runs byte tells how many times to use
  66. the data byte. This repeats for the entire x/y size. Runs can wrap across
  67. multiple lines.
  68. After board design-
  69. 00-12 Name of default MOD file, w/extension and null terminator.
  70. Padded with junk.
  71. 13 X position of upper left corner of the viewport.
  72. 14 Y position of upper left corner of the viewport.
  73. 15 X size of the viewport.
  74. 16 Y size of the viewport.
  75. 17 1 if you can shoot here, 0 otherwise.
  76. 18 1 if you can bomb here, 0 otherwise.
  77. 19 1 if fire burns through brown things, 0 otherwise.
  78. 20 1 if fire burns through spaces, 0 otherwise.
  79. 21 1 if fire burns through fakes, 0 otherwise.
  80. 22 1 if fire burns through trees, 0 otherwise.
  81. 23 Code for what an explosion leaves- 0 for spaces, 1 for ash,
  82. 2 for fire.
  83. 24 1 if you can't save here, 2 if you can only save on a sensor,
  84. 0 for normal saving.
  85. 25 0 if forest becomes empty, 1 if forest becomes floor.
  86. 26 1 if you collect bombs normally, 0 if they automatically light.
  87. 27 1 if fire burns forever, 0 otherwise.
  88. 28-31 Board numbers for boards to the N S E and W. 255 for no board.
  89. 32 1 if you restart the screen when zapped, 0 otherwise.
  90. 33-34 Time limit. (word)
  91. 35 The last alphabetic key that was pressed. (A-Z)
  92. 36-37 Numeric form of the last input. (word)
  93. 38 Size in characters of the last input.
  94. 39 Volume for MOD files.
  95. 40 1 if the player is locked in the ns direction.
  96. 41 1 if the player is locked in the ew direction.
  97. 42 1 if the player is locked from attacking.
  98. 43-123 81 char string (including null terminator and junk padding) of
  99. the last string inputted.
  100. 124 Number of cycles remaining of blindness.
  101. 125 Number of cycles remaining of firewalking.
  102. 126 00.
  103. 127 Number of cycles remaining of frozen time.
  104. 128 Number of cycles remaining of slowed time.
  105. 129-131 00.
  106. 132 Number of cycles remaining of wind.
  107. 133 Last direction the player moved. (0=N, 1=S, 2=E, 3=W)
  108. 134-214 81 char string (including null terminator and junk padding) of
  109. current message at the bottom of the screen.
  110. 215 Number of cycles until the message at the bottom of the screen
  111. disappears.
  112. 216 Lazer wall timer, from 0 to 7. (increases once per cycle and
  113. loops from 7 to 0)
  114. 217 Row for the message row.
  115. 218 Column for the message row, 0 for centered.
  116. 219 X scroll of the screen, signed byte. (From SCROLL VIEW)
  117. 220 Y scroll of the screen, signed byte. (From SCROLL VIEW)
  118. 221 Number of robots.
  119. Per robot- (these robots start counting at id #1. There is no id #0.)
  120. 0-3 (signed dword) Length of robot program
  121. 4-7 Junk
  122. 8-22 15 character robot name, including null terminator. Padded with
  123. junk.
  124. 23 Robot character.
  125. 24-27 (signed dword) Location within program of current line
  126. 28 (unsigned byte) Location within current line, IE countdown
  127. for WAIT and GO commands.
  128. 29 (unsigned byte) Robot cycle number.
  129. 30 (unsigned byte) Robot cycle count. Reset to 0 after robot runs
  130. a program section, then each cycle counts up 1. When it reaches
  131. the Robot cycle number, program continues and this is again
  132. reset to 0.
  133. 31 Bullet type code- 0 player, 1 neutral, 2 enemy.
  134. 32 Set to one if robot is locked from receiving messages.
  135. 33 Set to one for a lava walking robot.
  136. 34 Current direction of walk. (1 North 2 South 3 East 4 West)
  137. 35 Last direction the robot was touched. (1-4)
  138. 36 Last direction the robot was shot. (1-4)
  139. This is now followed by the robot's program according to it's length.
  140. Next-
  141. 0 Number of scrolls (counting from id #1)
  142. Per scroll-
  143. 0-1 (unsigned word) Number of lines in the scroll
  144. 2-5 Junk.
  145. 6-9 (unsigned dword) Length in chars of the scroll.
  146. This is now followed by the scroll's text. Signs count as scrolls.
  147. Next-
  148. 0 Number of sensors (counting from id #1)
  149. Per sensor-
  150. 0-14 15 char name of sensor, including null terminator. Padded with
  151. junk.
  152. 15 Sensor char.
  153. 16-30 15 char name of robot to send messages to, including null
  154. terminator. Padded with junk.
  155. Finally, the board name (25 chars including null and junk padding) is at the
  156. end of the board ONLY IN A .MZB FILE. Within a .MZX or .SAV file, this is not
  157. present.
  158. Format for a .SAV saved game file (Megazeux)
  159. ---------------------------------
  160. This file format is only accurate up through version 1.03.
  161. 00-05 The letters "MZSAV" and a null terminator.
  162. 06 Current board number.
  163. 07-3590 The character set (14 bytes per character, 256 characters)
  164. Each character is 14 bytes, from the top row to the bottom
  165. row, one byte per pixel row.
  166. 3591-3896 IdChars array (306 bytes) This is the info in Global Chars,
  167. as well as anything that can be edited with CHANGE CHAR ID.
  168. 3897-3912 Current keys held. Each byte is either 0-15 for a key or 127
  169. for no key.
  170. 3913-3962 The four status counters, IE those counters shown on the
  171. status screen. Each is 15 chars long, including a terminating
  172. null. Padded with junk.
  173. 3963-3966 Bullet characters- N S E W.
  174. 3967 Player character.
  175. 3968 X position of saved player position. (SAVE PLAYER POSITION cmd)
  176. 3969 Y position of saved player position.
  177. 3970 Board number (0-127) of saved player position.
  178. 3971 Color of edge border during play.
  179. 3972 Color of player.
  180. 3973 Color of bullets.
  181. 3974 Color of missiles.
  182. 3975 Base color for scrolls.
  183. 3976 Border color for scrolls.
  184. 3977 Pointer color for scrolls.
  185. 3978 Title color for scrolls.
  186. 3979 Arrow color for scrolls.
  187. 3980-3983 (dword) Current score.
  188. 3984 Starting board number.
  189. 3985 Board for end game.
  190. 3986 Board for death.
  191. 3987 X position for end game.
  192. 3988 Y position for end game.
  193. 3989 X position for death.
  194. 3990 Y position for death.
  195. 3991-3992 Starting number of lives. (word)
  196. 3993-3994 Limit to lives. (word)
  197. 3995-3996 Starting amount of health. (word)
  198. 3997-3998 Limit to health. (word)
  199. 3999 1 if enemies can hurt each other, 0 if not.
  200. 4000 Junk byte.
  201. 4001 00.
  202. 4002 Number of counters
  203. Per counter-
  204. 00-14 15 char name of counter, including null terminator. Padded with
  205. junk.
  206. 15-16 (unsigned word) Value of counter.
  207. Then-
  208. 00 Number of boards. (1 to 127)
  209. 01-???? Per board- 25 char title, including null terminator. Padded
  210. with junk.
  211. ????-???? Per board- Length of board in bytes (dword) and position of
  212. board within file. (byte number, dword)
  213. At location of board- The board itself. (see .MZB files, exactly the same)