SHARE
TWEET

ubisoft_blk.bms

AnonBaiter Jul 6th, 2019 (edited) 30 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Ubisoft Montreal - *.BLK
  2. # basically [SM/LM]#/[SB/LS]#'s predecessor
  3.  
  4. open FDSE "HEADER.BLK" 0
  5. open FDSE "EVT.BLK" 1
  6. open FDSE "RES.BLK" 2
  7. open FDSE "..\MAP.BLK" 3
  8. open FDSE "MAPLANG.BLK" 4
  9.  
  10. get blk_version long 0
  11. get header_entries long 0
  12. get evt_entries long 0
  13. get res_entries long 0
  14. get blk_05 long 0
  15. get blk_06 long 0
  16.  
  17. # this part is where all the sound tabs for a specific level reside
  18. math map_type = 0
  19. for i = 0 < header_entries
  20.     get raw_size_within_map_blk long 0
  21.     get raw_size_within_maplang_blk long 0
  22.     get info_offset_within_map_blk long 0
  23.     get info_offset_within_maplang_blk long 0
  24.     getdstring tab_name 0x20 0
  25.     math map_type = 3
  26.     callfunction get_map_files_per_entry 1
  27.     math map_type = 4
  28.     callfunction get_map_files_per_entry 1
  29. next i
  30.  
  31. startfunction get_map_files_per_entry
  32.     if map_type = 3
  33.         goto info_offset_within_map_blk 3
  34.         math temp_01 = info_offset_within_map_blk
  35.     elif map_type = 4
  36.         goto info_offset_within_maplang_blk 4
  37.         math temp_01 = info_offset_within_maplang_blk
  38.     endif
  39.     math available_map_entries = 0
  40.     for map_entry = 0 < 0x600
  41.         get map_entry_offset long map_type
  42.         if map_entry_offset != 0xffffffff
  43.             putarray 0 available_map_entries map_entry_offset
  44.             math available_map_entries + 1
  45.         endif
  46.     next map_entry
  47.     if map_type = 3
  48.         putarray 0 available_map_entries raw_size_within_map_blk
  49.     elif map_type = 4
  50.         putarray 0 available_map_entries raw_size_within_maplang_blk
  51.     endif
  52.     math all_map_entries = available_map_entries
  53.     xmath base_map_offset "temp_01 + (3 << 11)"
  54.     for map_entry = 0 < all_map_entries
  55.         xmath m2 "map_entry + 1"
  56.         getarray map_entry_offset 0 map_entry
  57.         math map_entry + 1
  58.         getarray temp_02 0 map_entry
  59.         math map_entry - 1
  60.         xmath map_entry_size "temp_02 - map_entry_offset"
  61.         math map_entry_offset + base_map_offset
  62.         if map_type = 3
  63.             string map_name p "MAP"
  64.         elif map_type = 4
  65.             string map_name p "MAPLANG"
  66.         endif
  67.         string temp_name p "%s\%s\%04d.vgmstream" tab_name map_name m2
  68.         log temp_name map_entry_offset map_entry_size map_type
  69.     next map_entry
  70. endfunction
  71.  
  72. /*
  73. for j = 0 < evt_entries
  74.     get evt_01 long 1
  75.     get evt_02 long 1
  76.     get evt_03 long 1
  77.     # ^ evt_03 refers to a res_entries number
  78.     get evt_04 long 1
  79.     get evt_05 long 1
  80.     get evt_06 long 1
  81.     get evt_07 long 1
  82.     get evt_08 long 1
  83. next j
  84.  
  85. # resource data
  86. xmath res_base_offset "res_entries * 0x40"
  87. for k = 0 < res_entries
  88.     get res_01 long 2
  89.     get res_02 long 2
  90.     # ^ res_02 is actually a number that determines an resource entry out of a single sound file
  91.     # it can be either streamed(0x01/0x0d) or sequenced(0x0a/0x0c)
  92.     get res_03 long 2
  93.     get res_04 long 2
  94.     # ^ res_04 consists of an entire number of samples for a streamed file
  95.     # for sequenced files this value is set to zero
  96.     get res_05 long 2
  97.     # ^ res_05 can refer to ANY kind of offset RES.BLK knows about
  98.     # if sound file is streamed, then the offset for that one is right-shifted by 11
  99.     # if sound file is sequenced, then the sequenced file is right in said file so the offset for that one is simpler to figure out
  100.     get res_06 long 2
  101.     get res_07 long 2
  102.     get res_08 long 2
  103.     get res_09 long 2
  104.     get res_10 long 2
  105.     get res_11 long 2
  106.     get res_12 long 2
  107.     get res_13 long 2
  108.     get res_14 long 2
  109.     get res_15 long 2
  110.     get res_16 long 2
  111. next k
  112. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top