mirror of
https://github.com/holub/mame
synced 2025-06-06 12:53:46 +03:00
naomi: add external irq and reset out lines to rom boards base device (nw)
The external irq is connected only in naomi and naomigd systems External irq will be used by the dimm board
This commit is contained in:
parent
f257bac73b
commit
ecde92705e
@ -3011,6 +3011,7 @@ void naomi_state::naomi(machine_config &config)
|
||||
naomi_base(config);
|
||||
naomi_rom_board &rom_board(NAOMI_ROM_BOARD(config, "rom_board", 0, "naomibd_eeprom"));
|
||||
rom_board.irq_callback().set(FUNC(dc_state::g1_irq));
|
||||
rom_board.ext_irq_callback().set(FUNC(dc_state::external_irq));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3022,6 +3023,7 @@ void naomi_state::naomigd(machine_config &config)
|
||||
naomi_base(config);
|
||||
naomi_gdrom_board &rom_board(NAOMI_GDROM_BOARD(config, "rom_board", 0, "naomibd_eeprom", ":gdrom", "pic"));
|
||||
rom_board.irq_callback().set(FUNC(dc_state::g1_irq));
|
||||
rom_board.ext_irq_callback().set(FUNC(dc_state::external_irq));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -29,6 +29,8 @@ void naomi_g1_device::amap(address_map &map)
|
||||
naomi_g1_device::naomi_g1_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, irq_cb(*this)
|
||||
, ext_irq_cb(*this)
|
||||
, reset_out_cb(*this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -36,6 +38,8 @@ void naomi_g1_device::device_start()
|
||||
{
|
||||
timer = timer_alloc(G1_TIMER_ID);
|
||||
irq_cb.resolve_safe();
|
||||
ext_irq_cb.resolve_safe();
|
||||
reset_out_cb.resolve_safe();
|
||||
|
||||
save_item(NAME(gdstar));
|
||||
save_item(NAME(gdlen));
|
||||
@ -51,6 +55,7 @@ void naomi_g1_device::device_reset()
|
||||
gddir = 0;
|
||||
gden = 0;
|
||||
gdst = 0;
|
||||
set_ext_irq(CLEAR_LINE);
|
||||
}
|
||||
|
||||
void naomi_g1_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
|
@ -17,10 +17,12 @@ public:
|
||||
typedef delegate<void (uint32_t main_adr, void *dma_ptr, uint32_t length, uint32_t size, bool to_mainram)> dma_cb;
|
||||
|
||||
auto irq_callback() { return irq_cb.bind(); }
|
||||
auto ext_irq_callback() { return ext_irq_cb.bind(); }
|
||||
auto reset_out_callback() { return reset_out_cb.bind(); }
|
||||
void set_dma_cb(dma_cb cb) { _dma_cb = cb; }
|
||||
|
||||
void amap(address_map &map);
|
||||
virtual void submap(address_map &map) = 0;
|
||||
void amap(address_map &map); // for range 0x005f7400-0x005f74ff
|
||||
virtual void submap(address_map &map) = 0; // for range 0x005f7000-0x005f70ff
|
||||
|
||||
DECLARE_READ32_MEMBER(sb_gdstar_r); // 5f7404
|
||||
DECLARE_WRITE32_MEMBER(sb_gdstar_w); // 5f7404
|
||||
@ -60,11 +62,16 @@ protected:
|
||||
virtual void dma_get_position(uint8_t *&base, uint32_t &limit, bool to_maincpu) = 0;
|
||||
virtual void dma_advance(uint32_t size) = 0;
|
||||
|
||||
void set_ext_irq(int state) { ext_irq_cb(state); }
|
||||
void set_reset_out() { reset_out_cb(ASSERT_LINE); }
|
||||
|
||||
private:
|
||||
uint32_t gdstar, gdlen, gddir, gden, gdst;
|
||||
|
||||
emu_timer *timer;
|
||||
devcb_write8 irq_cb;
|
||||
devcb_write_line ext_irq_cb;
|
||||
devcb_write_line reset_out_cb;
|
||||
dma_cb _dma_cb;
|
||||
|
||||
void dma(void *dma_ptr, uint32_t main_adr, uint32_t size, bool to_mainram);
|
||||
|
Loading…
Reference in New Issue
Block a user