MSM5232: per-chan osc

This commit is contained in:
tildearrow 2022-10-04 02:35:32 -05:00
parent c2b75d26d7
commit 8ab0d28ace
3 changed files with 18 additions and 7 deletions

View file

@ -54,9 +54,15 @@ void DivPlatformMSM5232::acquire(short* bufL, short* bufR, size_t start, size_t
}
memset(temp,0,16*sizeof(short));
/*for (int i=0; i<8; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP((pce->channel[i].blip_prev_samp[0]+pce->channel[i].blip_prev_samp[1])<<1,-32768,32767);
}*/
for (int i=0; i<8; i++) {
int o=(
((regPool[12+(i>>4)]&1)?((msm->vo16[i]*partVolume[3+(i&4)])>>8):0)+
((regPool[12+(i>>4)]&2)?((msm->vo8[i]*partVolume[2+(i&4)])>>8):0)+
((regPool[12+(i>>4)]&4)?((msm->vo4[i]*partVolume[1+(i&4)])>>8):0)+
((regPool[12+(i>>4)]&8)?((msm->vo2[i]*partVolume[i&4])>>8):0)
)<<3;
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(o,-32768,32767);
}
msm->sound_stream_update(temp);

View file

@ -596,10 +596,10 @@ void msm5232_device::TG_group_advance(int groupidx)
/* calculate signed output */
if (!voi->mute) {
o16 += ( (out16-(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
o8 += ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
o4 += ( (out4 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
o2 += ( (out2 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
o16 += vo16[groupidx*4+(4-i)] = ( (out16-(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
o8 += vo8 [groupidx*4+(4-i)] = ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
o4 += vo4 [groupidx*4+(4-i)] = ( (out4 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
o2 += vo2 [groupidx*4+(4-i)] = ( (out2 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
if (i == 1 && groupidx == 1)
{

View file

@ -33,6 +33,11 @@ public:
int get_rate();
int vo16[8];
int vo8[8];
int vo4[8];
int vo2[8];
private:
struct VOICE {
uint8_t mode;