AnonBaiter

beenox_streams_dat.bms

Jun 1st, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 KB | None | 0 0
  1. # Beenox - Streams.dat
  2.  
  3. math wii = 0 # set this to 1 for the Wii version of ANY beenox game
  4.  
  5. get streams_dat_sign long
  6. if streams_dat_sign == 0xbadf1ea5
  7. endian little
  8. elif streams_dat_sign == 0xa51edfba
  9. endian big
  10. endif
  11. get streams_dat_mode long
  12. get streams_dat_sound_entries long
  13. get streams_dat_language_entries long
  14. for i1 = 0 < streams_dat_language_entries
  15. get language_number long
  16. next i1
  17. if streams_dat_mode == 2
  18. xmath streams_dat_additional_pos_01 "(streams_dat_sound_entries * 4) + (streams_dat_language_entries * 4) + 0x10"
  19. endif
  20. get is_new_version_01 long
  21. get is_new_version_02 long
  22. if is_new_version_01 != 0xc0c0c0c0
  23. if is_new_version_02 != 0xc0c0c0c0
  24. goto -8 0 SEEK_CUR
  25. endif
  26. endif
  27. if streams_dat_mode == 0xb
  28. get entries_01 long
  29. get entries_02 long
  30. get entries_03 long
  31. for i1 = 0 < entries_01
  32. get entries_02_01 long
  33. get entries_02_02 long
  34. get entries_02_03 long
  35. get entries_02_04 long
  36. get entries_02_05 long
  37. next i1
  38. endif
  39. for i2 = 0 < streams_dat_language_entries
  40. for j1 = 0 < streams_dat_sound_entries
  41. if streams_dat_mode == 2
  42. get sound_entry_number long
  43. savepos streams_dat_tmp_01
  44. goto streams_dat_additional_pos_01
  45. get sound_entry_info_offset long
  46. goto sound_entry_info_offset
  47. get codec short
  48. get channels short
  49. get sample_rate_frequency long
  50. get average_bytes_per_second long
  51. get bits_per_sample short
  52. get block_size short
  53. get streams_dat_entry_06 long
  54. get raw_pcm_size long
  55. goto streams_dat_tmp_01
  56. math streams_dat_additional_pos_01 + 4
  57. elif streams_dat_mode == 3
  58. if is_new_version_01 == 0xc0c0c0c0 && is_new_version_02 == 0xc0c0c0c0
  59. get pre_01 long
  60. get pre_02 short
  61. get pre_03 short
  62. get pre_04 long
  63. get pre_05 long
  64. endif
  65. get sound_entry_number long
  66. get sound_entry_offset long
  67. if sound_entry_number == 0xffffffff
  68. if sound_entry_offset == 0xffffffff
  69. for
  70. get dummy_data long
  71. if dummy_data != 0xbabebabe && dummy_data != 0xbebabeba
  72. goto -4 0 SEEK_CUR
  73. break
  74. endif
  75. next
  76. endif
  77. else
  78. get sound_entry_codec_type long
  79. xmath is_xma "sound_entry_codec_type & 0xff000000"
  80. xmath is_ima "sound_entry_codec_type & 0x0000ffff"
  81. if sound_entry_codec_type >= 0x00000001 && sound_entry_codec_type <= 0x00000006
  82. math channels == sound_entry_codec_type
  83. # no other way to guess it
  84. if wii = 0
  85. get aaaa_01 long
  86. get sample_rate_frequency long
  87. elif wii = 1
  88. for k = 0 < 3
  89. get aaaa_01 long
  90. next k
  91. get sample_rate_frequency long
  92. get aaaa_03 long
  93. get aaaa_04 long
  94. get aaaa_05 long
  95. get aaaa_06 long
  96. getdstring dsp_info 0xa8
  97. endif
  98. elif sound_entry_codec_type == 0x53325350
  99. get raw_vag_size long
  100. get streams_dat_entry_05 long # 0xeb3
  101. get channels short
  102. get sample_rate_frequency short
  103. get streams_dat_entry_07 long
  104. else
  105. if is_xma == 0x04000000
  106. xmath xma_entries "((sound_entry_codec_type & 0x00ff0000) >> 16) & 0xff"
  107. get streams_dat_entry_04 long
  108. get streams_dat_entry_05 long
  109. get sample_rate_frequency long
  110. get encoder_options short
  111. get streams_dat_entry_08 short
  112. get streams_dat_entry_09 long
  113. get streams_dat_entry_10 long
  114. get streams_dat_entry_11 long
  115. get streams_dat_entry_12 long
  116. get streams_dat_entry_13 long
  117. for k = 0 < xma_entries
  118. get streams_dat_entry_13 long
  119. xmath xma_channels_per_language_entry "((streams_dat_entry_13 & 0xff000000) >> 24) & 0xff"
  120. next k
  121. get raw_xma_size long
  122. endif
  123. if is_ima == 0x00000011
  124. xmath ima_channels "((sound_entry_codec_type & 0xffff0000) >> 16) & 0xffff"
  125. get sample_rate_frequency long
  126. get average_bytes_per_second long
  127. get channels short
  128. get bits_per_sample short
  129. get aaaa_03 long
  130. get raw_ima_size long
  131. get aaaa_05 short
  132. get aaaa_06 short
  133. endif
  134. endif
  135. endif
  136. elif streams_dat_mode = 0x0b
  137. get sound_01 long
  138. get sound_entry_offset long
  139. # (Spider-Man Shattered Dimensions)
  140. # apparently this Streams.dat file can reference sound offsets from beyond what said file itself can handle(???)
  141. get sound_03 long
  142. get sound_04 long
  143. get sound_05 long
  144. get sound_06 long
  145. get sound_07 long
  146. get sound_08 long
  147. get sound_09 long
  148. get sound_10 long
  149. get sound_11 long
  150. get sound_12 long
  151. get sound_13 long
  152. get sound_14 long
  153. get codec short
  154. get channels short
  155. get sample_rate_frequency long
  156. get average_bytes_per_second long
  157. get block_size short
  158. get bits_per_sample short
  159. get sound_19 long
  160. get sound_20 long
  161. get sound_21 long
  162. get sound_22 long
  163. get sound_23 long
  164. get sound_24 long
  165. get sound_25 long
  166. get sound_26 long
  167. get sound_27 long
  168. get sound_28 long
  169. get sound_29 long
  170. get sound_30 long
  171. endif
  172. next j1
  173. next i2
Add Comment
Please, Sign In to add comment