mirror of
https://github.com/libretro/beetle-pce-fast-libretro.git
synced 2024-11-27 10:00:24 +00:00
remove treble_eq
This commit is contained in:
parent
cd1245c3d0
commit
b2b419c7bf
@ -292,7 +292,6 @@ bool PCE_InitCD(void)
|
||||
|
||||
cd_settings.ADPCM_Volume = (double)MDFN_GetSettingUI("pce_fast.adpcmvolume") /
|
||||
100;
|
||||
cd_settings.ADPCM_LPF = MDFN_GetSettingB("pce_fast.adpcmlp");
|
||||
|
||||
if (cd_settings.CDDA_Volume != 1.0)
|
||||
MDFN_printf(("CD-DA Volume: %d%%\n"), (int)(100 * cd_settings.CDDA_Volume));
|
||||
|
@ -185,7 +185,7 @@ void Blip_Synth_Fast_::volume_unit(double new_unit)
|
||||
delta_factor = int (new_unit * (1L << blip_sample_bits) + 0.5);
|
||||
}
|
||||
|
||||
long Blip_Buffer_read_samples(Blip_Buffer* bbuf, blip_sample_t* BLIP_RESTRICT out,
|
||||
long Blip_Buffer_read_samples(Blip_Buffer* bbuf, blip_sample_t* out,
|
||||
long max_samples)
|
||||
{
|
||||
long count = Blip_Buffer_samples_avail(bbuf);
|
||||
|
@ -166,29 +166,6 @@ public:
|
||||
|
||||
void volume_unit(double);
|
||||
Blip_Synth_Fast_();
|
||||
void treble_eq(blip_eq_t const &) { }
|
||||
};
|
||||
|
||||
class Blip_Synth_
|
||||
{
|
||||
public:
|
||||
Blip_Buffer* buf;
|
||||
int last_amp;
|
||||
int delta_factor;
|
||||
|
||||
void volume_unit(double);
|
||||
Blip_Synth_(short* impulses, int width);
|
||||
void treble_eq(blip_eq_t const &);
|
||||
private:
|
||||
double volume_unit_;
|
||||
short* const impulses;
|
||||
int const width;
|
||||
blip_long kernel_unit;
|
||||
int impulses_size() const
|
||||
{
|
||||
return blip_res / 2 * width + 1;
|
||||
}
|
||||
void adjust_impulse();
|
||||
};
|
||||
|
||||
// Quality level. Start with blip_good_quality.
|
||||
@ -209,12 +186,6 @@ public:
|
||||
impl.volume_unit(v * (1.0 / (range < 0 ? -range : range)));
|
||||
}
|
||||
|
||||
// Configure low-pass filter (see blip_buffer.txt)
|
||||
void treble_eq(blip_eq_t const &eq)
|
||||
{
|
||||
impl.treble_eq(eq);
|
||||
}
|
||||
|
||||
// Get/set Blip_Buffer used for output
|
||||
Blip_Buffer* output() const
|
||||
{
|
||||
@ -232,9 +203,9 @@ public:
|
||||
|
||||
// Low-level interface
|
||||
|
||||
// Add an amplitude transition of specified delta, optionally into specified buffer
|
||||
// rather than the one set with output(). Delta can be positive or negative.
|
||||
// The actual change in amplitude is delta * (volume / range)
|
||||
// // Add an amplitude transition of specified delta, optionally into specified buffer
|
||||
// // rather than the one set with output(). Delta can be positive or negative.
|
||||
// // The actual change in amplitude is delta * (volume / range)
|
||||
void offset(blip_time_t, int delta, Blip_Buffer*) const;
|
||||
void offset(blip_time_t t, int delta) const
|
||||
{
|
||||
@ -258,36 +229,14 @@ private:
|
||||
Blip_Synth_Fast_ impl;
|
||||
};
|
||||
|
||||
// Low-pass equalization parameters
|
||||
class blip_eq_t
|
||||
{
|
||||
public:
|
||||
// Logarithmic rolloff to treble dB at half sampling rate. Negative values reduce
|
||||
// treble, small positive values (0 to 5.0) increase treble.
|
||||
blip_eq_t(double treble_db = 0);
|
||||
|
||||
// See blip_buffer.txt
|
||||
blip_eq_t(double treble, long rolloff_freq, long sample_rate,
|
||||
long cutoff_freq = 0);
|
||||
|
||||
private:
|
||||
double treble;
|
||||
long rolloff_freq;
|
||||
long sample_rate;
|
||||
long cutoff_freq;
|
||||
void generate(float* out, int count) const;
|
||||
friend class Blip_Synth_;
|
||||
};
|
||||
|
||||
int const blip_sample_bits = 30;
|
||||
|
||||
#define BLIP_RESTRICT
|
||||
|
||||
// Optimized reading from Blip_Buffer, for use in custom sample output
|
||||
|
||||
// Begin reading from buffer. Name should be unique to the current block.
|
||||
#define BLIP_READER_BEGIN( name, blip_buffer ) \
|
||||
const blip_buf_t_* BLIP_RESTRICT name##_reader_buf = (blip_buffer).buffer;\
|
||||
const blip_buf_t_* name##_reader_buf = (blip_buffer).buffer;\
|
||||
blip_long name##_reader_accum = (blip_buffer).reader_accum
|
||||
|
||||
// Get value to pass to BLIP_READER_NEXT()
|
||||
@ -331,7 +280,7 @@ blip_inline void Blip_Synth<quality, range>::offset_resampled(
|
||||
// need for a longer buffer as set by set_sample_rate().
|
||||
assert((blip_long)(time >> BLIP_BUFFER_ACCURACY) < blip_buf->buffer_size);
|
||||
delta *= impl.delta_factor;
|
||||
blip_long* BLIP_RESTRICT buf = blip_buf->buffer + (time >>
|
||||
blip_long* buf = blip_buf->buffer + (time >>
|
||||
BLIP_BUFFER_ACCURACY);
|
||||
int phase = (int)(time >> (BLIP_BUFFER_ACCURACY - BLIP_PHASE_BITS) &
|
||||
(blip_res - 1));
|
||||
@ -367,11 +316,6 @@ blip_inline void Blip_Synth<quality, range>::update(blip_time_t t, int amp)
|
||||
offset_resampled(t * impl.buf->factor + impl.buf->offset, delta, impl.buf);
|
||||
}
|
||||
|
||||
blip_inline blip_eq_t::blip_eq_t(double t) :
|
||||
treble(t), rolloff_freq(0), sample_rate(44100), cutoff_freq(0) { }
|
||||
blip_inline blip_eq_t::blip_eq_t(double t, long rf, long sr, long cf) :
|
||||
treble(t), rolloff_freq(rf), sample_rate(sr), cutoff_freq(cf) { }
|
||||
|
||||
blip_inline int Blip_Buffer_length(Blip_Buffer* bbuf)
|
||||
{
|
||||
return bbuf->length;
|
||||
|
@ -85,8 +85,6 @@ bool MDFN_GetSettingB(const char* name)
|
||||
return 0;
|
||||
if (!strcmp("pce_fast.disable_softreset", name))
|
||||
return 0;
|
||||
if (!strcmp("pce_fast.adpcmlp", name))
|
||||
return 0;
|
||||
if (!strcmp("pce_fast.correct_aspect", name))
|
||||
return setting_pce_keepaspect;
|
||||
/* CDROM */
|
||||
|
@ -64,7 +64,6 @@ typedef Blip_Synth<blip_good_quality, 16384> ADSynth;
|
||||
static ADSynth ADPCMSynth;
|
||||
static OKIADPCM_Decoder<OKIADPCM_MSM5205> MSM5205;
|
||||
|
||||
static bool ADPCMLP;
|
||||
typedef struct
|
||||
{
|
||||
uint8* RAM; // = NULL; //0x10000;
|
||||
@ -79,7 +78,6 @@ typedef struct
|
||||
|
||||
uint8 LastCmd;
|
||||
uint32 SampleFreq;
|
||||
uint32 LPF_SampleFreq;
|
||||
|
||||
uint8 PlayBuffer;
|
||||
uint8 ReadBuffer;
|
||||
@ -128,28 +126,6 @@ static INLINE void Fader_SyncWhich(void)
|
||||
}
|
||||
|
||||
|
||||
static void RedoLPF(int f)
|
||||
{
|
||||
if (sbuf[0] && sbuf[1])
|
||||
{
|
||||
if (ADPCMLP)
|
||||
{
|
||||
if (f >= 14)
|
||||
{
|
||||
int rolloff = (int)((((double)32087.5 / (16 - f)) / 2) * 0.70);
|
||||
ADPCMSynth.treble_eq(blip_eq_t(-1000, rolloff, sbuf[0]->sample_rate));
|
||||
}
|
||||
else
|
||||
{
|
||||
int rolloff = (int)((((double)32087.5 / (16 - f)) / 2) * 0.80);
|
||||
ADPCMSynth.treble_eq(blip_eq_t(-1000, rolloff, sbuf[0]->sample_rate));
|
||||
}
|
||||
}
|
||||
else
|
||||
ADPCMSynth.treble_eq(-8.0);
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE int32 ADPCM_ClocksToNextEvent(void)
|
||||
{
|
||||
#ifdef PCE_FAST_CD_SPEEDHACK
|
||||
@ -271,7 +247,6 @@ bool PCECD_SetSettings(const PCECD_Settings* settings)
|
||||
Fader_SyncWhich();
|
||||
|
||||
ADPCMSynth.volume(0.42735f * (settings ? settings->ADPCM_Volume : 1.0));
|
||||
ADPCMLP = settings ? settings->ADPCM_LPF : 0;
|
||||
|
||||
PCECD_Drive_SetTransferRate(126000 * (settings ? settings->CD_Speed : 1));
|
||||
|
||||
@ -345,9 +320,7 @@ void PCECD_Power(uint32 timestamp)
|
||||
MSM5205.SetSSI(0);
|
||||
|
||||
ADPCM.SampleFreq = 0;
|
||||
ADPCM.LPF_SampleFreq = 0;
|
||||
ADPCM.bigdiv = ADPCM.bigdivacc * (16 - ADPCM.SampleFreq);
|
||||
RedoLPF(ADPCM.LPF_SampleFreq);
|
||||
|
||||
ADPCM.Addr = 0;
|
||||
ADPCM.ReadAddr = 0;
|
||||
@ -917,11 +890,6 @@ void PCECD_Run(uint32 in_timestamp)
|
||||
|
||||
void PCECD_ResetTS(void)
|
||||
{
|
||||
if (ADPCM.SampleFreq != ADPCM.LPF_SampleFreq)
|
||||
{
|
||||
ADPCM.LPF_SampleFreq = ADPCM.SampleFreq;
|
||||
RedoLPF(ADPCM.LPF_SampleFreq);
|
||||
}
|
||||
PCECD_Drive_ResetTS();
|
||||
lastts = 0;
|
||||
}
|
||||
@ -966,7 +934,6 @@ static int ADPCM_StateAction(StateMem* sm, int load, int data_only)
|
||||
{
|
||||
MSM5205.SetSample(ad_sample);
|
||||
MSM5205.SetSSI(ad_ref_index);
|
||||
RedoLPF(ADPCM.SampleFreq);
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ typedef struct
|
||||
|
||||
unsigned int CD_Speed;
|
||||
|
||||
bool ADPCM_LPF;
|
||||
} PCECD_Settings;
|
||||
|
||||
void PCECD_Run(uint32 in_timestamp);
|
||||
|
@ -1288,7 +1288,6 @@ void PCECD_Drive_Init(int cdda_time_div, Blip_Buffer* leftbuf,
|
||||
|
||||
cdda.CDDAVolume = 65536;
|
||||
cdda.CDDASynth.volume(1.0f / 65536);
|
||||
cdda.CDDASynth.treble_eq(0);
|
||||
sbuf[0] = leftbuf;
|
||||
sbuf[1] = rightbuf;
|
||||
|
||||
|
@ -150,7 +150,6 @@ void PSG_RecalcNoiseFreqCache(int chnum)
|
||||
void PSG_init(Blip_Buffer* bb_l, Blip_Buffer* bb_r)
|
||||
{
|
||||
//printf("Test: %u, %u\n", sizeof(psg_channel), (uint8*)&psg.channel[0].balance - (uint8*)&psg.channel[0].waveform[0]);
|
||||
psg.Synth.treble_eq(-2.0);
|
||||
|
||||
psg.sbuf[0] = bb_l;
|
||||
psg.sbuf[1] = bb_r;
|
||||
|
Loading…
Reference in New Issue
Block a user