diff options
| -rw-r--r-- | src/mame/apple/apple2gs.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mame/apple/apple2gs.cpp b/src/mame/apple/apple2gs.cpp index 34689f45e9d..7af19becaa2 100644 --- a/src/mame/apple/apple2gs.cpp +++ b/src/mame/apple/apple2gs.cpp @@ -386,6 +386,8 @@ private: void bank1_0000_sh_w(offs_t offset, u8 data); u8 bank1_c000_r(offs_t offset); void bank1_c000_w(offs_t offset, u8 data); + u8 expandedram_r(offs_t offset); + void expandedram_w(offs_t offset, u8 data); void a2bus_irq_w(int state); void a2bus_nmi_w(int state); void a2bus_inh_w(int state); @@ -2497,6 +2499,34 @@ void apple2gs_state::c800_w(offs_t offset, u8 data) } } +/* for < 14MB RAM, returns the bank number on reads >= 8MB */ +u8 apple2gs_state::expandedram_r(offs_t offset) +{ + offset += 0x020000; + + if (offset >= m_ram_size) + { + if (offset >= 0x800000) + { + return offset >> 16; + } + + return 0; + } + + return m_ram_ptr[offset]; +} + +void apple2gs_state::expandedram_w(offs_t offset, u8 data) +{ + offset += 0x20000; + + if (offset < m_ram_size) + { + m_ram_ptr[offset] = data; + } +} + u8 apple2gs_state::inh_r(offs_t offset) { if (m_inh_slot != -1) @@ -3290,6 +3320,8 @@ void apple2gs_state::apple2gs_map(address_map &map) m_e0_4000bank[2](0x4000, 0xbfff).rw(FUNC(apple2gs_state::e0ram_r<0x4000>), FUNC(apple2gs_state::e1ram_w<0x4000>)); m_e0_4000bank[3](0x4000, 0xbfff).rw(FUNC(apple2gs_state::e1ram_r<0x4000>), FUNC(apple2gs_state::e1ram_w<0x4000>)); + map(0x020000, 0xdfffff).rw(FUNC(apple2gs_state::expandedram_r), FUNC(apple2gs_state::expandedram_w)); + map(0xe0c000, 0xe0c07f).rw(FUNC(apple2gs_state::c000_r), FUNC(apple2gs_state::c000_w)); map(0xe0c080, 0xe0c0ff).rw(FUNC(apple2gs_state::c080_r), FUNC(apple2gs_state::c080_w)); map(0xe0c100, 0xe0c2ff).rw(FUNC(apple2gs_state::c100_r), FUNC(apple2gs_state::c100_w)); |
