diff --git a/src/engine/platform/genesis.cpp b/src/engine/platform/genesis.cpp index 81ddd148c..65486192e 100644 --- a/src/engine/platform/genesis.cpp +++ b/src/engine/platform/genesis.cpp @@ -249,7 +249,15 @@ void DivPlatformGenesis::acquire_nuked(short* bufL, short* bufR, size_t start, s OPN2_Clock(&fm,o); os[0]+=o[0]; os[1]+=o[1]; //OPN2_Write(&fm,0,0); - oscBuf[i]->data[oscBuf[i]->needle++]=fm.ch_out[i]<<7; + if (i==5) { + if (fm.dacen) { + oscBuf[i]->data[oscBuf[i]->needle++]=fm.dacdata<<7; + } else { + oscBuf[i]->data[oscBuf[i]->needle++]=fm.ch_out[i]<<7; + } + } else { + oscBuf[i]->data[oscBuf[i]->needle++]=fm.ch_out[i]<<7; + } } os[0]=(os[0]<<5); @@ -293,7 +301,15 @@ void DivPlatformGenesis::acquire_ymfm(short* bufL, short* bufR, size_t start, si //OPN2_Write(&fm,0,0); for (int i=0; i<6; i++) { - oscBuf[i]->data[oscBuf[i]->needle++]=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1))<<6; + if (i==5) { + if (fm_ymfm->debug_dac_enable()) { + oscBuf[i]->data[oscBuf[i]->needle++]=fm_ymfm->debug_dac_data()<<7; + } else { + oscBuf[i]->data[oscBuf[i]->needle++]=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1))<<6; + } + } else { + oscBuf[i]->data[oscBuf[i]->needle++]=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1))<<6; + } } if (os[0]<-32768) os[0]=-32768; diff --git a/src/engine/platform/sound/ymfm/ymfm_opn.h b/src/engine/platform/sound/ymfm/ymfm_opn.h index 74d2b01dd..34dc065d7 100644 --- a/src/engine/platform/sound/ymfm/ymfm_opn.h +++ b/src/engine/platform/sound/ymfm/ymfm_opn.h @@ -778,6 +778,10 @@ public: // get the engine fm_engine* debug_engine() { return &m_fm; } + // get DAC state + uint16_t debug_dac_data() { return m_dac_data; } + uint8_t debug_dac_enable() { return m_dac_enable; } + protected: // simulate the DAC discontinuity constexpr int32_t dac_discontinuity(int32_t value) const { return (value < 0) ? (value - 2) : (value + 3); }