Removed NOTIMER hack from Z80 CTC interface (Star Force was

the only one using it). The first parameter of the interface 
struct is now gone.
This commit is contained in:
Aaron Giles 2012-08-08 08:41:33 +00:00
parent 081fb69aec
commit 90308bc48f
15 changed files with 12 additions and 56 deletions

View File

@ -128,7 +128,6 @@ static I8255_INTERFACE(ppi1intf)
static Z80CTC_INTERFACE( ctcintf ) static Z80CTC_INTERFACE( ctcintf )
{ {
0,
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, pioneer_ldv1000_device, ctc_interrupt), DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, pioneer_ldv1000_device, ctc_interrupt),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,

View File

@ -133,7 +133,6 @@ void z80ctc_device::device_config_complete()
// or initialize to defaults if none provided // or initialize to defaults if none provided
else else
{ {
m_notimer = 0;
memset(&m_intr_cb, 0, sizeof(m_intr_cb)); memset(&m_intr_cb, 0, sizeof(m_intr_cb));
memset(&m_zc0_cb, 0, sizeof(m_zc0_cb)); memset(&m_zc0_cb, 0, sizeof(m_zc0_cb));
memset(&m_zc1_cb, 0, sizeof(m_zc1_cb)); memset(&m_zc1_cb, 0, sizeof(m_zc1_cb));
@ -156,10 +155,10 @@ void z80ctc_device::device_start()
// start each channel // start each channel
devcb_write_line nullcb = DEVCB_NULL; devcb_write_line nullcb = DEVCB_NULL;
m_channel[0].start(this, 0, (m_notimer & NOTIMER_0) != 0, m_zc0_cb); m_channel[0].start(this, 0, m_zc0_cb);
m_channel[1].start(this, 1, (m_notimer & NOTIMER_1) != 0, m_zc1_cb); m_channel[1].start(this, 1, m_zc1_cb);
m_channel[2].start(this, 2, (m_notimer & NOTIMER_2) != 0, m_zc2_cb); m_channel[2].start(this, 2, m_zc2_cb);
m_channel[3].start(this, 3, (m_notimer & NOTIMER_3) != 0, nullcb); m_channel[3].start(this, 3, nullcb);
// register for save states // register for save states
save_item(NAME(m_vector)); save_item(NAME(m_vector));
@ -301,8 +300,7 @@ void z80ctc_device::interrupt_check()
//------------------------------------------------- //-------------------------------------------------
z80ctc_device::ctc_channel::ctc_channel() z80ctc_device::ctc_channel::ctc_channel()
: m_notimer(false), : m_mode(0),
m_mode(0),
m_tconst(0), m_tconst(0),
m_down(0), m_down(0),
m_extclk(0), m_extclk(0),
@ -317,13 +315,12 @@ z80ctc_device::ctc_channel::ctc_channel()
// start - set up at device start time // start - set up at device start time
//------------------------------------------------- //-------------------------------------------------
void z80ctc_device::ctc_channel::start(z80ctc_device *device, int index, bool notimer, const devcb_write_line &write_line) void z80ctc_device::ctc_channel::start(z80ctc_device *device, int index, const devcb_write_line &write_line)
{ {
// initialize state // initialize state
m_device = device; m_device = device;
m_index = index; m_index = index;
m_zc.resolve(write_line, *m_device); m_zc.resolve(write_line, *m_device);
m_notimer = notimer;
m_timer = m_device->machine().scheduler().timer_alloc(FUNC(static_timer_callback), this); m_timer = m_device->machine().scheduler().timer_alloc(FUNC(static_timer_callback), this);
// register for save states // register for save states
@ -422,13 +419,8 @@ void z80ctc_device::ctc_channel::write(UINT8 data)
// if we're triggering on the time constant, reset the down counter now // if we're triggering on the time constant, reset the down counter now
if ((m_mode & TRIGGER) == TRIGGER_AUTO) if ((m_mode & TRIGGER) == TRIGGER_AUTO)
{ {
if (!m_notimer) attotime curperiod = period();
{ m_timer->adjust(curperiod, m_index, curperiod);
attotime curperiod = period();
m_timer->adjust(curperiod, m_index, curperiod);
}
else
m_timer->adjust(attotime::never);
} }
// else set the bit indicating that we're waiting for the appropriate trigger // else set the bit indicating that we're waiting for the appropriate trigger
@ -491,17 +483,9 @@ void z80ctc_device::ctc_channel::trigger(UINT8 data)
// if we're waiting for a trigger, start the timer // if we're waiting for a trigger, start the timer
if ((m_mode & WAITING_FOR_TRIG) && (m_mode & MODE) == MODE_TIMER) if ((m_mode & WAITING_FOR_TRIG) && (m_mode & MODE) == MODE_TIMER)
{ {
if (!m_notimer) attotime curperiod = period();
{ VPRINTF(("CTC period %s\n", curperiod.as_string()));
attotime curperiod = period(); m_timer->adjust(curperiod, m_index, curperiod);
VPRINTF(("CTC period %s\n", curperiod.as_string()));
m_timer->adjust(curperiod, m_index, curperiod);
}
else
{
VPRINTF(("CTC disabled\n"));
m_timer->adjust(attotime::never);
}
} }
// we're no longer waiting // we're no longer waiting

View File

@ -30,17 +30,6 @@
#include "cpu/z80/z80daisy.h" #include "cpu/z80/z80daisy.h"
//**************************************************************************
// CONSTANTS
//**************************************************************************
const int NOTIMER_0 = (1<<0);
const int NOTIMER_1 = (1<<1);
const int NOTIMER_2 = (1<<2);
const int NOTIMER_3 = (1<<3);
//************************************************************************** //**************************************************************************
// DEVICE CONFIGURATION MACROS // DEVICE CONFIGURATION MACROS
//************************************************************************** //**************************************************************************
@ -64,7 +53,6 @@ const int NOTIMER_3 = (1<<3);
struct z80ctc_interface struct z80ctc_interface
{ {
UINT8 m_notimer; // timer disabler mask
devcb_write_line m_intr_cb; // callback when change interrupt status devcb_write_line m_intr_cb; // callback when change interrupt status
devcb_write_line m_zc0_cb; // ZC/TO0 callback devcb_write_line m_zc0_cb; // ZC/TO0 callback
devcb_write_line m_zc1_cb; // ZC/TO1 callback devcb_write_line m_zc1_cb; // ZC/TO1 callback
@ -120,7 +108,7 @@ private:
public: public:
ctc_channel(); ctc_channel();
void start(z80ctc_device *device, int index, bool notimer, const devcb_write_line &write_line); void start(z80ctc_device *device, int index, const devcb_write_line &write_line);
void reset(); void reset();
UINT8 read(); UINT8 read();
@ -133,7 +121,6 @@ private:
z80ctc_device * m_device; // pointer back to our device z80ctc_device * m_device; // pointer back to our device
int m_index; // our channel index int m_index; // our channel index
devcb_resolved_write_line m_zc; // zero crossing callbacks devcb_resolved_write_line m_zc; // zero crossing callbacks
bool m_notimer; // timer disabled?
UINT16 m_mode; // current mode UINT16 m_mode; // current mode
UINT16 m_tconst; // time constant UINT16 m_tconst; // time constant
UINT16 m_down; // down counter (clock mode only) UINT16 m_down; // down counter (clock mode only)

View File

@ -120,7 +120,6 @@ static WRITE_LINE_DEVICE_HANDLER( ctc_timer_2_w )
Z80CTC_INTERFACE( cchasm_ctc_intf ) Z80CTC_INTERFACE( cchasm_ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_NULL, /* ZC/TO0 callback */ DEVCB_NULL, /* ZC/TO0 callback */
DEVCB_LINE(ctc_timer_1_w), /* ZC/TO1 callback */ DEVCB_LINE(ctc_timer_1_w), /* ZC/TO1 callback */

View File

@ -1397,7 +1397,6 @@ static const ay8910_interface demon_ay8910_interface_3 =
static Z80CTC_INTERFACE( demon_z80ctc_interface ) static Z80CTC_INTERFACE( demon_z80ctc_interface )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_NULL, /* ZC/TO0 callback */ DEVCB_NULL, /* ZC/TO0 callback */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -33,7 +33,6 @@ Z80PIO_INTERFACE( senjyo_pio_intf )
/* z80 ctc */ /* z80 ctc */
Z80CTC_INTERFACE( senjyo_ctc_intf ) Z80CTC_INTERFACE( senjyo_ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("sub", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("sub", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_DEVICE_LINE_MEMBER("z80ctc", z80ctc_device, trg1), /* ZC/TO0 callback */ DEVCB_DEVICE_LINE_MEMBER("z80ctc", z80ctc_device, trg1), /* ZC/TO0 callback */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -501,7 +501,6 @@ WRITE8_MEMBER(astrocde_state::demndrgn_sound_w)
static Z80CTC_INTERFACE( ctc_intf ) static Z80CTC_INTERFACE( ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("sub", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("sub", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_NULL, /* ZC/TO0 callback */ DEVCB_NULL, /* ZC/TO0 callback */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -565,7 +565,6 @@ GFXDECODE_END
static Z80CTC_INTERFACE( ctc_intf ) static Z80CTC_INTERFACE( ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0),/* interrupt handler */ DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0),/* interrupt handler */
DEVCB_DEVICE_LINE_MEMBER("ctc", z80ctc_device, trg3), /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */ DEVCB_DEVICE_LINE_MEMBER("ctc", z80ctc_device, trg3), /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -169,7 +169,6 @@ static int serial_receive(device_t *device, int channel)
static Z80CTC_INTERFACE( ctc_intf ) static Z80CTC_INTERFACE( ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_NULL, /* ZC/TO0 callback */ DEVCB_NULL, /* ZC/TO0 callback */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -293,7 +293,6 @@ INPUT_PORTS_END
static Z80CTC_INTERFACE( ctc_intf ) static Z80CTC_INTERFACE( ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_NULL, /* ZC/TO0 callback */ DEVCB_NULL, /* ZC/TO0 callback */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -620,7 +620,6 @@ static INTERRUPT_GEN( ctc0_trg1 )
static Z80CTC_INTERFACE( ctc_intf_main ) static Z80CTC_INTERFACE( ctc_intf_main )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),/* interrupt handler */ DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),/* interrupt handler */
DEVCB_NULL, /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */ DEVCB_NULL, /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */
@ -629,7 +628,6 @@ static Z80CTC_INTERFACE( ctc_intf_main )
static Z80CTC_INTERFACE( ctc_intf_audio ) static Z80CTC_INTERFACE( ctc_intf_audio )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0),/* interrupt handler */ DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0),/* interrupt handler */
DEVCB_DEVICE_LINE_MEMBER("audio_ctc", z80ctc_device, trg3), /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */ DEVCB_DEVICE_LINE_MEMBER("audio_ctc", z80ctc_device, trg3), /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -237,7 +237,6 @@ WRITE8_MEMBER(niyanpai_state::tmpz84c011_0_dir_pe_w)
static Z80CTC_INTERFACE( ctc_intf ) static Z80CTC_INTERFACE( ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0),/* interrupt handler */ DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0),/* interrupt handler */
DEVCB_DEVICE_LINE_MEMBER("ctc", z80ctc_device, trg3), /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */ DEVCB_DEVICE_LINE_MEMBER("ctc", z80ctc_device, trg3), /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */

View File

@ -314,7 +314,6 @@ GFXDECODE_END
static Z80CTC_INTERFACE( ctc_intf ) static Z80CTC_INTERFACE( ctc_intf )
{ {
0, // timer disables
DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0), // interrupt handler DEVCB_CPU_INPUT_LINE("audiocpu", INPUT_LINE_IRQ0), // interrupt handler
DEVCB_NULL, // ZC/TO0 callback DEVCB_NULL, // ZC/TO0 callback
DEVCB_NULL, // ZC/TO1 callback DEVCB_NULL, // ZC/TO1 callback

View File

@ -251,7 +251,6 @@ static Z80PIO_INTERFACE( pio_interface_5 )
static Z80CTC_INTERFACE( ctc_intf ) static Z80CTC_INTERFACE( ctc_intf )
{ {
0, // timer disables
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_NULL, // ZC/TO0 callback DEVCB_NULL, // ZC/TO0 callback
DEVCB_NULL, // ZC/TO1 callback DEVCB_NULL, // ZC/TO1 callback

View File

@ -104,7 +104,6 @@ const z80_daisy_config mcr_ipu_daisy_chain[] =
Z80CTC_INTERFACE( mcr_ctc_intf ) Z80CTC_INTERFACE( mcr_ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_DEVICE_LINE_MEMBER("ctc", z80ctc_device, trg1), /* ZC/TO0 callback */ DEVCB_DEVICE_LINE_MEMBER("ctc", z80ctc_device, trg1), /* ZC/TO0 callback */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */
@ -114,7 +113,6 @@ Z80CTC_INTERFACE( mcr_ctc_intf )
Z80CTC_INTERFACE( nflfoot_ctc_intf ) Z80CTC_INTERFACE( nflfoot_ctc_intf )
{ {
0, /* timer disables */
DEVCB_CPU_INPUT_LINE("ipu", INPUT_LINE_IRQ0), /* interrupt handler */ DEVCB_CPU_INPUT_LINE("ipu", INPUT_LINE_IRQ0), /* interrupt handler */
DEVCB_NULL, /* ZC/TO0 callback */ DEVCB_NULL, /* ZC/TO0 callback */
DEVCB_NULL, /* ZC/TO1 callback */ DEVCB_NULL, /* ZC/TO1 callback */