From ffdb2befff1ac2dd28e3c0820c03e9ea7445682a Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 6 Oct 2016 09:20:42 +0100 Subject: [PATCH 1/7] Drop the upper bit of the address when shifting left, as described http://wiki.osdev.org/ISA_DMA#16_bit_issues. This fixes 16 bit audio in sb16 diagnose.exe [smf-] --- src/devices/machine/cs4031.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp index 4331747e506..f9d9108597a 100644 --- a/src/devices/machine/cs4031.cpp +++ b/src/devices/machine/cs4031.cpp @@ -362,7 +362,7 @@ READ8_MEMBER( cs4031_device::dma_read_word ) if (m_dma_channel == -1) return 0xff; - UINT16 result = m_space->read_word(page_offset() + (offset << 1)); + UINT16 result = m_space->read_word(page_offset() + ((offset << 1) & 0xffff)); m_dma_high_byte = result >> 8; return result; @@ -373,7 +373,7 @@ WRITE8_MEMBER( cs4031_device::dma_write_word ) if (m_dma_channel == -1) return; - m_space->write_word(page_offset() + (offset << 1), (m_dma_high_byte << 8) | data); + m_space->write_word(page_offset() + ((offset << 1) & 0xffff), (m_dma_high_byte << 8) | data); } WRITE_LINE_MEMBER( cs4031_device::dma2_dack0_w ) From 48774d6c8a8ce3102d492d6703ca6f2458f1ebe5 Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 6 Oct 2016 11:20:09 +0100 Subject: [PATCH 2/7] Applied IBM AT 16-bit DMA wrap round fix to other implementations. (nw) --- src/devices/bus/lpci/southbridge.cpp | 12 ++++++------ src/devices/machine/wd7600.cpp | 4 ++-- src/mame/drivers/ngen.cpp | 12 ++++++------ src/mame/machine/at.cpp | 12 ++++++------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/devices/bus/lpci/southbridge.cpp b/src/devices/bus/lpci/southbridge.cpp index 72959090f7d..14ff2d977de 100644 --- a/src/devices/bus/lpci/southbridge.cpp +++ b/src/devices/bus/lpci/southbridge.cpp @@ -329,7 +329,7 @@ READ8_MEMBER(southbridge_device::pc_dma_read_byte) if(m_dma_channel == -1) return 0xff; UINT8 result; - offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000; + offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16; result = prog_space.read_byte(page_offset + offset); return result; @@ -341,7 +341,7 @@ WRITE8_MEMBER(southbridge_device::pc_dma_write_byte) address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space if(m_dma_channel == -1) return; - offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000; + offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16; prog_space.write_byte(page_offset + offset, data); } @@ -353,9 +353,9 @@ READ8_MEMBER(southbridge_device::pc_dma_read_word) if(m_dma_channel == -1) return 0xff; UINT16 result; - offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFE0000; + offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - result = prog_space.read_word(page_offset + ( offset << 1 ) ); + result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff)); m_dma_high_byte = result & 0xFF00; return result & 0xFF; @@ -367,9 +367,9 @@ WRITE8_MEMBER(southbridge_device::pc_dma_write_word) address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space if(m_dma_channel == -1) return; - offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFE0000; + offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - prog_space.write_word(page_offset + ( offset << 1 ), m_dma_high_byte | data); + prog_space.write_word(page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data); } diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp index b1540fd7bff..4e1844e2a54 100644 --- a/src/devices/machine/wd7600.cpp +++ b/src/devices/machine/wd7600.cpp @@ -372,7 +372,7 @@ READ8_MEMBER( wd7600_device::dma_read_word ) if (m_dma_channel == -1) return 0xff; - UINT16 result = m_space->read_word(page_offset() + (offset << 1)); + UINT16 result = m_space->read_word(page_offset() + ((offset << 1) & 0xffff)); m_dma_high_byte = result >> 8; return result; @@ -383,7 +383,7 @@ WRITE8_MEMBER( wd7600_device::dma_write_word ) if (m_dma_channel == -1) return; - m_space->write_word(page_offset() + (offset << 1), (m_dma_high_byte << 8) | data); + m_space->write_word(page_offset() + ((offset << 1) & 0xffff), (m_dma_high_byte << 8) | data); } WRITE_LINE_MEMBER( wd7600_device::dma2_dack0_w ) diff --git a/src/mame/drivers/ngen.cpp b/src/mame/drivers/ngen.cpp index 0d2dbac5add..2d56c547618 100644 --- a/src/mame/drivers/ngen.cpp +++ b/src/mame/drivers/ngen.cpp @@ -713,11 +713,11 @@ READ8_MEMBER(ngen_state::dma_read_word) if(m_dma_channel == -1) return 0xff; - offs_t page_offset = (((offs_t) m_dma_offset[m_dma_channel]) << 16) & 0xFE0000; + offs_t page_offset = ((offs_t) m_dma_offset[m_dma_channel]) << 16; - result = prog_space.read_word(page_offset + (offset << 1)); + result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff)); m_dma_high_byte = result & 0xFF00; - popmessage("DMA byte address %06x read %04x\n",page_offset+(offset<<1),result); + popmessage("DMA byte address %06x read %04x\n", page_offset + ((offset << 1) & 0xffff),result); return result & 0xff; } @@ -734,10 +734,10 @@ WRITE8_MEMBER(ngen_state::dma_write_word) if(m_dma_channel == -1) return; - offs_t page_offset = (((offs_t) m_dma_offset[m_dma_channel]) << 16) & 0xFE0000; + offs_t page_offset = ((offs_t) m_dma_offset[m_dma_channel]) << 16; - prog_space.write_word(page_offset + (offset << 1), data); - popmessage("DMA byte address %06x write %04x\n",page_offset+(offset<<1), m_dma_high_byte | data); + prog_space.write_word(page_offset + ((offset << 1) & 0xffff), data); + popmessage("DMA byte address %06x write %04x\n", page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data); } diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp index 25cb4eafb1b..c1f3572ea27 100644 --- a/src/mame/machine/at.cpp +++ b/src/mame/machine/at.cpp @@ -266,7 +266,7 @@ READ8_MEMBER(at_mb_device::dma_read_byte) if(m_dma_channel == -1) return 0xff; UINT8 result; - offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000; + offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16; result = prog_space.read_byte(page_offset + offset); return result; @@ -278,7 +278,7 @@ WRITE8_MEMBER(at_mb_device::dma_write_byte) address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space if(m_dma_channel == -1) return; - offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000; + offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16; prog_space.write_byte(page_offset + offset, data); } @@ -290,9 +290,9 @@ READ8_MEMBER(at_mb_device::dma_read_word) if(m_dma_channel == -1) return 0xff; UINT16 result; - offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFE0000; + offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - result = prog_space.read_word(page_offset + ( offset << 1 ) ); + result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff)); m_dma_high_byte = result & 0xFF00; return result & 0xFF; @@ -304,9 +304,9 @@ WRITE8_MEMBER(at_mb_device::dma_write_word) address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space if(m_dma_channel == -1) return; - offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFE0000; + offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - prog_space.write_word(page_offset + ( offset << 1 ), m_dma_high_byte | data); + prog_space.write_word(page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data); } READ8_MEMBER( at_mb_device::dma8237_0_dack_r ) { return m_isabus->dack_r(0); } From d3228d98e485eae24c446d7e237e67348e64ec81 Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 6 Oct 2016 13:23:02 +0100 Subject: [PATCH 3/7] added "headphones" to atapi cd-rom drives [smf] --- src/devices/bus/isa/ide.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/devices/bus/isa/ide.cpp b/src/devices/bus/isa/ide.cpp index be638b76a7f..6508aaa94cd 100644 --- a/src/devices/bus/isa/ide.cpp +++ b/src/devices/bus/isa/ide.cpp @@ -41,9 +41,22 @@ WRITE_LINE_MEMBER(isa16_ide_device::ide_interrupt) } } +static MACHINE_CONFIG_FRAGMENT(cdrom_headphones) + MCFG_DEVICE_MODIFY("cdda") + MCFG_SOUND_ROUTE(0, "lheadphone", 1.0) + MCFG_SOUND_ROUTE(1, "rheadphone", 1.0) + + MCFG_SPEAKER_STANDARD_STEREO("lheadphone", "rheadphone") +MACHINE_CONFIG_END + static MACHINE_CONFIG_FRAGMENT( ide ) MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", nullptr, false) MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(isa16_ide_device, ide_interrupt)) + + MCFG_DEVICE_MODIFY("ide:0") + MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_headphones) + MCFG_DEVICE_MODIFY("ide:1") + MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_headphones) MACHINE_CONFIG_END static INPUT_PORTS_START( ide ) From 38d6d6ace413ffbbc8f3ae3bf5ff8a9fc80537c7 Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 6 Oct 2016 15:06:00 +0200 Subject: [PATCH 4/7] Added mahjong panel to mjsenpu. This kind of arrangement is standard, imho it could be shorthanded or device-ized, pending further investigation. --- src/mame/drivers/cischeat.cpp | 4 +-- src/mame/drivers/mjsenpu.cpp | 59 ++++++++++++++++++++++++++--------- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index 367fb104925..50c2a04b9bb 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -363,7 +363,7 @@ READ16_MEMBER(cischeat_state::wildplt_xy_r) return 0xffff; } -// buttons & sensors are +// buttons & sensors are muxed. bit 0 routes to coin chute (single according to test mode) READ16_MEMBER(cischeat_state::wildplt_mux_r) { UINT16 split_in = 0xffff; @@ -409,7 +409,7 @@ static ADDRESS_MAP_START( wildplt_map, AS_PROGRAM, 16, cischeat_state ) AM_RANGE(0x090000, 0x097fff) AM_RAM AM_SHARE("share2") // Sharedram with sub CPU#2 AM_RANGE(0x098000, 0x09ffff) AM_RAM AM_SHARE("share1") // Sharedram with sub CPU#1 - + /* Only writes to the first 0x40000 bytes affect the tilemaps: */ /* either these games support larger tilemaps or have more ram than needed */ AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll ram 0 diff --git a/src/mame/drivers/mjsenpu.cpp b/src/mame/drivers/mjsenpu.cpp index da8c82d1125..1aa9d03af34 100644 --- a/src/mame/drivers/mjsenpu.cpp +++ b/src/mame/drivers/mjsenpu.cpp @@ -234,28 +234,56 @@ ADDRESS_MAP_END static INPUT_PORTS_START( mjsenpu ) PORT_START("MUX_8F") // in joystick mode? - PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 ) // or button1? seems to have multiple uses - PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MUX_9E") - PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MUX_9D") - PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("MUX_9B") - PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("MUX_97") - PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3",0x08,EQUALS,0x08) + PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW3",0x08,EQUALS,0x00) + PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 ) // or maybe service? @@ -272,7 +300,8 @@ static INPUT_PORTS_START( mjsenpu ) PORT_DIPNAME( 0x00000020, 0x00000020, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00000020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) // not on the mahjong panel? used when in Joystick mode + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CONDITION("DSW3", 0x08,EQUALS,0x00) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08) PORT_DIPNAME( 0x00000080, 0x00000080, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00000080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) @@ -337,7 +366,7 @@ static INPUT_PORTS_START( mjsenpu ) PORT_DIPNAME( 0x00000004, 0x00000004, "Symbol 3" ) PORT_DIPSETTING( 0x00000004, "0" ) PORT_DIPSETTING( 0x00000000, "1" ) - PORT_DIPNAME( 0x00000008, 0x00000000, "Control Type" ) + PORT_DIPNAME( 0x00000008, 0x00000008, "Control Type" ) PORT_DIPSETTING( 0x00000008, "Mahjong Panel" ) PORT_DIPSETTING( 0x00000000, "Joystick" ) PORT_DIPNAME( 0x00000010, 0x00000010, "Symbol 5" ) From 4227f6052ad051c9515f72c59e3b089204b0b847 Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 6 Oct 2016 16:42:58 +0100 Subject: [PATCH 5/7] update stream before setting the new gain. (nw) --- src/devices/sound/flt_vol.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/devices/sound/flt_vol.cpp b/src/devices/sound/flt_vol.cpp index e980b502b8e..e209e44a5ed 100644 --- a/src/devices/sound/flt_vol.cpp +++ b/src/devices/sound/flt_vol.cpp @@ -48,5 +48,6 @@ void filter_volume_device::sound_stream_update(sound_stream &stream, stream_samp void filter_volume_device::flt_volume_set_volume(float volume) { + m_stream->update(); m_gain = (int)(volume * 256); } From f5e9eca72649d913c52218bccead7e35a84ae954 Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 6 Oct 2016 16:45:31 +0100 Subject: [PATCH 6/7] m_audio_ended_normally is set within the stream_update(), so update the stream before returning it. (nw) --- src/devices/sound/cdda.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/devices/sound/cdda.cpp b/src/devices/sound/cdda.cpp index 45ef2a1dc42..e24127a65c1 100644 --- a/src/devices/sound/cdda.cpp +++ b/src/devices/sound/cdda.cpp @@ -148,6 +148,7 @@ int cdda_device::audio_paused() int cdda_device::audio_ended() { + m_stream->update(); return m_audio_ended_normally; } From 138d42b4116bbdbbdb00c4520e6f62195b087d7e Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 6 Oct 2016 17:17:18 +0100 Subject: [PATCH 7/7] Intel documentation is conflicting, which prompted osdev to claim that 128k dma was impossible. Masking the lowest bit of the page instead of the upper bit of the address makes more sense and it does also fix the issue with SB16 diagnose.exe playing silence. [smf] --- src/devices/bus/lpci/southbridge.cpp | 4 ++-- src/devices/machine/cs4031.cpp | 4 ++-- src/devices/machine/wd7600.cpp | 4 ++-- src/mame/drivers/ngen.cpp | 8 ++++---- src/mame/machine/at.cpp | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/devices/bus/lpci/southbridge.cpp b/src/devices/bus/lpci/southbridge.cpp index 14ff2d977de..7e8c8dcec37 100644 --- a/src/devices/bus/lpci/southbridge.cpp +++ b/src/devices/bus/lpci/southbridge.cpp @@ -355,7 +355,7 @@ READ8_MEMBER(southbridge_device::pc_dma_read_word) UINT16 result; offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff)); + result = prog_space.read_word((page_offset & 0xfe0000) | (offset << 1)); m_dma_high_byte = result & 0xFF00; return result & 0xFF; @@ -369,7 +369,7 @@ WRITE8_MEMBER(southbridge_device::pc_dma_write_word) return; offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - prog_space.write_word(page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data); + prog_space.write_word((page_offset & 0xfe0000) | (offset << 1), m_dma_high_byte | data); } diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp index f9d9108597a..fd3a303209f 100644 --- a/src/devices/machine/cs4031.cpp +++ b/src/devices/machine/cs4031.cpp @@ -362,7 +362,7 @@ READ8_MEMBER( cs4031_device::dma_read_word ) if (m_dma_channel == -1) return 0xff; - UINT16 result = m_space->read_word(page_offset() + ((offset << 1) & 0xffff)); + UINT16 result = m_space->read_word((page_offset() & 0xfe0000) | (offset << 1)); m_dma_high_byte = result >> 8; return result; @@ -373,7 +373,7 @@ WRITE8_MEMBER( cs4031_device::dma_write_word ) if (m_dma_channel == -1) return; - m_space->write_word(page_offset() + ((offset << 1) & 0xffff), (m_dma_high_byte << 8) | data); + m_space->write_word((page_offset() & 0xfe0000) | (offset << 1), (m_dma_high_byte << 8) | data); } WRITE_LINE_MEMBER( cs4031_device::dma2_dack0_w ) diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp index 4e1844e2a54..cfd297a6cbe 100644 --- a/src/devices/machine/wd7600.cpp +++ b/src/devices/machine/wd7600.cpp @@ -372,7 +372,7 @@ READ8_MEMBER( wd7600_device::dma_read_word ) if (m_dma_channel == -1) return 0xff; - UINT16 result = m_space->read_word(page_offset() + ((offset << 1) & 0xffff)); + UINT16 result = m_space->read_word((page_offset() & 0xfe0000) | (offset << 1)); m_dma_high_byte = result >> 8; return result; @@ -383,7 +383,7 @@ WRITE8_MEMBER( wd7600_device::dma_write_word ) if (m_dma_channel == -1) return; - m_space->write_word(page_offset() + ((offset << 1) & 0xffff), (m_dma_high_byte << 8) | data); + m_space->write_word((page_offset() & 0xfe0000) | (offset << 1), (m_dma_high_byte << 8) | data); } WRITE_LINE_MEMBER( wd7600_device::dma2_dack0_w ) diff --git a/src/mame/drivers/ngen.cpp b/src/mame/drivers/ngen.cpp index 2d56c547618..f6eb283c682 100644 --- a/src/mame/drivers/ngen.cpp +++ b/src/mame/drivers/ngen.cpp @@ -715,9 +715,9 @@ READ8_MEMBER(ngen_state::dma_read_word) return 0xff; offs_t page_offset = ((offs_t) m_dma_offset[m_dma_channel]) << 16; - result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff)); + result = prog_space.read_word((page_offset & 0xfe0000) | (offset << 1)); m_dma_high_byte = result & 0xFF00; - popmessage("DMA byte address %06x read %04x\n", page_offset + ((offset << 1) & 0xffff),result); + popmessage("DMA byte address %06x read %04x\n", (page_offset & 0xfe0000) | (offset << 1),result); return result & 0xff; } @@ -736,8 +736,8 @@ WRITE8_MEMBER(ngen_state::dma_write_word) return; offs_t page_offset = ((offs_t) m_dma_offset[m_dma_channel]) << 16; - prog_space.write_word(page_offset + ((offset << 1) & 0xffff), data); - popmessage("DMA byte address %06x write %04x\n", page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data); + prog_space.write_word((page_offset & 0xfe0000) | (offset << 1), data); + popmessage("DMA byte address %06x write %04x\n", (page_offset & 0xfe0000) | (offset << 1), m_dma_high_byte | data); } diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp index c1f3572ea27..a3c903e8b56 100644 --- a/src/mame/machine/at.cpp +++ b/src/mame/machine/at.cpp @@ -292,7 +292,7 @@ READ8_MEMBER(at_mb_device::dma_read_word) UINT16 result; offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff)); + result = prog_space.read_word((page_offset & 0xfe0000) | (offset << 1)); m_dma_high_byte = result & 0xFF00; return result & 0xFF; @@ -306,7 +306,7 @@ WRITE8_MEMBER(at_mb_device::dma_write_word) return; offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16; - prog_space.write_word(page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data); + prog_space.write_word((page_offset & 0xfe0000) | (offset << 1), m_dma_high_byte | data); } READ8_MEMBER( at_mb_device::dma8237_0_dack_r ) { return m_isabus->dack_r(0); }