summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/mame.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-11-26 23:43:19 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-11-26 23:43:19 +0000
commitcdd9d7c75755992b00a51392b456b6cfcc2bdb60 (patch)
tree402d3158aa2ff8996dbf32256321595b39636caa /src/emu/mame.h
parent1583458859bd0e9a75654063b6785269d68054dc (diff)
Introduced a generic_pointers structure within machine that is
designed to hold generic pointers that are commonly used. For now, only generic_nvram has moved there. Added AM_BASE_GENERIC and AM_SIZE_GENERIC macros for initializing generic pointers in memory maps. Also added AM_BASE_SIZE_GENERIC to set both base and size in one step. Moved global variables out of machine/generic and into a private data structure hanging off of the running_machine. Added newly- needed machine parameters to coin_counter_w, coin_lockout_w, and coin_lockout_global_w. Also added machine parameter to set_led_state. Added interface functions to get the number of dispensed tickets and to increment the count, to remove the need for direct access to these global variables. Also added functions to get the current count on a particular coin counter and to determine the lockout state. Future checkins will move the remaining generic pointers (for paletteram, videoram, spriteram, colorram, etc.) into the new generic_pointers structure.
Diffstat (limited to 'src/emu/mame.h')
-rw-r--r--src/emu/mame.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/emu/mame.h b/src/emu/mame.h
index 80ac78d5240..a6b2abcf3d7 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -140,6 +140,31 @@ typedef struct _ui_input_private ui_input_private;
typedef struct _cheat_private cheat_private;
typedef struct _debugcpu_private debugcpu_private;
typedef struct _debugvw_private debugvw_private;
+typedef struct _generic_machine_private generic_machine_private;
+
+
+/* structure to hold a pointer/size pair for generic pointers */
+typedef struct _generic_ptr generic_ptr;
+struct _generic_ptr
+{
+ union
+ {
+ void * v;
+ UINT8 * u8;
+ UINT16 * u16;
+ UINT32 * u32;
+ UINT64 * u64;
+ } ptr;
+ size_t size;
+};
+
+
+/* this structure holds generic pointers that are commonly used */
+typedef struct _generic_pointers generic_pointers;
+struct _generic_pointers
+{
+ generic_ptr nvram; /* generic NVRAM */
+};
/* description of the currently-running machine */
@@ -173,6 +198,9 @@ struct _running_machine
/* debugger-related information */
UINT32 debug_flags; /* the current debug flags */
+
+ /* generic pointers */
+ generic_pointers generic; /* generic pointers */
/* internal core information */
mame_private * mame_data; /* internal data from mame.c */
@@ -192,6 +220,7 @@ struct _running_machine
cheat_private * cheat_data; /* internal data from cheat.c */
debugcpu_private * debugcpu_data; /* internal data from debugcpu.c */
debugvw_private * debugvw_data; /* internal data from debugvw.c */
+ generic_machine_private *generic_machine_data; /* internal data from machine/generic.c */
#ifdef MESS
images_private * images_data; /* internal data from image.c */
ui_mess_private * ui_mess_data; /* internal data from uimess.c */