summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/8255ppi.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-01-26 16:25:48 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-01-26 16:25:48 +0000
commit2fd8c5122b62708667bce8203b00d3976b08d9c2 (patch)
treeb5a243dc547553153505f5ae76edca7d4a20ff5e /src/emu/machine/8255ppi.h
parent6640f6d8da5ff65f2f59123989ff56d183e28428 (diff)
Added new module devcb, which can generically handle conversions between device
read/write functions and various other types of functions. Introduced new structures and macros to make this possible. To take advantage of this, a device must change its interface to replace and read/write callbacks with the new devcb_read/write structures. During device start time, the device then uses this new devcb module to resolve the information in the devcb_read/write structures into a more efficient form. When the device needs to call one of the callbacks, it uses the inline devcb_call_read/write functions. Once a device has defined its callbacks as devcb_read/write structures, users of the device must use the DEVCB_* macros to specify the type and information about the handler to use: DEVCB_NULL = no handler DEVCB_HANDLER = a standard device read/write handler DEVCB_MEMORY_HANDLER = a memory address space read/write handler DEVCB_DEVICE_HANDLER = a device read/write handler for a different device DEVCB_INPUT_PORT = an input port Converted the 8255PPI device to use this new structure, and updated all users to use the DEVCB macros, removing some unnecessary trampoline functions along the way.
Diffstat (limited to 'src/emu/machine/8255ppi.h')
-rw-r--r--src/emu/machine/8255ppi.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/emu/machine/8255ppi.h b/src/emu/machine/8255ppi.h
index b29d940a7b9..63da954c212 100644
--- a/src/emu/machine/8255ppi.h
+++ b/src/emu/machine/8255ppi.h
@@ -9,6 +9,9 @@
#ifndef __8255PPI_H_
#define __8255PPI_H_
+#include "devcb.h"
+
+
#define PPI8255 DEVICE_GET_INFO_NAME(ppi8255)
@@ -19,12 +22,12 @@
typedef struct _ppi8255_interface ppi8255_interface;
struct _ppi8255_interface
{
- read8_device_func port_a_read;
- read8_device_func port_b_read;
- read8_device_func port_c_read;
- write8_device_func port_a_write;
- write8_device_func port_b_write;
- write8_device_func port_c_write;
+ devcb_read8 port_a_read;
+ devcb_read8 port_b_read;
+ devcb_read8 port_c_read;
+ devcb_write8 port_a_write;
+ devcb_write8 port_b_write;
+ devcb_write8 port_c_write;
};
@@ -52,13 +55,13 @@ READ8_DEVICE_HANDLER( ppi8255_r );
WRITE8_DEVICE_HANDLER( ppi8255_w );
-void ppi8255_set_port_a_read( const device_config *device, read8_device_func port_a_read );
-void ppi8255_set_port_b_read( const device_config *device, read8_device_func port_b_read );
-void ppi8255_set_port_c_read( const device_config *device, read8_device_func port_c_read );
+void ppi8255_set_port_a_read( const device_config *device, const devcb_read8 *config );
+void ppi8255_set_port_b_read( const device_config *device, const devcb_read8 *config );
+void ppi8255_set_port_c_read( const device_config *device, const devcb_read8 *config );
-void ppi8255_set_port_a_write( const device_config *device, write8_device_func port_a_write );
-void ppi8255_set_port_b_write( const device_config *device, write8_device_func port_b_write );
-void ppi8255_set_port_c_write( const device_config *device, write8_device_func port_c_write );
+void ppi8255_set_port_a_write( const device_config *device, const devcb_write8 *config );
+void ppi8255_set_port_b_write( const device_config *device, const devcb_write8 *config );
+void ppi8255_set_port_c_write( const device_config *device, const devcb_write8 *config );
void ppi8255_set_port_a( const device_config *device, UINT8 data );
void ppi8255_set_port_b( const device_config *device, UINT8 data );