(MESS) ti99/grom: devcb2. (nw)

This commit is contained in:
Curt Coder 2014-03-19 11:54:29 +00:00
parent a965f0fd64
commit 858c124f93
6 changed files with 79 additions and 34 deletions

View File

@ -358,17 +358,17 @@ INPUT_PORTS_END
static GROM_CONFIG(grom0_config)
{
false, 0, region_grom, 0x0000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_4x_state, console_ready_grom), GROMFREQ
false, 0, region_grom, 0x0000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom1_config)
{
false, 1, region_grom, 0x2000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_4x_state, console_ready_grom), GROMFREQ
false, 1, region_grom, 0x2000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom2_config)
{
false, 2, region_grom, 0x4000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_4x_state, console_ready_grom), GROMFREQ
false, 2, region_grom, 0x4000, 0x1800, GROMFREQ
};
READ8_MEMBER( ti99_4x_state::cruread )
@ -931,8 +931,11 @@ static MACHINE_CONFIG_START( ti99_4_60hz, ti99_4x_state )
/* GROM devices */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
// Joystick port
MCFG_TI_JOYPORT4_ADD( JOYPORT_TAG, 60 )
@ -982,8 +985,11 @@ static MACHINE_CONFIG_START( ti99_4_50hz, ti99_4x_state )
/* GROM devices */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
// Joystick port
MCFG_TI_JOYPORT4_ADD( JOYPORT_TAG, 50 )
@ -1050,8 +1056,11 @@ static MACHINE_CONFIG_START( ti99_4a_60hz, ti99_4x_state )
/* GROM devices */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
// Joystick port
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )
@ -1099,8 +1108,11 @@ static MACHINE_CONFIG_START( ti99_4a_50hz, ti99_4x_state )
/* GROM devices */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
// Joystick port
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 50 )
@ -1165,8 +1177,11 @@ static MACHINE_CONFIG_START( ti99_4qi_60hz, ti99_4x_state )
/* GROM devices */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
// Joystick port
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )
@ -1214,8 +1229,11 @@ static MACHINE_CONFIG_START( ti99_4qi_50hz, ti99_4x_state )
/* GROM devices */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
// Joystick port
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 50 )
@ -1279,8 +1297,11 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state )
/* GROM devices */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
// Joystick port
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )

View File

@ -440,17 +440,17 @@ INPUT_PORTS_END
static GROM_CONFIG(grom0_config)
{
false, 0, region_sysgrom, 0x0000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ
false, 0, region_sysgrom, 0x0000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom1_config)
{
false, 1, region_sysgrom, 0x2000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ
false, 1, region_sysgrom, 0x2000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom2_config)
{
false, 2, region_sysgrom, 0x4000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ
false, 2, region_sysgrom, 0x4000, 0x1800, GROMFREQ
};
/****************************************************
@ -490,29 +490,29 @@ static GROM_CONFIG(grom2_config)
#define GROM_LIBRARY_CONFIG8(_conf, _region) \
static GROM_CONFIG(_conf##0) \
{ false, 0, _region, 0x0000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 0, _region, 0x0000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##1) \
{ false, 1, _region, 0x2000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 1, _region, 0x2000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##2) \
{ false, 2, _region, 0x4000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 2, _region, 0x4000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##3) \
{ false, 3, _region, 0x6000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 3, _region, 0x6000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##4) \
{ false, 4, _region, 0x8000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 4, _region, 0x8000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##5) \
{ false, 5, _region, 0xa000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 5, _region, 0xa000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##6) \
{ false, 6, _region, 0xc000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 6, _region, 0xc000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##7) \
{ false, 7, _region, 0xe000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ };
{ false, 7, _region, 0xe000, 0x1800, GROMFREQ };
#define GROM_LIBRARY_CONFIG3(_conf, _region) \
static GROM_CONFIG(_conf##0) \
{ false, 0, _region, 0x0000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 0, _region, 0x0000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##1) \
{ false, 1, _region, 0x2000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ }; \
{ false, 1, _region, 0x2000, 0x1800, GROMFREQ }; \
static GROM_CONFIG(_conf##2) \
{ false, 2, _region, 0x4000, 0x1800, DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, console_ready_grom), GROMFREQ };
{ false, 2, _region, 0x4000, 0x1800, GROMFREQ };
GROM_LIBRARY_CONFIG8(pascal1, region_gromlib1)
GROM_LIBRARY_CONFIG8(pascal2, region_gromlib2)
GROM_LIBRARY_CONFIG3(pascal3, region_gromlib3)
@ -1047,8 +1047,11 @@ static MACHINE_CONFIG_START( ti99_8_60hz, ti99_8_state )
/* Console GROMs */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
/* Pascal GROM libraries. */
MCFG_GROM_LIBRARY_ADD8(pascal1_grom, pascal1)
@ -1098,8 +1101,11 @@ static MACHINE_CONFIG_START( ti99_8_50hz, ti99_8_state )
/* Console GROMs */
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
/* Pascal GROM libraries. */
MCFG_GROM_LIBRARY_ADD8(pascal1_grom, pascal1)

