mirror of
https://github.com/holub/mame
synced 2025-05-23 22:20:01 +03:00
CIA6526: slight interface cleanup
This commit is contained in:
parent
3292e64a31
commit
ff5c33c8d1
@ -83,6 +83,7 @@ struct _cia_state
|
||||
UINT8 icr;
|
||||
UINT8 ics;
|
||||
UINT8 irq;
|
||||
int flag;
|
||||
|
||||
/* Serial */
|
||||
UINT8 loaded;
|
||||
@ -192,6 +193,7 @@ static DEVICE_START( cia )
|
||||
state_save_register_device_item(device, 0, cia->icr);
|
||||
state_save_register_device_item(device, 0, cia->ics);
|
||||
state_save_register_device_item(device, 0, cia->irq);
|
||||
state_save_register_device_item(device, 0, cia->flag);
|
||||
state_save_register_device_item(device, 0, cia->loaded);
|
||||
state_save_register_device_item(device, 0, cia->sdr);
|
||||
state_save_register_device_item(device, 0, cia->sp);
|
||||
@ -640,6 +642,31 @@ void cia_set_input_cnt(const device_config *device, int data)
|
||||
cia->cnt = data ? 1 : 0;
|
||||
}
|
||||
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_tod_w )
|
||||
{
|
||||
if (state) cia_clock_tod(device);
|
||||
}
|
||||
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_cnt_w )
|
||||
{
|
||||
cia_set_input_cnt(device, state);
|
||||
}
|
||||
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_sp_w )
|
||||
{
|
||||
cia_set_input_sp(device, state);
|
||||
}
|
||||
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_flag_w )
|
||||
{
|
||||
cia_state *cia = get_token(device);
|
||||
|
||||
if (cia->flag && !state)
|
||||
{
|
||||
cia->flag = state;
|
||||
cia_issue_index(device);
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
cia_r
|
||||
|
@ -70,6 +70,11 @@ void cia_issue_index(const device_config *device);
|
||||
void cia_set_input_cnt(const device_config *device, int data);
|
||||
void cia_set_input_sp(const device_config *device, int data);
|
||||
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_tod_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_cnt_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_sp_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( mos6526_flag_w );
|
||||
|
||||
/* accessors */
|
||||
UINT8 cia_get_output_a(const device_config *device);
|
||||
UINT8 cia_get_output_b(const device_config *device);
|
||||
|
Loading…
Reference in New Issue
Block a user