Advertisement
LuigiBlood

Another World File Format

Nov 17th, 2012
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Another World File Formats
  2. (Based from RAW by Gregory Montoir, New RAW by Fabien Sanglard and from technical notes by Eric Chahi from Another World 15th Anniversary Disc)
  3.  
  4. Set.i Vn, Imm16
  5. 00 DD NNNN
  6. (Variable = Imm16)
  7.  
  8. Set Vd, Vs
  9. 01 DD SS
  10. (VariableDest = VariableSource)
  11.  
  12. Add Vd, Vs
  13. 02 DD SS
  14. (VariableDest += VariableSource)
  15.  
  16. Add.i Vn, Imm16
  17. 03 DD NNNN
  18. (Variable += Imm16)
  19.  
  20. Jsr Address
  21. 04 AAAA
  22.  
  23. return
  24. 05
  25.  
  26. break
  27. 06
  28.  
  29. Jmp Address
  30. 07 AAAA
  31.  
  32. SetVec Nb, Address
  33. 08 VV AAAA
  34. (Vec = $FFFF; No code to run)
  35.  
  36. dbra Vn, Address
  37. 09 VV AAAA
  38. (Go to Address if Variable != 0)
  39.  
  40. Si(Vn,Vn):
  41. If Vn = Vn Jmp Address
  42. 0A 80 VV WW AAAA
  43.  
  44. If Vn <> Vn Jmp Address
  45. 0A 81 VV WW AAAA
  46.  
  47. If Vn > Vn Jmp Address
  48. 0A 82 VV WW AAAA
  49.  
  50. If Vn => Vn Jmp Address
  51. 0A 83 VV WW AAAA
  52.  
  53. If Vn < Vn Jmp Address
  54. 0A 84 VV WW AAAA
  55.  
  56. If Vn <= Vn Jmp Address
  57. 0A 85 VV WW AAAA
  58.  
  59.  
  60. Si(Vn,Imm8):
  61. If Vn = Imm8 Jmp Address
  62. 0A 00 VV WW AAAA
  63.  
  64. If Vn <> Imm8 Jmp Address
  65. 0A 01 VV WW AAAA
  66.  
  67. If Vn > Imm8 Jmp Address
  68. 0A 02 VV WW AAAA
  69.  
  70. If Vn => Imm8 Jmp Address
  71. 0A 03 VV WW AAAA
  72.  
  73. If Vn < Imm8 Jmp Address
  74. 0A 04 VV WW AAAA
  75.  
  76. If Vn <= Imm8 Jmp Address
  77. 0A 05 VV WW AAAA
  78.  
  79.  
  80. Si(Vn,Imm16):
  81. If Vn = Imm16 Jmp Address
  82. 0A 40 VV WWWW AAAA
  83.  
  84. If Vn <> Imm16 Jmp Address
  85. 0A 41 VV WWWW AAAA
  86.  
  87. If Vn > Imm16 Jmp Address
  88. 0A 42 VV WWWW AAAA
  89.  
  90. If Vn => Imm16 Jmp Address
  91. 0A 43 VV WWWW AAAA
  92.  
  93. If Vn < Imm16 Jmp Address
  94. 0A 44 VV WWWW AAAA
  95.  
  96. If Vn <= Imm16 Jmp Address
  97. 0A 45 VV WWWW AAAA
  98.  
  99.  
  100. Fade PalNb
  101. 0B NN 00
  102. (Set Palette)
  103.  
  104. Vec Start, End, Unlock
  105. 0C SS EE 00
  106. (Unlock Vectors from Start to End)
  107.  
  108. Vec Start, End, Lock
  109. 0C SS EE 01
  110. (Lock Vectors from Start to End)
  111.  
  112. Vec Start, End, Clean
  113. 0C SS EE 02
  114. (Delete Vectors from Start to End)
  115.  
  116. SetWS Nb
  117. 0D NN
  118. (Select Work screen)
  119.  
  120. Clr Nb, Color
  121. 0E NN 0C
  122. (Clear screen with Color)
  123.  
  124. Copy Ss Sd
  125. 0F SS DD
  126. (Copy workscreen to another workscreen, see Screen Buffers for more info)
  127.  
  128. Show NN
  129. 10 NN
  130. (Show workscreen)
  131.  
  132. Bigend
  133. 11
  134. (break + current vector = $FFFF)
  135.  
  136. Text TxtNb, X, Y, Color
  137. 12 TTTT XX YY 0C
  138. (Show Text at X,Y with color)
  139.  
  140. Sub Vd, Vs
  141. 13 DD SS
  142. (VariableDest -= VariableSource)
  143.  
  144. And.i Vn,Imm16
  145. 14 VV IIII
  146. (Variable &= Imm16)
  147.  
  148. Or.i Vn,Imm16
  149. 15 VV IIII
  150. (Variable ^= Imm16)
  151.  
  152. Lsl Vn, Imm16
  153. 16 VV IIII
  154. (Variable <= Imm16)
  155.  
  156. Lsr Vn, Imm16
  157. 17 VV IIII
  158. (Variable >= Imm16)
  159.  
  160. Play FileNb, Note, Volume, Channel
  161. 18 FFFF NN VV CC
  162. (Play Sound at Note, Volume at one channel)
  163.  
  164. Load FileNb
  165. 19 FFFF
  166. (Load File number. If 0 then release the memory)
  167.  
  168. Song FileNb, Tempo, Position
  169. 1A FFFF TTTT PP
  170. (If file number and tempo = 0 then stop song)
  171. (If file number = 0 and tempo != than current tempo then change tempo of current song)
  172.  
  173.  
  174. Spr.s Addr, X, Y
  175. (80 || AA) AA XX YY
  176.  
  177.  
  178. Spr.l Addr, X, Y, (Z)
  179. 01XXYYZZb AAAA (XX)XX (YY)YY (ZZZZ)
  180. 0=00=Imm16
  181. 1=01=Variable
  182. 2=10=Imm8
  183. 3=11=No Z or X||100
  184.  
  185. Exemples:
  186. Spr.l Addr, X16, Y16, Z16
  187. 40 AAAA XXXX YYYY ZZZZ
  188.  
  189. Spr.l Addr, X8, Y8, Z8
  190. 6B AAAA XX YY ZZ
  191.  
  192. Spr.l Addr, VX, VY, VX
  193. 55 AAAA VX VY VX
  194.  
  195.  
  196. Polygon Format:
  197. Header:
  198. [C0||Pallette] HH VV PP
  199. (HH = Horizontal Size, VV = Vertical Size)
  200.  
  201. Points:
  202. XX YY [...*PP]
  203.  
  204.  
  205. Polygon Group Format:
  206. Header:
  207. 02 BX BY NN
  208. (BX = Horizontal Point Base, BY = Vertical Point Base)
  209.  
  210. Group:
  211. CHHHHHHHb HH RX RY (APPPPPPPb) (MM)
  212. C = 0: Default Color
  213. C = 1: Color 4
  214. H = Group number (15-bit)
  215. RX = X relative
  216. RY = Y relative
  217. A = Mask Flag Bit
  218. P = Pallette (only if C = 1)
  219. MM = Mask (only if A = 1)
  220.  
  221.  
  222. Screen Buffers (workscreens):
  223. 0=Plain Color
  224. 1=Double Buffer
  225. 2=Double Buffer
  226. 3=Background
  227. 254=Visible Screen
  228. 255=Invisible Screen
  229.  
  230. Special Screen copy (Source Screen byte only):
  231. 10000SSb
  232. SS = Screen Buffer (0 to 3)
  233. Copy Screen to Destination Screen at Vertical Position taken from Variable 249
  234.  
  235.  
  236. Color Format:
  237. 0000RRRRGGGGBBBBb
  238.  
  239. Color Number:
  240. 0 to 15 = Plain colors
  241. 16 = Written to the last screen
  242. 17 = Written to the first screen
  243.  
  244.  
  245. Pallette Format:
  246. 64 pallettes with 16 colors (32 bytes)
  247. 64 * 32 = 2048.
  248.  
  249. First half is for Amiga
  250. Last half is for other ports
  251.  
  252. Special Variables:
  253. V60 = Random Seed
  254. V218 = Keyboard Letter Key pressed (from 'a' to 'z' only)
  255. V229 = Joystick Vertical (0 = None; -1 = Up; 1 = Down)
  256. V244 = Used for Music Sync
  257. V249 = Vertical Position for Copy (Can be used for vertical scrolling)
  258. V250 = Joystick Button (0 = Release; 1 = Hold)
  259. V251 = Joystick Vertical (0 = None; -1 = Up; 1 = Down)
  260. V252 = Joystick Horizontal (0 = None; -1 = Left; 1 = Right)
  261. V253 = Button Mask (0000UDLR)
  262. V254 = Button Mask 2 (B000UDLR)
  263. V255 = Game Speed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement