- Only test keys when file is encrypted
- Add clHCA_TestBlock to test a frame with the current key
- Move some key detection code to hca_decoder.c and simplify hca.c
detection
- Decrease number of test frames due to increased accuracy of
clHCA_TestBlock
- rename clHCA_DecodeSamples16 to clHCA_ReadSamples16 since it isn't
really decoding
- divide clHCA_Decode into clHCA_DecodeHeader and clHCA_DecodeBlock to
clarify usage
- unify clHCA_IsOurFile0/1 since one would need to call
clHCA_DecodeHeader right after it anyway
- add clHCA_SetKey for easier key handling
- adapt vgmstream wrapper
- Removed some overdone optimizations for clarity (don't seem to save
any substantial time when decoding +150 files)
- Remove unnecessary structs
- Treat keycode as a single 64b value
- Lib info and other tweaks
- Properly identify variables/functions/etc, all thanks to
Thealexbarney's excellent decoder analysis in VGAudio
- Simplify code to standard C, rather than asm-style decompilation
- Rename/tweak functions to be more C-like
- Minor fixes (pointer tests, incorrect values, etc)
- All was carefully tested, decoded files should be byte-identical to
previous versions
Decoder has been modified a bit so it's easier to feed an arbitrary
number of discard samples (or at least, easier for me to understand),
since encoder delay can be >1024 (frame size) and would make some calcs
go all wobbly
Formats using custom layouts tend to be weird enough that it's a pain to
add support directly in the decoder.
Instead should use custom layouts and I/O streamfiles that, though a bit
wordy and unwieldy at the moment, are a lot more flexible.