pps support

This commit is contained in:
Eknous-P 2025-06-15 17:31:32 +04:00
parent b374932ce2
commit 0426cf3a71

View file

@ -92,23 +92,14 @@ void DivEngine::loadPPS(SafeReader& reader, std::vector<DivSample*>& ret, String
s->rate = PPS_SAMPLE_RATE; s->rate = PPS_SAMPLE_RATE;
s->centerRate = PPS_SAMPLE_RATE; s->centerRate = PPS_SAMPLE_RATE;
s->depth = DIV_SAMPLE_DEPTH_8BIT; s->depth = DIV_SAMPLE_DEPTH_4BIT;
s->init(headers[i].sample_length*2); //byte per sample s->init(headers[i].sample_length*2); //byte per sample
reader.seek((int)headers[i].start_pointer, SEEK_SET); reader.seek((int)headers[i].start_pointer, SEEK_SET);
int sample_pos = 0;
for(int j = 0; j < headers[i].sample_length; j++) for(int j = 0; j < headers[i].sample_length; j++)
{ {
unsigned char curr_byte = (unsigned char)reader.readC(); s->data4[j] = reader.readC();
s->data8[sample_pos] = (curr_byte >> 4) | (curr_byte & 0xf0);
s->data8[sample_pos] += 0x80;
sample_pos++;
s->data8[sample_pos] = (curr_byte << 4) | (curr_byte & 0xf);
s->data8[sample_pos] += 0x80;
sample_pos++;
} }
ret.push_back(s); ret.push_back(s);