Skip to content

Commit

Permalink
Converted PIT8253 to DEVCB2 [smf]
Browse files Browse the repository at this point in the history
  • Loading branch information
smf- committed Feb 23, 2014
1 parent ed701f1 commit 38d827e
Show file tree
Hide file tree
Showing 98 changed files with 997 additions and 1,894 deletions.
8 changes: 6 additions & 2 deletions src/emu/machine/8042kbdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ void kbdc8042_device::device_start()
m_input_buffer_full_func.resolve(m_input_buffer_full_cb, *this);
m_output_buffer_empty_func.resolve(m_output_buffer_empty_cb, *this);
m_speaker_func.resolve(m_speaker_cb, *this);
m_getout2_func.resolve(m_getout2_cb, *this);
machine().scheduler().timer_pulse(attotime::from_hz(60), timer_expired_delegate(FUNC(kbdc8042_device::kbdc8042_time),this));
at_keyboard_init(machine(), AT_KEYBOARD_TYPE_AT);
at_keyboard_set_scan_code_set(1);
Expand Down Expand Up @@ -399,7 +398,7 @@ READ8_MEMBER(kbdc8042_device::data_r)
break;

case 2:
if (m_getout2_func(0))
if (m_out2)
data |= 0x20;
else
data &= ~0x20;
Expand Down Expand Up @@ -622,3 +621,8 @@ WRITE8_MEMBER(kbdc8042_device::data_w)
break;
}
}

WRITE_LINE_MEMBER(kbdc8042_device::write_out2)
{
m_out2 = state;
}
6 changes: 4 additions & 2 deletions src/emu/machine/8042kbdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct kbdc8042_interface
devcb_write_line m_output_buffer_empty_cb;

devcb_write8 m_speaker_cb;
devcb_read8 m_getout2_cb;
};

// ======================> kbdc8042_device
Expand All @@ -57,12 +56,15 @@ class kbdc8042_device : public device_t,
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( data_w );

DECLARE_WRITE_LINE_MEMBER( write_out2 );

void at_8042_set_outport(UINT8 data, int initial);
TIMER_CALLBACK_MEMBER( kbdc8042_time );
TIMER_CALLBACK_MEMBER( kbdc8042_clr_int );
void at_8042_receive(UINT8 data);
void at_8042_check_keyboard();
void at_8042_clear_keyboard_received();

protected:
// device-level overrides
virtual void device_start();
Expand All @@ -88,6 +90,7 @@ class kbdc8042_device : public device_t,
int m_status_read_mode;

int m_speaker;
int m_out2;

/* temporary hack */
int m_offset1;
Expand All @@ -100,7 +103,6 @@ class kbdc8042_device : public device_t,
devcb_resolved_write_line m_output_buffer_empty_func;

devcb_resolved_write8 m_speaker_func;
devcb_resolved_read8 m_getout2_func;
};

// device type definition
Expand Down
23 changes: 8 additions & 15 deletions src/emu/machine/i80130.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,20 @@ const rom_entry *i80130_device::device_rom_region() const
}


//-------------------------------------------------
// pit8253_interface pit_intf
//-------------------------------------------------

static const struct pit8253_interface pit_intf =
{
{
{ 0, DEVCB_LINE_VCC, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, i80130_device, systick_w) },
{ 0, DEVCB_LINE_VCC, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, i80130_device, delay_w) },
{ 0, DEVCB_LINE_VCC, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, i80130_device, baud_w) }
}
};


//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( i80130 )
//-------------------------------------------------

static MACHINE_CONFIG_FRAGMENT( i80130 )
MCFG_PIC8259_ADD("pic", DEVWRITELINE(DEVICE_SELF, i80130_device, irq_w), VCC, NULL)
MCFG_PIT8254_ADD("pit", pit_intf)

MCFG_DEVICE_ADD("pit", PIT8254, 0)
MCFG_PIT8253_CLK0(0)
MCFG_PIT8253_OUT0_HANDLER(WRITELINE(i80130_device, systick_w))
MCFG_PIT8253_CLK1(0)
MCFG_PIT8253_OUT1_HANDLER(WRITELINE(i80130_device, delay_w))
MCFG_PIT8253_CLK2(0)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(i80130_device, baud_w))
MACHINE_CONFIG_END


Expand Down
Loading

0 comments on commit 38d827e

Please sign in to comment.