View File

@ -93,7 +93,8 @@
Constructor.
*/
ti99_grom_device::ti99_grom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: bus8z_device(mconfig, GROM, "TI-99 GROM device", tag, owner, clock, "ti99_grom", __FILE__)
: bus8z_device(mconfig, GROM, "TI-99 GROM device", tag, owner, clock, "ti99_grom", __FILE__),
m_gromready(*this)
{
}
@ -252,7 +253,7 @@ void ti99_grom_device::device_start(void)
m_clockrate = conf->clockrate;
m_writable = conf->writable;
m_ident = conf->ident;
m_gromready.resolve(conf->ready, *this);
m_gromready.resolve_safe();
m_timer = timer_alloc(0);
}

View File

@ -22,13 +22,14 @@ struct ti99grom_config
const char *regionname;
offs_t offset_reg;
int size;
devcb_write_line ready;
int clockrate;
};
#define GROM_CONFIG(name) \
const ti99grom_config(name) =
#define MCFG_GROM_READY_CALLBACK(_write) \
devcb = &ti99_grom_device::set_ready_wr_callback(*device, DEVCB2_##_write);
extern const device_type GROM;
@ -39,6 +40,9 @@ class ti99_grom_device : public bus8z_device, ti99grom_config
{
public:
ti99_grom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _Object> static devcb2_base &set_ready_wr_callback(device_t &device, _Object object) { return downcast<ti99_grom_device &>(device).m_gromready.set_callback(object); }
DECLARE_READ8Z_MEMBER(readz);
DECLARE_WRITE8_MEMBER(write);
@ -55,7 +59,7 @@ private:
int m_size;
// Ready callback. This line is usually connected to the READY pin of the CPU.
devcb_resolved_write_line m_gromready;
devcb2_write_line m_gromready;
// Frequency of the incoming GROM clock. In most application cases the
// GROM gets its clock from the video display processor (TMS9918)

View File

@ -1367,23 +1367,23 @@ void ti99_cartridge_device::device_config_complete()
static GROM_CONFIG(grom3_config)
{
false, 3, CARTGROM_TAG, 0x0000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti99_cartridge_device, ready_line), GROMFREQ
false, 3, CARTGROM_TAG, 0x0000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom4_config)
{
false, 4, CARTGROM_TAG, 0x2000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti99_cartridge_device, ready_line), GROMFREQ
false, 4, CARTGROM_TAG, 0x2000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom5_config)
{
false, 5, CARTGROM_TAG, 0x4000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti99_cartridge_device, ready_line), GROMFREQ
false, 5, CARTGROM_TAG, 0x4000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom6_config)
{
false, 6, CARTGROM_TAG, 0x6000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti99_cartridge_device, ready_line), GROMFREQ
false, 6, CARTGROM_TAG, 0x6000, 0x1800, GROMFREQ
};
static GROM_CONFIG(grom7_config)
{
false, 7, CARTGROM_TAG, 0x8000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti99_cartridge_device, ready_line), GROMFREQ
false, 7, CARTGROM_TAG, 0x8000, 0x1800, GROMFREQ
};
/*
@ -1391,10 +1391,15 @@ static GROM_CONFIG(grom7_config)
*/
static MACHINE_CONFIG_FRAGMENT( ti99_cartridge )
MCFG_GROM_ADD( GROM3_TAG, grom3_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
MCFG_GROM_ADD( GROM4_TAG, grom4_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
MCFG_GROM_ADD( GROM5_TAG, grom5_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
MCFG_GROM_ADD( GROM6_TAG, grom6_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
MCFG_GROM_ADD( GROM7_TAG, grom7_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
MACHINE_CONFIG_END
machine_config_constructor ti99_cartridge_device::device_mconfig_additions() const

View File

@ -205,35 +205,35 @@ WRITE8_MEMBER(ti_pcode_card_device::cruwrite)
static GROM_CONFIG(pgrom0_config)
{
false, 0, PCODE_GROM_TAG, 0x0000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 0, PCODE_GROM_TAG, 0x0000, 0x1800, GROMFREQ
};
static GROM_CONFIG(pgrom1_config)
{
false, 1, PCODE_GROM_TAG, 0x2000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 1, PCODE_GROM_TAG, 0x2000, 0x1800, GROMFREQ
};
static GROM_CONFIG(pgrom2_config)
{
false, 2, PCODE_GROM_TAG, 0x4000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 2, PCODE_GROM_TAG, 0x4000, 0x1800, GROMFREQ
};
static GROM_CONFIG(pgrom3_config)
{
false, 3, PCODE_GROM_TAG, 0x6000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 3, PCODE_GROM_TAG, 0x6000, 0x1800, GROMFREQ
};
static GROM_CONFIG(pgrom4_config)
{
false, 4, PCODE_GROM_TAG, 0x8000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 4, PCODE_GROM_TAG, 0x8000, 0x1800, GROMFREQ
};
static GROM_CONFIG(pgrom5_config)
{
false, 5, PCODE_GROM_TAG, 0xa000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 5, PCODE_GROM_TAG, 0xa000, 0x1800, GROMFREQ
};
static GROM_CONFIG(pgrom6_config)
{
false, 6, PCODE_GROM_TAG, 0xc000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 6, PCODE_GROM_TAG, 0xc000, 0x1800, GROMFREQ
};
static GROM_CONFIG(pgrom7_config)
{
false, 7, PCODE_GROM_TAG, 0xe000, 0x1800, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, ti_pcode_card_device, ready_line), GROMFREQ
false, 7, PCODE_GROM_TAG, 0xe000, 0x1800, GROMFREQ
};
void ti_pcode_card_device::device_start()
@ -281,13 +281,21 @@ INPUT_CHANGED_MEMBER( ti_pcode_card_device::switch_changed )
MACHINE_CONFIG_FRAGMENT( ti99_pcode )
MCFG_GROM_ADD( PGROM0_TAG, pgrom0_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MCFG_GROM_ADD( PGROM1_TAG, pgrom1_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MCFG_GROM_ADD( PGROM2_TAG, pgrom2_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MCFG_GROM_ADD( PGROM3_TAG, pgrom3_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MCFG_GROM_ADD( PGROM4_TAG, pgrom4_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MCFG_GROM_ADD( PGROM5_TAG, pgrom5_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MCFG_GROM_ADD( PGROM6_TAG, pgrom6_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MCFG_GROM_ADD( PGROM7_TAG, pgrom7_config )
MCFG_GROM_READY_CALLBACK(WRITELINE(ti_pcode_card_device, ready_line))
MACHINE_CONFIG_END
INPUT_PORTS_START( ti99_pcode )