summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/6532riot.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-07-24 03:49:19 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-07-24 03:49:19 +0000
commit8e7a1a2553426ed06d6109bd375bb1842b6ac696 (patch)
tree765c1b1374a0688d83de769fac2885bad9f1b92f /src/emu/machine/6532riot.h
parent09d55104e269bfb8517c65bee950feccaf5c164f (diff)
Added new functions attotime_to_ticks() and ticks_to_attotime() to
convert between attotimes and a clock tick at an integral frequency. Changed the 6532 RIOT device into a proper device. Rewrote the logic to be simpler and leverage the new attotime functions. Changed the I/O port setters to specify a mask, and changed the I/O port callbacks to pass in the previous value. Updated tourtabl and gameplan drivers to use the new device interface. Converted audio/starwars.c, audio/exidy.c, and audio/gottlieb.c to use the new RIOT implementation instead of rolling their own. Began gottlieb.c cleanup. Converted palette calculations to resistor weights. Corrected video timing. Reduced the number of separate machine drivers. Fixed incorrect spriteram sizes. Populated full memory maps for the main CPU and the rev 1 sound board. More to come.
Diffstat (limited to 'src/emu/machine/6532riot.h')
-rw-r--r--src/emu/machine/6532riot.h136
1 files changed, 62 insertions, 74 deletions
diff --git a/src/emu/machine/6532riot.h b/src/emu/machine/6532riot.h
index e757e97c141..5adaf26e497 100644
--- a/src/emu/machine/6532riot.h
+++ b/src/emu/machine/6532riot.h
@@ -4,84 +4,72 @@
***************************************************************************/
-#ifndef RIOT_6532
-#define RIOT_6532
+#ifndef __RIOT6532_H__
+#define __RIOT6532_H__
-#define MAX_R6532 8
-struct riot6532_interface
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+typedef struct _riot6532_config riot6532_config;
+struct _riot6532_config
+{
+ UINT32 clock;
+};
+
+
+typedef UINT8 (*riot_read_func)(const device_config *device, UINT8 olddata);
+typedef void (*riot_write_func)(const device_config *device, UINT8 newdata, UINT8 olddata);
+typedef void (*riot_irq_func)(const device_config *device, int state);
+
+
+typedef struct _riot6532_interface riot6532_interface;
+struct _riot6532_interface
{
- read8_machine_func in_a_func;
- read8_machine_func in_b_func;
- write8_machine_func out_a_func;
- write8_machine_func out_b_func;
- void (*irq_func)(running_machine *machine, int state);
+ riot_read_func in_a_func;
+ riot_read_func in_b_func;
+ riot_write_func out_a_func;
+ riot_write_func out_b_func;
+ riot_irq_func irq_func;
};
-void r6532_set_clock(int which, int clock);
-void r6532_reset(running_machine *machine, int which);
-void r6532_config(running_machine *machine, int which, const struct riot6532_interface* intf);
-UINT8 r6532_read(running_machine *machine, int which, offs_t offset);
-void r6532_write(running_machine *machine, int which, offs_t offset, UINT8 data);
-void r6532_set_input_a(running_machine *machine, int which, UINT8 data);
-void r6532_set_input_b(int which, UINT8 data);
-
-/******************* Standard 8-bit CPU interfaces, D0-D7 *******************/
-
-READ8_HANDLER( r6532_0_r );
-READ8_HANDLER( r6532_1_r );
-READ8_HANDLER( r6532_2_r );
-READ8_HANDLER( r6532_3_r );
-READ8_HANDLER( r6532_4_r );
-READ8_HANDLER( r6532_5_r );
-READ8_HANDLER( r6532_6_r );
-READ8_HANDLER( r6532_7_r );
-
-WRITE8_HANDLER( r6532_0_w );
-WRITE8_HANDLER( r6532_1_w );
-WRITE8_HANDLER( r6532_2_w );
-WRITE8_HANDLER( r6532_3_w );
-WRITE8_HANDLER( r6532_4_w );
-WRITE8_HANDLER( r6532_5_w );
-WRITE8_HANDLER( r6532_6_w );
-WRITE8_HANDLER( r6532_7_w );
-
-/******************* 8-bit A/B port interfaces *******************/
-
-WRITE8_HANDLER( r6532_0_porta_w );
-WRITE8_HANDLER( r6532_1_porta_w );
-WRITE8_HANDLER( r6532_2_porta_w );
-WRITE8_HANDLER( r6532_3_porta_w );
-WRITE8_HANDLER( r6532_4_porta_w );
-WRITE8_HANDLER( r6532_5_porta_w );
-WRITE8_HANDLER( r6532_6_porta_w );
-WRITE8_HANDLER( r6532_7_porta_w );
-
-WRITE8_HANDLER( r6532_0_portb_w );
-WRITE8_HANDLER( r6532_1_portb_w );
-WRITE8_HANDLER( r6532_2_portb_w );
-WRITE8_HANDLER( r6532_3_portb_w );
-WRITE8_HANDLER( r6532_4_portb_w );
-WRITE8_HANDLER( r6532_5_portb_w );
-WRITE8_HANDLER( r6532_6_portb_w );
-WRITE8_HANDLER( r6532_7_portb_w );
-
-READ8_HANDLER( r6532_0_porta_r );
-READ8_HANDLER( r6532_1_porta_r );
-READ8_HANDLER( r6532_2_porta_r );
-READ8_HANDLER( r6532_3_porta_r );
-READ8_HANDLER( r6532_4_porta_r );
-READ8_HANDLER( r6532_5_porta_r );
-READ8_HANDLER( r6532_6_porta_r );
-READ8_HANDLER( r6532_7_porta_r );
-
-READ8_HANDLER( r6532_0_portb_r );
-READ8_HANDLER( r6532_1_portb_r );
-READ8_HANDLER( r6532_2_portb_r );
-READ8_HANDLER( r6532_3_portb_r );
-READ8_HANDLER( r6532_4_portb_r );
-READ8_HANDLER( r6532_5_portb_r );
-READ8_HANDLER( r6532_6_portb_r );
-READ8_HANDLER( r6532_7_portb_r );
+
+
+/***************************************************************************
+ DEVICE CONFIGURATION MACROS
+***************************************************************************/
+
+#define MDRV_RIOT6532_ADD(_tag, _clock, _intrf) \
+ MDRV_DEVICE_ADD(_tag, RIOT6532) \
+ MDRV_DEVICE_CONFIG_DATA32(riot6532_config, clock, _clock) \
+ MDRV_DEVICE_CONFIG(_intrf)
+
+#define MDRV_RIOT6532_REMOVE(_tag) \
+ MDRV_DEVICE_REMOVE(_tag, RIOT6532)
+
+
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+READ8_DEVICE_HANDLER( riot6532_r );
+WRITE8_DEVICE_HANDLER( riot6532_w );
+
+void riot6532_porta_in_set(const device_config *device, UINT8 data, UINT8 mask);
+void riot6532_portb_in_set(const device_config *device, UINT8 data, UINT8 mask);
+
+UINT8 riot6532_porta_in_get(const device_config *device);
+UINT8 riot6532_portb_in_get(const device_config *device);
+
+UINT8 riot6532_porta_out_get(const device_config *device);
+UINT8 riot6532_portb_out_get(const device_config *device);
+
+
+/* ----- device interface ----- */
+
+#define RIOT6532 DEVICE_GET_INFO_NAME(riot6532)
+DEVICE_GET_INFO( riot6532 );
#endif