diff options
author | Nigel Barnes <Pernod70@users.noreply.github.com> | 2020-08-18 12:33:46 +0100 |
---|---|---|
committer | Nigel Barnes <Pernod70@users.noreply.github.com> | 2020-08-18 12:45:02 +0100 |
commit | 4b444e98cf4a7ce508dc9344df9c7aa70ed2851a (patch) | |
tree | d6b1a846aaa40f3c5d194ac2716089a646203f53 | |
parent | e022ccd040333ddb6c49c5fcd0d3fca3781b8672 (diff) |
bus/electron/cart/sndexp.cpp: Fixed banking of 8K RAM, command *LRAM now works.
-rw-r--r-- | src/devices/bus/electron/cart/sndexp.cpp | 54 | ||||
-rw-r--r-- | src/devices/bus/electron/cart/sndexp.h | 2 |
2 files changed, 22 insertions, 34 deletions
diff --git a/src/devices/bus/electron/cart/sndexp.cpp b/src/devices/bus/electron/cart/sndexp.cpp index 4ba27cb4825..636f10a76af 100644 --- a/src/devices/bus/electron/cart/sndexp.cpp +++ b/src/devices/bus/electron/cart/sndexp.cpp @@ -4,10 +4,6 @@ Sound Expansion cartridge (Project Expansions) - TODO: - - compare with actual hardware, sounds awful compared to v3 - - implement jumper to configure 8K as sideways RAM - **********************************************************************/ @@ -40,11 +36,10 @@ void electron_sndexp_device::device_add_mconfig(machine_config &config) //------------------------------------------------- INPUT_PORTS_START(sndexp) - // TODO: Not known how jumper affects RAM access - PORT_START("JUMPER") - PORT_DIPNAME(0x01, 0x00, "SOUND / RAM") - PORT_DIPSETTING(0x00, "SOUND") - PORT_DIPSETTING(0x01, "RAM") + PORT_START("LINK") + PORT_CONFNAME(0x01, 0x00, "SOUND / RAM") + PORT_CONFSETTING(0x00, "SOUND") + PORT_CONFSETTING(0x01, "RAM") INPUT_PORTS_END @@ -69,7 +64,7 @@ electron_sndexp_device::electron_sndexp_device(const machine_config &mconfig, co : device_t(mconfig, ELECTRON_SNDEXP, tag, owner, clock) , device_electron_cart_interface(mconfig, *this) , m_sn(*this, "sn76489") - , m_jumper(*this, "JUMPER") + , m_link(*this, "LINK") , m_sound_latch(0) , m_sound_enable(0) { @@ -95,26 +90,21 @@ uint8_t electron_sndexp_device::read(offs_t offset, int infc, int infd, int romq if (oe) { - if (m_jumper->read()) + if (m_link->read()) { - if (romqa == 0) - { - data = m_rom[offset & 0x1fff]; - } - else - { - data = m_ram[offset & 0x1fff]; - } + data = m_ram[offset & 0x1fff]; } else { - if (offset < 0x2000) + switch (offset & 0x2000) { + case 0x0000: data = m_rom[offset & 0x1fff]; - } - else - { + break; + + case 0x2000: data = m_ram[offset & 0x1fff]; + break; } } } @@ -146,22 +136,20 @@ void electron_sndexp_device::write(offs_t offset, uint8_t data, int infc, int in } else if (oe) { - if (m_jumper->read()) + if (m_link->read()) { - if (romqa == 1) - { - m_ram[offset & 0x1fff] = data; - } + m_ram[offset & 0x1fff] = data; } else { - if (offset < 0x2000) - { - m_ram[offset & 0x1fff] = data; - } - else + switch (offset & 0x2000) { + case 0x0000: + break; + + case 0x2000: m_ram[offset & 0x1fff] = data; + break; } } } diff --git a/src/devices/bus/electron/cart/sndexp.h b/src/devices/bus/electron/cart/sndexp.h index 5627c2ff734..f222185aa5f 100644 --- a/src/devices/bus/electron/cart/sndexp.h +++ b/src/devices/bus/electron/cart/sndexp.h @@ -38,7 +38,7 @@ protected: private: required_device<sn76489_device> m_sn; - required_ioport m_jumper; + required_ioport m_link; uint8_t m_sound_latch; uint8_t m_sound_enable; |