Some changes in preparation for the not yet committable PAS16 changes.

This commit is contained in:
OBattler
2024-03-27 19:55:34 +01:00
parent 7a4a44d1d1
commit f48b710206
6 changed files with 97 additions and 19 deletions

View File

@@ -422,4 +422,31 @@ low_fir_sb16(int c, int i, double NewSample)
return out;
}
extern double low_fir_pas16_coef[4][SB16_NCoef];
static inline double
low_fir_pas16(int c, int i, double NewSample)
{
static double x[4][2][SB16_NCoef + 1]; // input samples
static int pos[4] = { 0, 0, 0, 0 };
double out = 0.0;
int n;
/* Calculate the new output */
x[c][i][pos[c]] = NewSample;
for (n = 0; n < ((SB16_NCoef + 1) - pos[c]) && n < SB16_NCoef; n++)
out += low_fir_pas16_coef[c][n] * x[c][i][n + pos[c]];
for (; n < SB16_NCoef; n++)
out += low_fir_pas16_coef[c][n] * x[c][i][(n + pos[c]) - (SB16_NCoef + 1)];
if (i == 1) {
pos[c]++;
if (pos[c] > SB16_NCoef)
pos[c] = 0;
}
return out;
}
#endif /*EMU_FILTERS_H*/

View File

@@ -113,6 +113,7 @@ extern double AGPCLK;
extern uint64_t PITCONST;
extern uint64_t PAS16CONST;
extern uint64_t PAS16CONST2;
extern uint64_t ISACONST;
extern uint64_t CGACONST;
extern uint64_t MDACONST;
@@ -123,13 +124,19 @@ extern uint64_t RTCCONST;
extern int refresh_at_enable;
extern void pit_change_pas16_const(double prescale);
extern void pit_device_reset(pit_t *dev);
extern void pit_change_pas16_consts(double prescale);
extern void pit_set_pit_const(void *data, uint64_t pit_const);
extern void ctr_clock(void *data, int counter_id);
/* Sets a counter's CLOCK input. */
extern void pit_ctr_set_clock(ctr_t *ctr, int clock, void *priv);
extern void pit_ctr_set_gate(void *data, int counter_id, int gate);
extern void pit_ctr_set_out_func(void *data, int counter_id, void (*func)(int new_out, int old_out, void *priv));
extern void pit_ctr_set_using_timer(void *data, int counter_id, int using_timer);

View File

@@ -71,10 +71,22 @@ typedef struct pitf_t {
ctrf_t counters[3];
uint8_t ctrl;
void *dev_priv;
} pitf_t;
extern void pitf_set_pit_const(void *data, uint64_t pit_const);
extern void pitf_handler(int set, uint16_t base, int size, void *priv);
extern void pitf_ctr_set_out_func(void *data, int counter_id, void (*func)(int new_out, int old_out, void *priv));
extern void pitf_ctr_set_using_timer(void *data, int counter_id, int using_timer);
extern void pitf_ctr_set_gate(void *data, int counter_id, int gate);
extern void pitf_ctr_clock(void *data, int counter_id);
extern uint8_t pitf_read_reg(void *priv, uint8_t reg);
extern const pit_intf_t pit_fast_intf;

View File

@@ -124,6 +124,7 @@ extern const device_t cms_device;
extern const device_t gus_device;
/* Pro Audio Spectrum 16 */
extern const device_t pasplus_device;
extern const device_t pas16_device;
/* IBM PS/1 Audio Card */