Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heathzenith/h19/tlb.cpp: Make the page 2 memory option configurable for UltraROM #13082

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 43 additions & 11 deletions src/devices/bus/heathzenith/h19/tlb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,12 @@ static INPUT_PORTS_START( ultra19 )
PORT_DIPNAME( 0x80, 0x00, "Interlace Scan Mode") PORT_DIPLOCATION("SW402:8")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )

PORT_MODIFY("CONFIG")
PORT_CONFNAME(0x10, 0x10, "Page 2 RAM present")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x10, DEF_STR( Yes ) )

INPUT_PORTS_END


Expand Down Expand Up @@ -1316,10 +1322,23 @@ ioport_constructor heath_watz_tlb_device::device_input_ports() const
* Developed by William G. Parrott, III, sold by Software Wizardry, Inc.
*/
heath_ultra_tlb_device::heath_ultra_tlb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
heath_tlb_device(mconfig, HEATH_ULTRA, tag, owner, clock)
heath_tlb_device(mconfig, HEATH_ULTRA, tag, owner, clock),
m_maincpu_region(*this, "maincpu"),
m_page_2_ram(*this, "page2ram"),
m_mem_view(*this, "mem")
{
}

void heath_ultra_tlb_device::device_reset()
{
heath_tlb_device::device_reset();

ioport_value const cfg(m_config->read());

// Page 2 memory
m_mem_view.select(BIT(cfg, 4));
}

void heath_ultra_tlb_device::device_add_mconfig(machine_config &config)
{
heath_tlb_device::device_add_mconfig(config);
Expand All @@ -1331,11 +1350,11 @@ void heath_ultra_tlb_device::mem_map(address_map &map)
{
heath_tlb_device::mem_map(map);

// update rom mirror setting to allow page 2 memory
map(0x0000, 0x0fff).mirror(0x2000).rom();
map(0x0000, 0x3fff).view(m_mem_view);

// Page 2 memory
map(0x1000, 0x1fff).mirror(0x2000).ram();
m_mem_view[0](0x0000, 0x0fff).mirror(0x3000).rom().region(m_maincpu_region, 0x0000).unmapw();
m_mem_view[1](0x0000, 0x0fff).mirror(0x2000).rom().region(m_maincpu_region, 0x0000).unmapw();
m_mem_view[1](0x1000, 0x1fff).mirror(0x2000).ram().share(m_page_2_ram);
}

const tiny_rom_entry *heath_ultra_tlb_device::device_rom_region() const
Expand Down Expand Up @@ -1954,13 +1973,26 @@ ioport_constructor heath_igc_super19_tlb_device::device_input_ports() const
*
*/
heath_igc_ultra_tlb_device::heath_igc_ultra_tlb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
heath_igc_tlb_device(mconfig, HEATH_IGC_ULTRA, tag, owner, clock)
heath_igc_tlb_device(mconfig, HEATH_IGC_ULTRA, tag, owner, clock),
m_maincpu_region(*this, "maincpu"),
m_page_2_ram(*this, "page2ram"),
m_mem_view(*this, "mem")
{
}

void heath_igc_ultra_tlb_device::device_reset()
{
heath_igc_tlb_device::device_reset();

ioport_value const cfg(m_config->read());

// Page 2 memory
m_mem_view.select(BIT(cfg, 4));
}

void heath_igc_ultra_tlb_device::device_add_mconfig(machine_config &config)
{
heath_tlb_device::device_add_mconfig(config);
heath_igc_tlb_device::device_add_mconfig(config);

m_maincpu->set_addrmap(AS_PROGRAM, &heath_igc_ultra_tlb_device::mem_map);
}
Expand All @@ -1969,11 +2001,11 @@ void heath_igc_ultra_tlb_device::mem_map(address_map &map)
{
heath_tlb_device::mem_map(map);

// update rom mirror setting to allow page 2 memory
map(0x0000, 0x0fff).mirror(0x2000).rom();
map(0x0000, 0x3fff).view(m_mem_view);

// Page 2 memory
map(0x1000, 0x1fff).mirror(0x2000).ram();
m_mem_view[0](0x0000, 0x0fff).mirror(0x3000).rom().region(m_maincpu_region, 0x0000).unmapw();
m_mem_view[1](0x0000, 0x0fff).mirror(0x2000).rom().region(m_maincpu_region, 0x0000).unmapw();
m_mem_view[1](0x1000, 0x1fff).mirror(0x2000).ram().share(m_page_2_ram);
}

const tiny_rom_entry *heath_igc_ultra_tlb_device::device_rom_region() const
Expand Down
10 changes: 10 additions & 0 deletions src/devices/bus/heathzenith/h19/tlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,14 @@ class heath_ultra_tlb_device : public heath_tlb_device
protected:
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
virtual ioport_constructor device_input_ports() const override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;

void mem_map(address_map &map) ATTR_COLD;

required_memory_region m_maincpu_region;
required_shared_ptr<u8> m_page_2_ram;
memory_view m_mem_view;
};

/**
Expand Down Expand Up @@ -374,9 +379,14 @@ class heath_igc_ultra_tlb_device : public heath_igc_tlb_device
protected:
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
virtual ioport_constructor device_input_ports() const override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;

void mem_map(address_map &map) ATTR_COLD;

required_memory_region m_maincpu_region;
required_shared_ptr<u8> m_page_2_ram;
memory_view m_mem_view;
};

/**
Expand Down
8 changes: 4 additions & 4 deletions src/mame/heathzenith/h89.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ void h89_base_state::h89_mem(address_map &map)
// View 0 - ROM / Floppy RAM R/O
// View 1 - ROM / Floppy RAM R/W
// monitor ROM
m_mem_view[0](0x0000, 0x0fff).rom().region("maincpu", 0).unmapw();
m_mem_view[1](0x0000, 0x0fff).rom().region("maincpu", 0).unmapw();
m_mem_view[0](0x0000, 0x0fff).rom().region(m_maincpu_region, 0).unmapw();
m_mem_view[1](0x0000, 0x0fff).rom().region(m_maincpu_region, 0).unmapw();

// Floppy RAM
m_mem_view[0](0x1400, 0x17ff).readonly().share(m_floppy_ram);
m_mem_view[1](0x1400, 0x17ff).ram().share(m_floppy_ram);

// Floppy ROM
m_mem_view[0](0x1800, 0x1fff).rom().region("maincpu", 0x1800).unmapw();
m_mem_view[1](0x1800, 0x1fff).rom().region("maincpu", 0x1800).unmapw();
m_mem_view[0](0x1800, 0x1fff).rom().region(m_maincpu_region, 0x1800).unmapw();
m_mem_view[1](0x1800, 0x1fff).rom().region(m_maincpu_region, 0x1800).unmapw();
}

void h89_base_state::map_fetch(address_map &map)
Expand Down
Loading