Cleaning
This commit is contained in:
@@ -419,7 +419,7 @@ sb_get_music_buffer_sb16_awe32(int32_t *buffer, const int len, void *priv)
|
||||
const sb_ct1745_mixer_t *mixer = &sb->mixer_sb16;
|
||||
const int dsp_rec_pos = sb->dsp.record_pos_write;
|
||||
double bass_treble;
|
||||
const int32_t *opl_buf = NULL;
|
||||
const int32_t *opl_buf = NULL;
|
||||
|
||||
if (sb->opl_enabled)
|
||||
opl_buf = sb->opl.update(sb->opl.priv);
|
||||
@@ -1812,8 +1812,8 @@ sb_mcv_read(int port, void *priv)
|
||||
void
|
||||
sb_mcv_write(int port, uint8_t val, void *priv)
|
||||
{
|
||||
uint16_t addr;
|
||||
sb_t *sb = (sb_t *) priv;
|
||||
uint16_t addr = 0;
|
||||
sb_t *sb = (sb_t *) priv;
|
||||
|
||||
if (port < 0x102)
|
||||
return;
|
||||
@@ -1876,8 +1876,8 @@ sb_pro_mcv_read(int port, void *priv)
|
||||
static void
|
||||
sb_pro_mcv_write(int port, uint8_t val, void *priv)
|
||||
{
|
||||
uint16_t addr;
|
||||
sb_t *sb = (sb_t *) priv;
|
||||
uint16_t addr = 0;
|
||||
sb_t *sb = (sb_t *) priv;
|
||||
|
||||
if (port < 0x102)
|
||||
return;
|
||||
@@ -1947,8 +1947,8 @@ sb_16_reply_mca_read(int port, void *priv)
|
||||
static void
|
||||
sb_16_reply_mca_write(const int port, const uint8_t val, void *priv)
|
||||
{
|
||||
uint16_t addr;
|
||||
sb_t *sb = (sb_t *) priv;
|
||||
uint16_t addr = 0;
|
||||
sb_t *sb = (sb_t *) priv;
|
||||
|
||||
if (port < 0x102)
|
||||
return;
|
||||
|
||||
@@ -1836,31 +1836,31 @@ sb_do_reset(sb_dsp_t *dsp, const uint8_t v)
|
||||
}
|
||||
|
||||
void
|
||||
sb_write(uint16_t a, uint8_t v, void *priv)
|
||||
sb_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
sb_dsp_t *dsp = (sb_dsp_t *) priv;
|
||||
|
||||
sb_dsp_log("[%04X:%08X] DSP: [W] %04X = %02X\n", CS, cpu_state.pc, a, v);
|
||||
sb_dsp_log("[%04X:%08X] DSP: [W] %04X = %02X\n", CS, cpu_state.pc, addr, val);
|
||||
|
||||
/* Sound Blasters prior to Sound Blaster 16 alias the I/O ports. */
|
||||
if ((dsp->sb_type < SB16) && (IS_NOT_ESS(dsp) || ((a & 0xF) != 0xE)))
|
||||
a &= 0xfffe;
|
||||
if ((dsp->sb_type < SB16) && (IS_NOT_ESS(dsp) || ((addr & 0xF) != 0xE)))
|
||||
addr &= 0xfffe;
|
||||
|
||||
switch (a & 0xF) {
|
||||
switch (addr & 0xF) {
|
||||
case 6: /* Reset */
|
||||
sb_do_reset(dsp, v);
|
||||
sb_do_reset(dsp, val);
|
||||
|
||||
if (!(v & 2) && (dsp->espcm_fifo_reset & 2)) {
|
||||
if (!(val & 2) && (dsp->espcm_fifo_reset & 2)) {
|
||||
fifo_reset(dsp->espcm_fifo);
|
||||
}
|
||||
dsp->espcm_fifo_reset = v;
|
||||
dsp->espcm_fifo_reset = val;
|
||||
dsp->uart_midi = 0;
|
||||
dsp->uart_irq = 0;
|
||||
dsp->onebyte_midi = 0;
|
||||
return;
|
||||
case 0xC: /* Command/data write */
|
||||
if (dsp->uart_midi || dsp->onebyte_midi) {
|
||||
midi_raw_out_byte(v);
|
||||
midi_raw_out_byte(val);
|
||||
dsp->onebyte_midi = 0;
|
||||
return;
|
||||
}
|
||||
@@ -1873,8 +1873,8 @@ sb_write(uint16_t a, uint8_t v, void *priv)
|
||||
return;
|
||||
}
|
||||
if (dsp->sb_data_stat == -1) {
|
||||
dsp->sb_command = v;
|
||||
if (v == 0x01)
|
||||
dsp->sb_command = val;
|
||||
if (val == 0x01)
|
||||
sb_add_data(dsp, 0);
|
||||
dsp->sb_data_stat++;
|
||||
if (IS_AZTECH(dsp)) {
|
||||
@@ -1901,7 +1901,7 @@ sb_write(uint16_t a, uint8_t v, void *priv)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dsp->sb_data[dsp->sb_data_stat++] = v;
|
||||
dsp->sb_data[dsp->sb_data_stat++] = val;
|
||||
}
|
||||
if (dsp->sb_data_stat == sb_commands[dsp->sb_command] || sb_commands[dsp->sb_command] == -1) {
|
||||
sb_exec_command(dsp);
|
||||
@@ -1920,17 +1920,17 @@ sb_write(uint16_t a, uint8_t v, void *priv)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
sb_read(uint16_t a, void *priv)
|
||||
sb_read(uint16_t addr, void *priv)
|
||||
{
|
||||
sb_dsp_t *dsp = (sb_dsp_t *) priv;
|
||||
uint8_t ret = 0x00;
|
||||
|
||||
/* Sound Blasters prior to Sound Blaster 16 alias the I/O ports. */
|
||||
if ((dsp->sb_type < SB16) && (IS_NOT_ESS(dsp) || ((a & 0xF) != 0xF)))
|
||||
if ((dsp->sb_type < SB16) && (IS_NOT_ESS(dsp) || ((addr & 0xF) != 0xF)))
|
||||
/* Exception: ESS AudioDrive does not alias port base+0xf */
|
||||
a &= 0xfffe;
|
||||
addr &= 0xfffe;
|
||||
|
||||
switch (a & 0xf) {
|
||||
switch (addr & 0xf) {
|
||||
case 0x6:
|
||||
if (IS_ESS(dsp)) {
|
||||
ret = (dsp->espcm_fifo_reset & 0x03) | 0x08 | (dsp->activity & 0xe0);
|
||||
|
||||
Reference in New Issue
Block a user