Overhauled SB DSP IRQ's and masking and also how it attaches to the MPU-401, fixes IBM OS/2 2.11 among other things.

This commit is contained in:
OBattler
2020-04-12 00:18:55 +02:00
parent ac5a993b3f
commit 28115c4650
6 changed files with 219 additions and 116 deletions

View File

@@ -72,8 +72,7 @@ typedef struct mpu_t
{
uint16_t addr;
int uart_mode, intelligent,
irq, irq_mask,
midi_thru,
irq, midi_thru,
queue_pos, queue_used;
uint8_t rx_data, is_mca,
status,
@@ -135,12 +134,15 @@ typedef struct mpu_t
uint16_t prchg_mask;
} filter;
struct {
int on;
uint8_t chan, trmask;
uint32_t key[4];
int on;
uint8_t chan, trmask;
uint32_t key[4];
} chanref[5], inputref[16];
pc_timer_t mpu401_event_callback, mpu401_eoi_callback,
mpu401_reset_callback;
void (*ext_irq_update)(void *priv, int set);
int (*ext_irq_pending)(void *priv);
void *priv;
} mpu_t;
extern int mpu401_standalone_enable, mpu401_already_loaded;
@@ -154,6 +156,7 @@ extern void mpu401_setirq(mpu_t *mpu, int irq);
extern void mpu401_change_addr(mpu_t *mpu, uint16_t addr);
extern void mpu401_init(mpu_t *mpu, uint16_t addr, int irq, int mode, int receive_input);
extern void mpu401_device_add(void);
extern void mpu401_irq_attach(mpu_t *mpu, void (*ext_irq_update)(void *priv, int set), int (*ext_irq_pending)(void *priv), void *priv);
extern int MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort);
extern void MPU401_InputMsg(void *p, uint8_t *msg);

View File

@@ -62,8 +62,8 @@ typedef struct sb_dsp_t
uint8_t sb_test;
int sb_timei, sb_timeo;
int sb_irq8, sb_irq16;
int sb_irqm8, sb_irqm16;
int sb_irq8, sb_irq16, sb_irq401;
int sb_irqm8, sb_irqm16, sb_irqm401;
uint8_t sb_asp_regs[256];
@@ -91,6 +91,8 @@ typedef struct sb_dsp_t
int pos;
uint8_t azt_eeprom[AZTECH_EEPROM_SIZE]; /* the eeprom in the Aztech cards is attached to the DSP */
mpu_t *mpu;
} sb_dsp_t;
@@ -98,7 +100,7 @@ void sb_dsp_input_msg(void *p, uint8_t *msg);
int sb_dsp_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort);
void sb_dsp_set_mpu(mpu_t *src_mpu);
void sb_dsp_set_mpu(sb_dsp_t *dsp, mpu_t *src_mpu);
void sb_dsp_init(sb_dsp_t *dsp, int type, int subtype, void *parent);
void sb_dsp_close(sb_dsp_t *dsp);
@@ -115,5 +117,6 @@ void sb_dsp_poll(sb_dsp_t *dsp, int16_t *l, int16_t *r);
void sb_dsp_set_stereo(sb_dsp_t *dsp, int stereo);
void sb_dsp_update(sb_dsp_t *dsp);
void sb_update_irq(sb_dsp_t *dsp);
#endif /* SOUND_SND_SB_DSP_H */