IT import: prepare load compressed stereo samples

This commit is contained in:
tildearrow 2024-07-08 18:57:56 -05:00
parent bbdc215ed5
commit f204c11204
2 changed files with 12 additions and 9 deletions

View file

@ -1,8 +1,3 @@
# to-do for 0.6.6
- fix possible issues when moving selection
- fix Metal intro crash
# to-do long term
- CSM macros
@ -10,3 +5,5 @@
- new pattern renderer - performance improvements
- new info header
- unlimited channels and chips
- fix possible issues when moving selection
- fix Metal intro crash

View file

@ -641,11 +641,17 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) {
if (flags&8) { // compressed sample
unsigned int ret=0;
logV("decompression begin...");
if (s->depth==DIV_SAMPLE_DEPTH_16BIT) {
ret=it_decompress16(s->data16,s->samples,&file[reader.tell()],len-reader.tell(),(convert&4)?1:0,(flags&4)?2:1);
logV("decompression begin... (%d)",s->samples);
if (flags&4) {
logW("STEREO!");
} else {
ret=it_decompress8(s->data8,s->samples,&file[reader.tell()],len-reader.tell(),(convert&4)?1:0,(flags&4)?2:1);
if (s->depth==DIV_SAMPLE_DEPTH_16BIT) {
logV("16-bit");
ret=it_decompress16(s->data16,s->samples,&file[reader.tell()],len-reader.tell(),(convert&4)?1:0,(flags&4)?2:1);
} else {
logV("8-bit");
ret=it_decompress8(s->data8,s->samples,&file[reader.tell()],len-reader.tell(),(convert&4)?1:0,(flags&4)?2:1);
}
}
logV("got: %d",ret);
} else {