From 7b77f1218624ea26dbb2efd85a19f795f5d4e02e Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 17 Dec 2007 15:19:59 +0000 Subject: Initial checkin of MAME 0.121. --- src/emu/machine/6526cia.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/emu/machine/6526cia.h (limited to 'src/emu/machine/6526cia.h') diff --git a/src/emu/machine/6526cia.h b/src/emu/machine/6526cia.h new file mode 100644 index 00000000000..8f6acf0b5aa --- /dev/null +++ b/src/emu/machine/6526cia.h @@ -0,0 +1,58 @@ +/********************************************************************** + + MOS 6526/8520 CIA interface and emulation + + This function emulates all the functionality of up to 2 MOS6526 or + MOS8520 complex interface adapters. + +**********************************************************************/ + +#ifndef _6526CIA_H_ +#define _6526CIA_H_ + +typedef enum +{ + CIA6526, + CIA8520 +} cia_type_t; + +typedef struct _cia6526_interface cia6526_interface; +struct _cia6526_interface +{ + cia_type_t type; + void (*irq_func)(int state); + int clock; + int tod_clock; + + struct + { + UINT8 (*read)(void); + void (*write)(UINT8); + } port[2]; +}; + +/* configuration and reset */ +void cia_config(int which, const cia6526_interface *intf); +void cia_reset(void); + +/* reading and writing */ +UINT8 cia_read(int which, offs_t offset); +void cia_write(int which, offs_t offset, UINT8 data); +void cia_clock_tod(int which); +void cia_issue_index(int which); +void cia_set_input_cnt(int which, int data); +void cia_set_input_sp(int which, int data); + +/* accessors */ +UINT8 cia_get_output_a(int which); +UINT8 cia_get_output_b(int which); +int cia_get_irq(int which); + +/* standard handlers */ +READ8_HANDLER( cia_0_r ); +READ8_HANDLER( cia_1_r ); + +WRITE8_HANDLER( cia_0_w ); +WRITE8_HANDLER( cia_1_w ); + +#endif /* _6526CIA_H_ */ -- cgit v1.2.3-70-g09d2