mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
i8244: Eliminate MCFG_ macros; set screen parameters in device_config_complete (nw)
This commit is contained in:
parent
88c2e640f3
commit
7828367c10
@ -129,6 +129,22 @@ i8245_device::i8245_device(const machine_config &mconfig, const char *tag, devic
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_config_complete - perform any
|
||||
// operations now that the configuration is
|
||||
// complete
|
||||
//-------------------------------------------------
|
||||
|
||||
void i8244_device::device_config_complete()
|
||||
{
|
||||
if (!has_screen())
|
||||
return;
|
||||
|
||||
if (!screen().refresh_attoseconds())
|
||||
screen().set_raw(clock(), LINE_CLOCKS, START_ACTIVE_SCAN, END_ACTIVE_SCAN, m_screen_lines, START_Y, START_Y + SCREEN_HEIGHT);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
@ -16,25 +16,6 @@
|
||||
#include "emupal.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define MCFG_I8244_ADD(_tag, _clock, _screen_tag, _irq_cb, _postprocess_cb) \
|
||||
MCFG_DEVICE_ADD(_tag, I8244, _clock) \
|
||||
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
|
||||
MCFG_I8244_IRQ_CB(_irq_cb) \
|
||||
MCFG_I8244_POSTPROCESS_CB(_postprocess_cb)
|
||||
#define MCFG_I8244_IRQ_CB(_devcb) \
|
||||
downcast<i8244_device &>(*device).set_irq_cb(DEVCB_##_devcb);
|
||||
#define MCFG_I8244_POSTPROCESS_CB(_devcb) \
|
||||
downcast<i8244_device &>(*device).set_postprocess_cb(DEVCB_##_devcb);
|
||||
#define MCFG_I8245_ADD(_tag, _clock, _screen_tag, _irq_cb, _postprocess_cb) \
|
||||
MCFG_DEVICE_ADD(_tag, I8245, _clock) \
|
||||
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
|
||||
MCFG_I8244_IRQ_CB(_irq_cb) \
|
||||
MCFG_I8244_POSTPROCESS_CB(_postprocess_cb )
|
||||
|
||||
/***************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
@ -51,8 +32,8 @@ public:
|
||||
i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// configuration helpers
|
||||
template <class Object> devcb_base &set_irq_cb(Object &&cb) { return m_irq_func.set_callback(std::forward<Object>(cb)); }
|
||||
template <class Object> devcb_base &set_postprocess_cb(Object &&cb) { return m_postprocess_func.set_callback(std::forward<Object>(cb)); }
|
||||
auto irq_cb() { return m_irq_func.bind(); }
|
||||
auto postprocess_cb() { return m_postprocess_func.bind(); }
|
||||
|
||||
DECLARE_READ8_MEMBER(read);
|
||||
DECLARE_WRITE8_MEMBER(write);
|
||||
@ -109,6 +90,7 @@ protected:
|
||||
i8244_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int lines);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
@ -698,7 +698,6 @@ MACHINE_CONFIG_START(odyssey2_state::odyssey2)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS( XTAL(7'159'090)/2 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8244_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT )
|
||||
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
@ -707,8 +706,11 @@ MACHINE_CONFIG_START(odyssey2_state::odyssey2)
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
MCFG_I8244_ADD( "i8244", XTAL(7'159'090)/2 * 2, "screen", INPUTLINE( "maincpu", 0 ), WRITE16( *this, odyssey2_state, scanline_postprocess ) )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
I8244(config, m_i8244, XTAL(7'159'090)/2 * 2);
|
||||
m_i8244->set_screen("screen");
|
||||
m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ);
|
||||
m_i8244->postprocess_cb().set(FUNC(odyssey2_state::scanline_postprocess));
|
||||
m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40);
|
||||
|
||||
odyssey2_cartslot(config);
|
||||
MACHINE_CONFIG_END
|
||||
@ -724,7 +726,6 @@ MACHINE_CONFIG_START(odyssey2_state::videopac)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS( XTAL(17'734'470)/5 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8245_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT )
|
||||
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
@ -733,8 +734,11 @@ MACHINE_CONFIG_START(odyssey2_state::videopac)
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
MCFG_I8245_ADD( "i8244", XTAL(17'734'470)/5 * 2, "screen", INPUTLINE( "maincpu", 0 ), WRITE16( *this, odyssey2_state, scanline_postprocess ) )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
I8245(config, m_i8244, XTAL(17'734'470)/5 * 2);
|
||||
m_i8244->set_screen("screen");
|
||||
m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ);
|
||||
m_i8244->postprocess_cb().set(FUNC(odyssey2_state::scanline_postprocess));
|
||||
m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40);
|
||||
|
||||
odyssey2_cartslot(config);
|
||||
MACHINE_CONFIG_END
|
||||
@ -759,7 +763,6 @@ MACHINE_CONFIG_START(g7400_state::g7400)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8245_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
@ -775,8 +778,11 @@ MACHINE_CONFIG_START(g7400_state::g7400)
|
||||
EF9340_1(config, m_ef9340_1, 3540000, "screen");
|
||||
|
||||
SPEAKER(config, "mono").front_center();
|
||||
MCFG_I8245_ADD("i8244", 3540000 * 2, "screen", INPUTLINE("maincpu", 0), WRITE16(*this, g7400_state, scanline_postprocess))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
I8245(config, m_i8244, 3540000 * 2);
|
||||
m_i8244->set_screen("screen");
|
||||
m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ);
|
||||
m_i8244->postprocess_cb().set(FUNC(g7400_state::scanline_postprocess));
|
||||
m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40);
|
||||
|
||||
odyssey2_cartslot(config);
|
||||
MCFG_DEVICE_REMOVE("cart_list")
|
||||
@ -804,7 +810,6 @@ MACHINE_CONFIG_START(g7400_state::odyssey3)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8244_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
@ -820,8 +825,11 @@ MACHINE_CONFIG_START(g7400_state::odyssey3)
|
||||
EF9340_1(config, m_ef9340_1, 3540000, "screen");
|
||||
|
||||
SPEAKER(config, "mono").front_center();
|
||||
MCFG_I8244_ADD("i8244", 3540000 * 2, "screen", INPUTLINE("maincpu", 0), WRITE16(*this, g7400_state, scanline_postprocess))
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
|
||||
I8244(config, m_i8244, 3540000 * 2);
|
||||
m_i8244->set_screen("screen");
|
||||
m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ);
|
||||
m_i8244->postprocess_cb().set(FUNC(g7400_state::scanline_postprocess));
|
||||
m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40);
|
||||
|
||||
odyssey2_cartslot(config);
|
||||
MCFG_DEVICE_REMOVE("cart_list")
|
||||
|
Loading…
Reference in New Issue
Block a user