summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2020-06-26 20:35:10 +1000
committer Robbbert <Robbbert@users.noreply.github.com>2020-06-26 20:35:10 +1000
commit8a0531799d4d5a32ea5c0850d3f9e78d2e9e5ff0 (patch)
tree1932c59ed804ed49407f59046783d0980a57bfca
parent6bdc7cc979f9f013bcebe36175fb742d3c1a4792 (diff)
(nw) zorba: adjusted to requirements
-rw-r--r--src/mame/drivers/zorba.cpp15
-rw-r--r--src/mame/includes/zorba.h3
2 files changed, 10 insertions, 8 deletions
diff --git a/src/mame/drivers/zorba.cpp b/src/mame/drivers/zorba.cpp
index ef01837259f..15cb3467fc9 100644
--- a/src/mame/drivers/zorba.cpp
+++ b/src/mame/drivers/zorba.cpp
@@ -72,7 +72,7 @@ ToDo:
void zorba_state::zorba_mem(address_map &map)
{
- map(0x0000, 0x3fff).ram().share("mainram").lr8(NAME([this] (offs_t offset) { if(m_rom_in_map) return m_rom[offset]; else return m_ram[offset]; }));
+ map(0x0000, 0x3fff).ram().share("mainram").bankr("bank1");
map(0x4000, 0xffff).ram();
}
@@ -275,11 +275,12 @@ void zorba_state::machine_start()
save_item(NAME(m_printer_select));
save_item(NAME(m_term_data));
- save_item(NAME(m_rom_in_map));
m_printer_prowriter = false;
m_printer_fault = 0;
m_printer_select = 0;
+ m_bank1->configure_entry(0, m_ram);
+ m_bank1->configure_entry(1, m_rom);
}
void zorba_state::machine_reset()
@@ -293,7 +294,7 @@ void zorba_state::machine_reset()
m_printer_prowriter = BIT(m_config_port->read(), 0);
m_pia0->cb1_w(m_printer_prowriter ? m_printer_select : m_printer_fault);
- m_rom_in_map = true;
+ m_bank1->set_entry(1);
m_maincpu->reset();
}
@@ -306,25 +307,25 @@ void zorba_state::machine_reset()
uint8_t zorba_state::ram_r()
{
if (!machine().side_effects_disabled())
- m_rom_in_map = false;
+ m_bank1->set_entry(0);
return 0;
}
void zorba_state::ram_w(uint8_t data)
{
- m_rom_in_map = false;
+ m_bank1->set_entry(0);
}
uint8_t zorba_state::rom_r()
{
if (!machine().side_effects_disabled())
- m_rom_in_map = true;
+ m_bank1->set_entry(1);
return 0;
}
void zorba_state::rom_w(uint8_t data)
{
- m_rom_in_map = true;
+ m_bank1->set_entry(1);
}
diff --git a/src/mame/includes/zorba.h b/src/mame/includes/zorba.h
index 155eedca562..0ba320fbca1 100644
--- a/src/mame/includes/zorba.h
+++ b/src/mame/includes/zorba.h
@@ -29,6 +29,7 @@ public:
, m_config_port(*this, "CNF")
, m_rom(*this, "maincpu")
, m_ram(*this, "mainram")
+ , m_bank1(*this, "bank1")
, m_p_chargen(*this, "chargen")
, m_maincpu(*this, "maincpu")
, m_dma(*this, "dma")
@@ -94,6 +95,7 @@ private:
required_region_ptr<u8> m_rom;
required_shared_ptr<u8> m_ram;
+ required_memory_bank m_bank1;
required_region_ptr<uint8_t> m_p_chargen;
required_device<cpu_device> m_maincpu;
@@ -124,7 +126,6 @@ private:
int m_printer_select;
uint8_t m_term_data;
- bool m_rom_in_map;
};
#endif // MAME_INCLUDES_ZORBA_H