Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- endian big
- get hvq_ext extension
- math is_hvqm = 0
- math is_hvq = 0
- math is_h4m = 0
- math is_h4p = 0
- if hvq_ext = "h4x"
- # Largo Winch (Gamecube)
- else
- # everywhere else (hvqm, hvq, h4m, h4p)
- getdstring h4m_sign 0x10
- if h4m_sign == "HVQM4 1.3" # (2001-10 - 2002-06)
- math is_h4m = 1
- elif h4m_sign == "HVQM4 1.5" # (2002-07 - ???)
- math is_h4m = 1
- elif h4m_sign == "HVQ4 1.0A" # (2003?)
- math is_h4p = 1
- else
- cleanexit
- endif
- if is_h4m = 1
- get h4m_raw_offset long
- get h4m_raw_size long
- get h4m_03 long
- get h4m_04 long
- get h4m_05 long
- get h4m_06 long
- get h4m_07 long
- get h4m_08 long
- get h4m_full_sound_size long
- get h4m_10 long
- get h4m_11 long
- get h4m_12 long
- get sample_rate long
- goto h4m_raw_offset
- savepos h4m_current_offset_per_second
- for i = 0 < h4m_03
- goto h4m_current_offset_per_second
- get previous_size_per_second long
- get current_size_per_second long
- get frames_per_second_for_video long
- get frames_per_second_for_audio long
- get frame_05 long
- savepos mid_offset_per_second
- math h4m_current_offset_per_second + 0x14
- math h4m_current_offset_per_second + current_size_per_second
- xmath sound_tracks "(h4m_12 & 0x0f) + 1"
- savepos h4m_current_track_offset
- xmath full_chunks_per_second "frames_per_second_for_video + frames_per_second_for_audio"
- for j = 0 < full_chunks_per_second
- goto h4m_current_track_offset
- get track_type short
- get track_sub_format byte
- get track_format byte
- get track_size long
- math h4m_current_track_offset + 8
- math h4m_current_track_offset + track_size
- if track_type = 0
- if track_format = 0
- if track_sub_format = 0xff
- # Nintendo AFC ADPCM
- /*
- savepos afc_chunk_offset
- append
- if i = 0
- log MEMORY_FILE 0 0x20
- put h4m_full_sound_size long MEMORY_FILE
- xmath afc_samples "(h4m_full_sound_size / 9) * 8"
- put afc_samples long MEMORY_FILE
- put sample_rate short MEMORY_FILE
- put 4 short MEMORY_FILE
- put 0x10 short MEMORY_FILE
- put 0x1e short MEMORY_FILE
- for b3 = 0 < 0x10
- put 0 byte MEMORY_FILE
- next b3
- log "test.afc" 0 0x20 MEMORY_FILE
- endif
- log "test.afc" afc_chunk_offset track_size
- append
- */
- endif
- elif track_format = 1
- # HVQM4 IMA ADPCM
- get sound_size_per_second long
- savepos current_sound_offset
- for st = 0 < sound_tracks
- xmath k2 "k << 2"
- goto current_sound_offset
- math current_sound_offset + k2
- math current_sound_offset + sound_size_per_second
- next st
- endif
- elif track_type = 1
- get video_01 long
- get video_02 long
- xmath video_type "(video_02 >> 16) & 0xff"
- xmath video_version "(video_02 >> 24) & 0xff"
- get video_03 long
- get video_04 long
- endif
- next j
- next i
- endif
- if is_h4p = 1
- get h4p_size long
- get h4p_raw_offset long
- get h4p_chroma_subsampling_for_height byte
- get h4p_chroma_subsampling_for_width byte
- get h4p_image_height short
- get h4p_image_width short
- getdstring params 6
- get h4p_fifo_packets_for_2pass_decoding long
- for section = 0 < 0x10
- get section_offset long
- next section
- endif
- endif
Advertisement
Add Comment
Please, Sign In to add comment