diff options
author | 2009-11-26 23:43:19 +0000 | |
---|---|---|
committer | 2009-11-26 23:43:19 +0000 | |
commit | cdd9d7c75755992b00a51392b456b6cfcc2bdb60 (patch) | |
tree | 402d3158aa2ff8996dbf32256321595b39636caa /src/emu/memory.h | |
parent | 1583458859bd0e9a75654063b6785269d68054dc (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/memory.h')
-rw-r--r-- | src/emu/memory.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/emu/memory.h b/src/emu/memory.h index b23ff7b186f..10ea9451d7d 100644 --- a/src/emu/memory.h +++ b/src/emu/memory.h @@ -77,8 +77,11 @@ enum ADDRMAP_TOKEN_SHARE, ADDRMAP_TOKEN_BASEPTR, ADDRMAP_TOKEN_BASE_MEMBER, + ADDRMAP_TOKEN_BASE_GENERIC, ADDRMAP_TOKEN_SIZEPTR, - ADDRMAP_TOKEN_SIZE_MEMBER + ADDRMAP_TOKEN_SIZE_MEMBER, + ADDRMAP_TOKEN_SIZE_GENERIC, + ADDRMAP_TOKEN_BASE_SIZE_GENERIC }; @@ -237,6 +240,8 @@ struct _address_map_entry size_t * sizeptr; /* receives size of area in bytes (optional) */ UINT32 baseptroffs_plus1; /* offset of base pointer within driver_data, plus 1 */ UINT32 sizeptroffs_plus1; /* offset of size pointer within driver_data, plus 1 */ + UINT32 genbaseptroffs_plus1;/* offset of base pointer within generic_pointers, plus 1 */ + UINT32 gensizeptroffs_plus1;/* offset of size pointer within generic_pointers, plus 1 */ const char * region; /* tag of region containing the memory backing this entry */ offs_t rgnoffs; /* offset within the region */ @@ -765,6 +770,9 @@ union _addrmap64_token #define AM_BASE_MEMBER(_struct, _member) \ TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_BASE_MEMBER, 8, offsetof(_struct, _member), 24), +#define AM_BASE_GENERIC(_member) \ + TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_BASE_GENERIC, 8, offsetof(generic_pointers, _member.ptr), 24), + #define AM_SIZE(_size) \ TOKEN_UINT32_PACK1(ADDRMAP_TOKEN_SIZEPTR, 8), \ TOKEN_PTR(sizeptr, _size), @@ -772,6 +780,12 @@ union _addrmap64_token #define AM_SIZE_MEMBER(_struct, _member) \ TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_SIZE_MEMBER, 8, offsetof(_struct, _member), 24), +#define AM_SIZE_GENERIC(_member) \ + TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_SIZE_GENERIC, 8, offsetof(generic_pointers, _member.size), 24), + +#define AM_BASE_SIZE_GENERIC(_member) \ + TOKEN_UINT32_PACK2(ADDRMAP_TOKEN_BASE_SIZE_GENERIC, 8, offsetof(generic_pointers, _member), 24), + /* common shortcuts */ #define AM_READWRITE(_read,_write) AM_READ(_read) AM_WRITE(_write) |