Guest User

hvq4_hvqm4.bms

a guest
Dec 25th, 2019
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. endian big
  2. get hvq_ext extension
  3.  
  4. math is_hvqm = 0
  5. math is_hvq = 0
  6. math is_h4m = 0
  7. math is_h4p = 0
  8.  
  9. if hvq_ext = "h4x"
  10. # Largo Winch (Gamecube)
  11. else
  12. # everywhere else (hvqm, hvq, h4m, h4p)
  13. getdstring h4m_sign 0x10
  14. if h4m_sign == "HVQM4 1.3" # (2001-10 - 2002-06)
  15. math is_h4m = 1
  16. elif h4m_sign == "HVQM4 1.5" # (2002-07 - ???)
  17. math is_h4m = 1
  18. elif h4m_sign == "HVQ4 1.0A" # (2003?)
  19. math is_h4p = 1
  20. else
  21. cleanexit
  22. endif
  23. if is_h4m = 1
  24. get h4m_raw_offset long
  25. get h4m_raw_size long
  26. get h4m_03 long
  27. get h4m_04 long
  28. get h4m_05 long
  29. get h4m_06 long
  30. get h4m_07 long
  31. get h4m_08 long
  32. get h4m_full_sound_size long
  33. get h4m_10 long
  34. get h4m_11 long
  35. get h4m_12 long
  36. get sample_rate long
  37. goto h4m_raw_offset
  38. savepos h4m_current_offset_per_second
  39. for i = 0 < h4m_03
  40. goto h4m_current_offset_per_second
  41. get previous_size_per_second long
  42. get current_size_per_second long
  43. get frames_per_second_for_video long
  44. get frames_per_second_for_audio long
  45. get frame_05 long
  46. savepos mid_offset_per_second
  47. math h4m_current_offset_per_second + 0x14
  48. math h4m_current_offset_per_second + current_size_per_second
  49. xmath sound_tracks "(h4m_12 & 0x0f) + 1"
  50. savepos h4m_current_track_offset
  51. xmath full_chunks_per_second "frames_per_second_for_video + frames_per_second_for_audio"
  52. for j = 0 < full_chunks_per_second
  53. goto h4m_current_track_offset
  54. get track_type short
  55. get track_sub_format byte
  56. get track_format byte
  57. get track_size long
  58. math h4m_current_track_offset + 8
  59. math h4m_current_track_offset + track_size
  60. if track_type = 0
  61. if track_format = 0
  62. if track_sub_format = 0xff
  63. # Nintendo AFC ADPCM
  64. /*
  65. savepos afc_chunk_offset
  66. append
  67. if i = 0
  68. log MEMORY_FILE 0 0x20
  69. put h4m_full_sound_size long MEMORY_FILE
  70. xmath afc_samples "(h4m_full_sound_size / 9) * 8"
  71. put afc_samples long MEMORY_FILE
  72. put sample_rate short MEMORY_FILE
  73. put 4 short MEMORY_FILE
  74. put 0x10 short MEMORY_FILE
  75. put 0x1e short MEMORY_FILE
  76. for b3 = 0 < 0x10
  77. put 0 byte MEMORY_FILE
  78. next b3
  79. log "test.afc" 0 0x20 MEMORY_FILE
  80. endif
  81. log "test.afc" afc_chunk_offset track_size
  82. append
  83. */
  84. endif
  85. elif track_format = 1
  86. # HVQM4 IMA ADPCM
  87. get sound_size_per_second long
  88. savepos current_sound_offset
  89. for st = 0 < sound_tracks
  90. xmath k2 "k << 2"
  91. goto current_sound_offset
  92. math current_sound_offset + k2
  93. math current_sound_offset + sound_size_per_second
  94. next st
  95. endif
  96. elif track_type = 1
  97. get video_01 long
  98. get video_02 long
  99. xmath video_type "(video_02 >> 16) & 0xff"
  100. xmath video_version "(video_02 >> 24) & 0xff"
  101. get video_03 long
  102. get video_04 long
  103. endif
  104. next j
  105. next i
  106. endif
  107. if is_h4p = 1
  108. get h4p_size long
  109. get h4p_raw_offset long
  110. get h4p_chroma_subsampling_for_height byte
  111. get h4p_chroma_subsampling_for_width byte
  112. get h4p_image_height short
  113. get h4p_image_width short
  114. getdstring params 6
  115. get h4p_fifo_packets_for_2pass_decoding long
  116. for section = 0 < 0x10
  117. get section_offset long
  118. next section
  119. endif
  120. endif
Advertisement
Add Comment
Please, Sign In to add comment