mirror of
https://github.com/holub/mame
synced 2025-04-26 02:07:14 +03:00
att630: Vectors lie in BRAM, so no callback needed after all (nw)
This commit is contained in:
parent
ed03a023f6
commit
b26efa5165
@ -29,21 +29,15 @@ protected:
|
||||
private:
|
||||
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
template<int Line> DECLARE_WRITE_LINE_MEMBER(irq_w);
|
||||
TIMER_CALLBACK_MEMBER(update_interrupts);
|
||||
|
||||
u8 bram_r(offs_t offset);
|
||||
void bram_w(offs_t offset, u8 data);
|
||||
u8 irq_vec_r();
|
||||
|
||||
void mem_map(address_map &map);
|
||||
void vec_map(address_map &map);
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<m68000_device> m_maincpu;
|
||||
required_shared_ptr<u16> m_vram;
|
||||
|
||||
std::unique_ptr<u8[]> m_bram_data;
|
||||
u8 m_pending_interrupts;
|
||||
};
|
||||
|
||||
void att630_state::machine_start()
|
||||
@ -51,10 +45,7 @@ void att630_state::machine_start()
|
||||
m_bram_data = std::make_unique<u8[]>(0x2000);
|
||||
subdevice<nvram_device>("bram")->set_base(m_bram_data.get(), 0x2000);
|
||||
|
||||
m_pending_interrupts = 0;
|
||||
|
||||
save_pointer(NAME(m_bram_data), 0x2000);
|
||||
save_item(NAME(m_pending_interrupts));
|
||||
}
|
||||
|
||||
u32 att630_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
@ -66,34 +57,6 @@ u32 att630_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, con
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <int Line>
|
||||
WRITE_LINE_MEMBER(att630_state::irq_w)
|
||||
{
|
||||
if (BIT(m_pending_interrupts, Line) == state)
|
||||
return;
|
||||
|
||||
if (state)
|
||||
m_pending_interrupts |= 0x01 << Line;
|
||||
else
|
||||
m_pending_interrupts &= ~(0x01 << Line);
|
||||
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(att630_state::update_interrupts), this));
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(att630_state::update_interrupts)
|
||||
{
|
||||
m_maincpu->set_input_line(M68K_IRQ_1, m_pending_interrupts != 0 ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
u8 att630_state::irq_vec_r()
|
||||
{
|
||||
for (int level = 7; level > 0; level--)
|
||||
if (BIT(m_pending_interrupts, level))
|
||||
return 0x40 + level;
|
||||
|
||||
return 0x40;
|
||||
}
|
||||
|
||||
u8 att630_state::bram_r(offs_t offset)
|
||||
{
|
||||
return m_bram_data[offset];
|
||||
@ -118,11 +81,6 @@ void att630_state::mem_map(address_map &map)
|
||||
map(0xe00000, 0xe03fff).mirror(0x1fc000).rw(FUNC(att630_state::bram_r), FUNC(att630_state::bram_w)).umask16(0x00ff);
|
||||
}
|
||||
|
||||
void att630_state::vec_map(address_map &map)
|
||||
{
|
||||
map(0xfffff3, 0xfffff3).r(FUNC(att630_state::irq_vec_r));
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( att630 )
|
||||
INPUT_PORTS_END
|
||||
|
||||
@ -130,7 +88,7 @@ void att630_state::att630(machine_config &config)
|
||||
{
|
||||
M68000(config, m_maincpu, 40_MHz_XTAL / 4); // clock not confirmed
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &att630_state::mem_map);
|
||||
m_maincpu->set_addrmap(m68000_device::AS_CPU_SPACE, &att630_state::vec_map);
|
||||
m_maincpu->set_cpu_space(AS_PROGRAM); // vectors are in BRAM
|
||||
|
||||
NVRAM(config, "bram", nvram_device::DEFAULT_ALL_0); // 5264 + battery
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user