summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author ksherlock <ksherlock@gmail.com>2023-05-26 13:28:35 -0400
committer GitHub <noreply@github.com>2023-05-26 13:28:35 -0400
commit2fb9b7c0e49fee644b09ca90d742485a6612a0ba (patch)
treed1f0d2e9b3d413adcb1d76d8fdf96dd4835d216d /src
parent997be1f7e548213767637f2590f909e4b4353d90 (diff)
apple/apple2gs: Fix ROM0/1 ram size logic (#11264)
* 256k (ROM 0/1) apple2gs doesn't have any extra memory above the base 4 banks
Diffstat (limited to 'src')
-rw-r--r--src/mame/apple/apple2gs.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/mame/apple/apple2gs.cpp b/src/mame/apple/apple2gs.cpp
index d8278ba9017..96d4be36443 100644
--- a/src/mame/apple/apple2gs.cpp
+++ b/src/mame/apple/apple2gs.cpp
@@ -727,12 +727,24 @@ void apple2gs_state::machine_start()
m_inh_slot = -1;
m_cnxx_slot = CNXX_UNCLAIMED;
- // install memory beyond 256K/1M
- address_space& space = m_maincpu->space(AS_PROGRAM);
- int ramsize = m_ram_size - 0x20000; // subtract 128K for banks 0 and 1, which are handled specially
- // RAM sizes for both classes of machine no longer include the Mega II RAM
- space.install_ram(0x020000, ramsize - 1 + 0x20000, m_ram_ptr + 0x020000);
+ // install memory beyond 256K
+ int ramsize = m_ram_size;
+ if (!m_is_rom3 && m_ram_size <= 1280 * 1024)
+ {
+ ramsize -= 0x40000; // subtract 256k for banks 0, 1, e0, e1
+ }
+ else if (m_is_rom3 || m_ram_size == 1024 * 1024 * 8)
+ {
+ ramsize -= 0x20000; // subtract 128K for banks 0 and 1, which are handled specially
+ }
+
+ if (ramsize)
+ {
+ address_space& space = m_maincpu->space(AS_PROGRAM);
+ // RAM sizes for both classes of machine no longer include the Mega II RAM
+ space.install_ram(0x020000, ramsize - 1 + 0x20000, m_ram_ptr + 0x020000);
+ }
// setup save states
save_item(NAME(m_speaker_state));