Workaround for bad AWE32 ROM dumps created by AWE-DUMP - Win95 AWE32 drivers now work with these dumps.

EMU8000 now updates CVCF/VTFT with current/target volume - Win95 AWE32 drivers now no longer cut off notes early.
Set SB DSP version for AWE32 to v4.13.
This commit is contained in:
TomW 2013-11-10 16:40:52 +00:00
commit 2c1e691c1a
3 changed files with 17 additions and 2 deletions

View file

@ -554,6 +554,7 @@ void emu8k_poll(void *p)
{
case ENV_ATTACK:
emu8k->voice[c].env_vol += emu8k->voice[c].env_attack;
emu8k->voice[c].vtft |= 0xffff0000;
if (emu8k->voice[c].env_vol >= (1 << 21))
{
emu8k->voice[c].env_vol = 1 << 21;
@ -563,6 +564,7 @@ void emu8k_poll(void *p)
case ENV_DECAY:
emu8k->voice[c].env_vol -= emu8k->voice[c].env_decay;
emu8k->voice[c].vtft = (emu8k->voice[c].vtft & ~0xffff0000) | ((emu8k->voice[c].env_sustain >> 5) << 16);
if (emu8k->voice[c].env_vol <= emu8k->voice[c].env_sustain)
{
emu8k->voice[c].env_vol = emu8k->voice[c].env_sustain;
@ -572,6 +574,7 @@ void emu8k_poll(void *p)
case ENV_RELEASE:
emu8k->voice[c].env_vol -= emu8k->voice[c].env_release;
emu8k->voice[c].vtft &= ~0xffff0000;
if (emu8k->voice[c].env_vol <= 0)
{
emu8k->voice[c].env_vol = 0;
@ -580,6 +583,11 @@ void emu8k_poll(void *p)
break;
}
if (emu8k->voice[c].env_vol >= (1 << 21))
emu8k->voice[c].cvcf &= ~0xffff0000;
else
emu8k->voice[c].cvcf = (emu8k->voice[c].cvcf & ~0xffff0000) | ((emu8k->voice[c].env_vol >> 5) << 16);
switch (emu8k->voice[c].menv_state)
{
case ENV_ATTACK:
@ -649,6 +657,13 @@ void emu8k_init(emu8k_t *emu8k)
fread(emu8k->rom, 1024 * 1024, 1, f);
fclose(f);
/*AWE-DUMP creates ROM images offset by 2 bytes, so if we detect this
then correct it*/
if (emu8k->rom[3] == 0x314d && emu8k->rom[4] == 0x474d)
{
memcpy(&emu8k->rom[0], &emu8k->rom[1], (1024 * 1024) - 2);
emu8k->rom[0x7ffff] = 0;
}
io_sethandler(0x0620, 0x0004, emu8k_inb, emu8k_inw, NULL, emu8k_outb, emu8k_outw, NULL, emu8k);
io_sethandler(0x0a20, 0x0004, emu8k_inb, emu8k_inw, NULL, emu8k_outb, emu8k_outw, NULL, emu8k);
io_sethandler(0x0e20, 0x0004, emu8k_inb, emu8k_inw, NULL, emu8k_outb, emu8k_outw, NULL, emu8k);

View file

@ -387,7 +387,7 @@ void *sb_awe32_init()
memset(sb, 0, sizeof(sb_t));
opl3_init(&sb->opl);
sb_dsp_init(&sb->dsp, SB16);
sb_dsp_init(&sb->dsp, SB16 + 1);
sb_dsp_setaddr(&sb->dsp, 0x0220);
sb_mixer_init(&sb->mixer);
io_sethandler(0x0220, 0x0004, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &sb->opl);

View file

@ -49,7 +49,7 @@ static int sb_commands[256]=
};
char sb16_copyright[] = "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992.";
uint16_t sb_dsp_versions[] = {0, 0, 0x105, 0x200, 0x201, 0x300, 0x302, 0x405};
uint16_t sb_dsp_versions[] = {0, 0, 0x105, 0x200, 0x201, 0x300, 0x302, 0x405, 0x40d};
/*These tables were 'borrowed' from DOSBox*/
int8_t scaleMap4[64] = {