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

heathkit/tlb.cpp: Use memory bank for imaginator I-100 ROM #11778

Merged
merged 2 commits into from Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 7 additions & 18 deletions src/mame/heathkit/tlb.cpp
Expand Up @@ -20,7 +20,7 @@
- In 49/50 row mode, character descenders are cut off.
- Screen saver does not disable the screen
- With superset slot option
- Screensaver freezes the screen instead of blanking the screen
- Screensaver freezes the screen instead of blanking the screen

****************************************************************************/
/***************************************************************************
Expand Down Expand Up @@ -1483,7 +1483,7 @@ ioport_constructor heath_gp19_tlb_device::device_input_ports() const
*/
heath_imaginator_tlb_device::heath_imaginator_tlb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
heath_tlb_device(mconfig, HEATH_IMAGINATOR, tag, owner, clock),
m_mem_view(*this, "memmap"),
m_mem_bank(*this, "membank"),
m_p_graphic_ram(*this, "graphicram")
{
}
Expand All @@ -1503,14 +1503,15 @@ void heath_imaginator_tlb_device::device_start()
{
heath_tlb_device::device_start();

save_item(NAME(m_mem_map));
save_item(NAME(m_im2_val));
save_item(NAME(m_alphanumeric_mode_active));
save_item(NAME(m_graphics_mode_active));
save_item(NAME(m_allow_tlb_interrupts));
save_item(NAME(m_allow_imaginator_interrupts));
save_item(NAME(m_hsync_irq_raised));

m_mem_bank->configure_entries(0, 2, memregion("maincpu")->base(), 0x2000);

m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x6000, 0x7fff, "mem_map_update",
[this](offs_t offset, u8 &data, u8 mem_mask) { if (!machine().side_effects_disabled()) { tap_6000h(); } },
[this](offs_t offset, u8 &data, u8 mem_mask) { if (!machine().side_effects_disabled()) { tap_6000h(); } });
Expand All @@ -1524,9 +1525,7 @@ void heath_imaginator_tlb_device::device_reset()
{
heath_tlb_device::device_reset();

m_mem_map = 1;

m_mem_view.select(m_mem_map);
m_mem_bank->set_entry(1);

m_alphanumeric_mode_active = true;
m_graphics_mode_active = false;
Expand All @@ -1551,13 +1550,7 @@ void heath_imaginator_tlb_device::mem_map(address_map &map)
{
map.unmap_value_high();

map(0x0000, 0x1fff).view(m_mem_view);

// H19 standard ROM
m_mem_view[0](0x0000, 0x1fff).rom().region("maincpu", 0);

// GCP ROM mapped to 0x0000 on power-up/reset
m_mem_view[1](0x0000, 0x1fff).rom().region("maincpu", 0x2000);
map(0x0000, 0x1fff).bankr(m_mem_bank);

// Normal spot of the GCP ROM
map(0x2000, 0x3fff).rom();
Expand All @@ -1581,11 +1574,7 @@ void heath_imaginator_tlb_device::mem_map(address_map &map)

void heath_imaginator_tlb_device::tap_6000h()
{
if (m_mem_map != 0)
{
m_mem_map = 0;
m_mem_view.select(m_mem_map);
}
m_mem_bank->set_entry(0);
}
Comment on lines 1575 to 1578
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, the only way for it to flip back to entry 1 is on reset, so you could make it uninstall the tap after the first time it’s hit to make it a bit more efficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cuavas How do you uninstall a tap? I looked for a method that would do it and didn't see anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With .remove(): 706cc60

You can find a fair few uses of read/write taps around the source tree if you grep for them.


void heath_imaginator_tlb_device::tap_8000h()
Expand Down
3 changes: 1 addition & 2 deletions src/mame/heathkit/tlb.h
Expand Up @@ -275,10 +275,9 @@ class heath_imaginator_tlb_device : public heath_tlb_device
void nop_w(offs_t reg, uint8_t val);
virtual void set_irq_line() override;

memory_view m_mem_view;
required_memory_bank m_mem_bank;
required_shared_ptr<uint8_t> m_p_graphic_ram;

uint8_t m_mem_map;
uint8_t m_im2_val;

bool m_alphanumeric_mode_active;
Expand Down