mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
mt5510: Add ROM banking
This commit is contained in:
parent
691c519086
commit
911f056a93
@ -2,7 +2,7 @@
|
||||
// copyright-holders:AJR
|
||||
/***********************************************************************************************************************************
|
||||
|
||||
Skeleton driver for Micro-Term Model 5510 terminal.
|
||||
Skeleton driver for Microterm Model 5510 terminal.
|
||||
|
||||
************************************************************************************************************************************/
|
||||
|
||||
@ -20,36 +20,62 @@ public:
|
||||
mt5510_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rombank(*this, "rombank")
|
||||
{
|
||||
}
|
||||
|
||||
void mt5510(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
|
||||
private:
|
||||
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void bank_w(u8 data);
|
||||
|
||||
void mem_map(address_map &map);
|
||||
void io_map(address_map &map);
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_memory_bank m_rombank;
|
||||
};
|
||||
|
||||
void mt5510_state::machine_start()
|
||||
{
|
||||
m_rombank->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x2000);
|
||||
}
|
||||
|
||||
void mt5510_state::machine_reset()
|
||||
{
|
||||
m_rombank->set_entry(0);
|
||||
}
|
||||
|
||||
u32 mt5510_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mt5510_state::bank_w(u8 data)
|
||||
{
|
||||
m_rombank->set_entry(BIT(data, 2, 2));
|
||||
}
|
||||
|
||||
void mt5510_state::mem_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x7fff).rom().region("maincpu", 0).nopw();
|
||||
map(0x8000, 0xbfff).ram();
|
||||
map(0xc000, 0xffff).ram();
|
||||
map(0x8000, 0x9fff).bankr("rombank");
|
||||
map(0xa000, 0xbfff).ram();
|
||||
map(0xc000, 0xdfff).ram().share("charram");
|
||||
map(0xe000, 0xffff).ram().share("attrram");
|
||||
}
|
||||
|
||||
void mt5510_state::io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map(0x60, 0x6f).rw("duart", FUNC(scn2681_device::read), FUNC(scn2681_device::write));
|
||||
map(0x71, 0x71).w(FUNC(mt5510_state::bank_w));
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START(mt5510)
|
||||
@ -95,4 +121,4 @@ ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
COMP(1988, mt5510, 0, 0, mt5510, mt5510, mt5510_state, empty_init, "Micro-Term", "Micro-Term 5510", MACHINE_IS_SKELETON)
|
||||
COMP(1988, mt5510, 0, 0, mt5510, mt5510, mt5510_state, empty_init, "Microterm", "Microterm 5510", MACHINE_IS_SKELETON)
|
||||
|
Loading…
Reference in New Issue
Block a user