Added an alternate set of address map macros. Now, if you

#define ADDRESS_MAP_MODERN prior to #including "emu.h", you will
get the new macros, which have the following properties:

* ADDRESS_MAP_START takes a 4th parameter, which is the name of the
   driver_data class the other macros will reference

* AM_READ/AM_WRITE/etc. all assume you are providing method names off
   of the driver_data class you originally specified

* AM_READ_LEGACY/AM_WRITE_LEGACY macros are provided for calling
   global static functions of yore

* AM_BASE/AM_SIZE all assume you are providing member names off of the
   driver_Data class

* AM_BASE_LEGACY/AM_SIZE_LEGACY are provided to reference globals if
   necessary

Also removed AM_READ_MEMBER/AM_WRITE_MEMBER/etc from the non-modern
macros. If you want to use member functions in the address map, you
are now required to use the new macros.
This commit is contained in:
Aaron Giles 2010-08-21 23:47:07 +00:00
parent d0cb76c6fe
commit aafb63c072
2 changed files with 350 additions and 110 deletions

View File

@ -438,10 +438,23 @@ public:
// ADDRESS MAP MACROS
//**************************************************************************
//
// There are two versions of the macros below
//
// By default, the legacy forms are enabled; however, if ADDRESS_MAP_MODERN is #defined
// prior to including this file, the new format are enabled instead.
//
// so that "0" can be used for unneeded address maps
#define construct_address_map_0 NULL
#ifndef ADDRESS_MAP_MODERN
//
// Legacy ADDRESS_MAPs
//
// start/end tags for the address map
#define ADDRESS_MAP_NAME(_name) construct_address_map_##_name
@ -573,90 +586,6 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
// driver data reads
#define AM_READ_MEMBER(_class, _handler) \
curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \
#define AM_READ8_MEMBER(_class, _handler, _unitmask) \
curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_READ16_MEMBER(_class, _handler, _unitmask) \
curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_READ32_MEMBER(_class, _handler, _unitmask) \
curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
// driver data writes
#define AM_WRITE_MEMBER(_class, _handler) \
curentry->set_handler(devconfig, NULL, write_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \
#define AM_WRITE8_MEMBER(_class, _handler, _unitmask) \
curentry->set_handler(devconfig, NULL, write8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_WRITE16_MEMBER(_class, _handler, _unitmask) \
curentry->set_handler(devconfig, NULL, write16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_WRITE32_MEMBER(_class, _handler, _unitmask) \
curentry->set_handler(devconfig, NULL, write32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
// driver data reads/writes
#define AM_READWRITE_MEMBER(_class, _rhandler, _whandler) \
curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler)); \
#define AM_READWRITE8_MEMBER(_class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write8_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
#define AM_READWRITE16_MEMBER(_class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write16_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
#define AM_READWRITE32_MEMBER(_class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write32_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
// device reads
#define AM_DEVREAD_MEMBER(_tag, _class, _handler) \
curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \
#define AM_DEVREAD8_MEMBER(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVREAD16_MEMBER(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVREAD32_MEMBER(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
// device writes
#define AM_DEVWRITE_MEMBER(_tag, _class, _handler) \
curentry->set_handler(devconfig, _tag, write_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \
#define AM_DEVWRITE8_MEMBER(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, write8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVWRITE16_MEMBER(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, write16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVWRITE32_MEMBER(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, write32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
// device reads/writes
#define AM_DEVREADWRITE_MEMBER(_tag, _class, _rhandler, _whandler) \
curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler)); \
#define AM_DEVREADWRITE8_MEMBER(_tag, _class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write8_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
#define AM_DEVREADWRITE16_MEMBER(_tag, _class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write16_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
#define AM_DEVREADWRITE32_MEMBER(_tag, _class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write32_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
// special-case accesses
#define AM_ROM \
curentry->set_read_type(AMH_ROM); \
@ -739,18 +668,328 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
#define AM_ROMBANK(_bank) AM_READ_BANK(_bank)
#define AM_RAMBANK(_bank) AM_READWRITE_BANK(_bank)
#define AM_RAM_READ(_read) AM_READ(_read) AM_WRITEONLY
#define AM_RAM_READ_MEMBER(_class, _read) AM_READ_MEMBER(_class, _read) AM_WRITEONLY
#define AM_RAM_WRITE(_write) AM_READONLY AM_WRITE(_write)
#define AM_RAM_WRITE_MEMBER(_class, _write) AM_READONLY AM_WRITE_MEMBER(_class, _write)
#define AM_RAM_DEVREAD(_tag, _read) AM_DEVREAD(_tag, _read) AM_WRITEONLY
#define AM_RAM_DEVREAD_MEMBER(_tag, _class, _read) AM_DEVREAD_MEMBER(_tag, _class, _read) AM_WRITEONLY
#define AM_RAM_DEVWRITE(_tag, _write) AM_READONLY AM_DEVWRITE(_tag, _write)
#define AM_RAM_DEVWRITE_MEMBER(_tag, _class, _write) AM_READONLY AM_DEVWRITE_MEMBER(_tag, _class, _write)
#define AM_BASE_SIZE_MEMBER(_struct, _base, _size) AM_BASE_MEMBER(_struct, _base) AM_SIZE_MEMBER(_struct, _size)
#define AM_BASE_SIZE_GENERIC(_member) AM_BASE_GENERIC(_member) AM_SIZE_GENERIC(_member)
#else
//
// Modern ADDRESS_MAPs
//
// start/end tags for the address map
#define ADDRESS_MAP_NAME(_name) construct_address_map_##_name
#define ADDRESS_MAP_START(_name, _space, _bits, _class) \
void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
{ \
typedef read##_bits##_proto_delegate read_proto_delegate; \
typedef write##_bits##_proto_delegate write_proto_delegate; \
address_map_entry##_bits *curentry = NULL; \
(void)curentry; \
map.configure(_space, _bits); \
typedef _class drivdata_class; \
#define ADDRESS_MAP_END \
}
// use this to declare external references to an address map
#define ADDRESS_MAP_EXTERN(_name, _bits) \
extern void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig)
// global controls
#define ADDRESS_MAP_GLOBAL_MASK(_mask) \
map.set_global_mask(_mask); \
#define ADDRESS_MAP_UNMAP_LOW \
map.set_unmap_value(0); \
#define ADDRESS_MAP_UNMAP_HIGH \
map.set_unmap_value(~0); \
// importing data from other address maps
#define AM_IMPORT_FROM(_name) \
ADDRESS_MAP_NAME(_name)(map, devconfig); \
// address ranges
#define AM_RANGE(_start, _end) \
curentry = map.add(_start, _end, curentry); \
#define AM_MASK(_mask) \
curentry->set_mask(_mask); \
#define AM_MIRROR(_mirror) \
curentry->set_mirror(_mirror); \
// legacy space reads
#define AM_READ_LEGACY(_handler) \
curentry->set_handler(_handler, #_handler); \
#define AM_READ8_LEGACY(_handler, _unitmask) \
curentry->set_handler(_handler, #_handler, _unitmask); \
#define AM_READ16_LEGACY(_handler, _unitmask) \
curentry->set_handler(_handler, #_handler, _unitmask); \
#define AM_READ32_LEGACY(_handler, _unitmask) \
curentry->set_handler(_handler, #_handler, _unitmask); \
// legacy space writes
#define AM_WRITE_LEGACY(_handler) \
curentry->set_handler(_handler, #_handler); \
#define AM_WRITE8_LEGACY(_handler, _unitmask) \
curentry->set_handler(_handler, #_handler, _unitmask); \
#define AM_WRITE16_LEGACY(_handler, _unitmask) \
curentry->set_handler(_handler, #_handler, _unitmask); \
#define AM_WRITE32_LEGACY(_handler, _unitmask) \
curentry->set_handler(_handler, #_handler, _unitmask); \
// legacy space reads/writes
#define AM_READWRITE_LEGACY(_rhandler, _whandler) \
curentry->set_handler(_rhandler, #_rhandler, _whandler, #_whandler); \
#define AM_READWRITE8_LEGACY(_rhandler, _whandler, _unitmask) \
curentry->set_handler(_rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_READWRITE16_LEGACY(_rhandler, _whandler, _unitmask) \
curentry->set_handler(_rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_READWRITE32_LEGACY(_rhandler, _whandler, _unitmask) \
curentry->set_handler(_rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
// legacy device reads
#define AM_DEVREAD_LEGACY(_tag, _handler) \
curentry->set_handler(devconfig, _tag, _handler, #_handler); \
#define AM_DEVREAD8_LEGACY(_tag, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVREAD16_LEGACY(_tag, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVREAD32_LEGACY(_tag, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
// legacy device writes
#define AM_DEVWRITE_LEGACY(_tag, _handler) \
curentry->set_handler(devconfig, _tag, _handler, #_handler); \
#define AM_DEVWRITE8_LEGACY(_tag, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVWRITE16_LEGACY(_tag, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVWRITE32_LEGACY(_tag, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
// legacy device reads/writes
#define AM_DEVREADWRITE_LEGACY(_tag, _rhandler, _whandler) \
curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler); \
#define AM_DEVREADWRITE8_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_DEVREADWRITE16_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_DEVREADWRITE32_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
// driver data reads
#define AM_READ(_handler) \
curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler)); \
#define AM_READ8(_handler, _unitmask) \
curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \
#define AM_READ16(_handler, _unitmask) \
curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \
#define AM_READ32(_handler, _unitmask) \
curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \
// driver data writes
#define AM_WRITE(_handler) \
curentry->set_handler(devconfig, NULL, write_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler)); \
#define AM_WRITE8(_handler, _unitmask) \
curentry->set_handler(devconfig, NULL, write8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \
#define AM_WRITE16(_handler, _unitmask) \
curentry->set_handler(devconfig, NULL, write16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \
#define AM_WRITE32(_handler, _unitmask) \
curentry->set_handler(devconfig, NULL, write32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \
// driver data reads/writes
#define AM_READWRITE(_rhandler, _whandler) \
curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler)); \
#define AM_READWRITE8(_rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler), _unitmask); \
#define AM_READWRITE16(_rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler), _unitmask); \
#define AM_READWRITE32(_rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler), _unitmask); \
// device reads
#define AM_DEVREAD(_tag, _class, _handler) \
curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \
#define AM_DEVREAD8(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVREAD16(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVREAD32(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
// device writes
#define AM_DEVWRITE(_tag, _class, _handler) \
curentry->set_handler(devconfig, _tag, write_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \
#define AM_DEVWRITE8(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, write8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVWRITE16(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, write16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
#define AM_DEVWRITE32(_tag, _class, _handler, _unitmask) \
curentry->set_handler(devconfig, _tag, write32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \
// device reads/writes
#define AM_DEVREADWRITE(_tag, _class, _rhandler, _whandler) \
curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler)); \
#define AM_DEVREADWRITE8(_tag, _class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write8_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
#define AM_DEVREADWRITE16(_tag, _class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write16_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
#define AM_DEVREADWRITE32(_tag, _class, _rhandler, _whandler, _unitmask) \
curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write32_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \
// special-case accesses
#define AM_ROM \
curentry->set_read_type(AMH_ROM); \
#define AM_RAM \
curentry->set_read_type(AMH_RAM); \
curentry->set_write_type(AMH_RAM); \
#define AM_READONLY \
curentry->set_read_type(AMH_RAM); \
#define AM_WRITEONLY \
curentry->set_write_type(AMH_RAM); \
#define AM_UNMAP \
curentry->set_read_type(AMH_UNMAP); \
curentry->set_write_type(AMH_UNMAP); \
#define AM_NOP \
curentry->set_read_type(AMH_NOP); \
curentry->set_write_type(AMH_NOP); \
#define AM_READNOP \
curentry->set_read_type(AMH_NOP); \
#define AM_WRITENOP \
curentry->set_write_type(AMH_NOP); \
// port accesses
#define AM_READ_PORT(_tag) \
curentry->set_read_port(devconfig, _tag); \
#define AM_WRITE_PORT(_tag) \
curentry->set_write_port(devconfig, _tag); \
#define AM_READWRITE_PORT(_tag) \
curentry->set_readwrite_port(devconfig, _tag); \
// bank accesses
#define AM_READ_BANK(_tag) \
curentry->set_read_bank(devconfig, _tag); \
#define AM_WRITE_BANK(_tag) \
curentry->set_write_bank(devconfig, _tag); \
#define AM_READWRITE_BANK(_tag) \
curentry->set_readwrite_bank(devconfig, _tag); \
// attributes for accesses
#define AM_REGION(_tag, _offs) \
curentry->set_region(_tag, _offs); \
#define AM_SHARE(_tag) \
curentry->set_share(_tag); \
#define AM_BASE_LEGACY(_base) \
curentry->set_baseptr(_base); \
#define myoffsetof(_struct, _member) ((FPTR)&((_struct *)0x1000)->_member - 0x1000)
#define AM_BASE(_member) \
curentry->set_member_baseptr(myoffsetof(drivdata_class, _member)); \
#define AM_BASE_GENERIC(_member) \
curentry->set_generic_baseptr(myoffsetof(generic_pointers, _member)); \
#define AM_SIZE_LEGACY(_size) \
curentry->set_sizeptr(_size); \
#define AM_SIZE(_struct, _member) \
curentry->set_member_sizeptr(myoffsetof(drivdata_class, _member)); \
#define AM_SIZE_GENERIC(_member) \
curentry->set_generic_sizeptr(myoffsetof(generic_pointers, _member##_size)); \
// common shortcuts
#define AM_ROMBANK(_bank) AM_READ_BANK(_bank)
#define AM_RAMBANK(_bank) AM_READWRITE_BANK(_bank)
#define AM_RAM_READ(_read) AM_READ(_read) AM_WRITEONLY
#define AM_RAM_WRITE(_write) AM_READONLY AM_WRITE(_write)
#define AM_RAM_DEVREAD(_tag, _class, _read) AM_DEVREAD(_tag, _class, _read) AM_WRITEONLY
#define AM_RAM_DEVWRITE(_tag, _class, _write) AM_READONLY AM_DEVWRITE(_tag, _class, _write)
#define AM_BASE_SIZE(_base, _size) AM_BASE_MEMBER(_base) AM_SIZE_MEMBER(_size)
#define AM_BASE_SIZE_GENERIC(_member) AM_BASE_GENERIC(_member) AM_SIZE_GENERIC(_member)
#endif
//**************************************************************************
// GLOBAL VARIABLES

View File

@ -96,6 +96,7 @@
***************************************************************************/
#define ADDRESS_MAP_MODERN
#include "emu.h"
#include "includes/beathead.h"
@ -309,32 +310,32 @@ WRITE32_MEMBER( beathead_state::coin_count_w )
*
*************************************/
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_BASE_MEMBER(beathead_state, m_ram_base)
AM_RANGE(0x01800000, 0x01bfffff) AM_ROM AM_REGION("user1", 0) AM_BASE_MEMBER(beathead_state, m_rom_base)
AM_RANGE(0x40000000, 0x400007ff) AM_RAM_WRITE_MEMBER(beathead_state, eeprom_data_w) AM_BASE_SIZE_GENERIC(nvram)
AM_RANGE(0x41000000, 0x41000003) AM_READWRITE_MEMBER(beathead_state, sound_data_r, sound_data_w)
AM_RANGE(0x41000100, 0x41000103) AM_READ_MEMBER(beathead_state, interrupt_control_r)
AM_RANGE(0x41000100, 0x4100011f) AM_WRITE_MEMBER(beathead_state, interrupt_control_w)
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32, beathead_state)
AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_BASE(m_ram_base)
AM_RANGE(0x01800000, 0x01bfffff) AM_ROM AM_REGION("user1", 0) AM_BASE(m_rom_base)
AM_RANGE(0x40000000, 0x400007ff) AM_RAM_WRITE(eeprom_data_w) AM_BASE_SIZE_GENERIC(nvram)
AM_RANGE(0x41000000, 0x41000003) AM_READWRITE(sound_data_r, sound_data_w)
AM_RANGE(0x41000100, 0x41000103) AM_READ(interrupt_control_r)
AM_RANGE(0x41000100, 0x4100011f) AM_WRITE(interrupt_control_w)
AM_RANGE(0x41000200, 0x41000203) AM_READ_PORT("IN1")
AM_RANGE(0x41000204, 0x41000207) AM_READ_PORT("IN0")
AM_RANGE(0x41000208, 0x4100020f) AM_WRITE_MEMBER(beathead_state, sound_reset_w)
AM_RANGE(0x41000220, 0x41000227) AM_WRITE_MEMBER(beathead_state, coin_count_w)
AM_RANGE(0x41000300, 0x41000303) AM_READ_MEMBER(beathead_state, input_2_r)
AM_RANGE(0x41000208, 0x4100020f) AM_WRITE(sound_reset_w)
AM_RANGE(0x41000220, 0x41000227) AM_WRITE(coin_count_w)
AM_RANGE(0x41000300, 0x41000303) AM_READ(input_2_r)
AM_RANGE(0x41000304, 0x41000307) AM_READ_PORT("IN3")
AM_RANGE(0x41000400, 0x41000403) AM_WRITEONLY AM_BASE_MEMBER(beathead_state, m_palette_select)
AM_RANGE(0x41000500, 0x41000503) AM_WRITE_MEMBER(beathead_state, eeprom_enable_w)
AM_RANGE(0x41000600, 0x41000603) AM_WRITE_MEMBER(beathead_state, finescroll_w)
AM_RANGE(0x41000700, 0x41000703) AM_WRITE(watchdog_reset32_w)
AM_RANGE(0x42000000, 0x4201ffff) AM_RAM_WRITE_MEMBER(beathead_state, palette_w) AM_BASE_MEMBER(beathead_state, m_paletteram)
AM_RANGE(0x43000000, 0x43000007) AM_READWRITE_MEMBER(beathead_state, hsync_ram_r, hsync_ram_w)
AM_RANGE(0x41000400, 0x41000403) AM_WRITEONLY AM_BASE(m_palette_select)
AM_RANGE(0x41000500, 0x41000503) AM_WRITE(eeprom_enable_w)
AM_RANGE(0x41000600, 0x41000603) AM_WRITE(finescroll_w)
AM_RANGE(0x41000700, 0x41000703) AM_WRITE_LEGACY(watchdog_reset32_w)
AM_RANGE(0x42000000, 0x4201ffff) AM_RAM_WRITE(palette_w) AM_BASE(m_paletteram)
AM_RANGE(0x43000000, 0x43000007) AM_READWRITE(hsync_ram_r, hsync_ram_w)
AM_RANGE(0x8df80000, 0x8df80003) AM_READNOP /* noisy x4 during scanline int */
AM_RANGE(0x8f380000, 0x8f3fffff) AM_WRITE_MEMBER(beathead_state, vram_latch_w)
AM_RANGE(0x8f900000, 0x8f97ffff) AM_WRITE_MEMBER(beathead_state, vram_transparent_w)
AM_RANGE(0x8f980000, 0x8f9fffff) AM_RAM AM_BASE_MEMBER(beathead_state, m_videoram)
AM_RANGE(0x8fb80000, 0x8fbfffff) AM_WRITE_MEMBER(beathead_state, vram_bulk_w)
AM_RANGE(0x8fff8000, 0x8fff8003) AM_WRITEONLY AM_BASE_MEMBER(beathead_state, m_vram_bulk_latch)
AM_RANGE(0x9e280000, 0x9e2fffff) AM_WRITE_MEMBER(beathead_state, vram_copy_w)
AM_RANGE(0x8f380000, 0x8f3fffff) AM_WRITE(vram_latch_w)
AM_RANGE(0x8f900000, 0x8f97ffff) AM_WRITE(vram_transparent_w)
AM_RANGE(0x8f980000, 0x8f9fffff) AM_RAM AM_BASE(m_videoram)
AM_RANGE(0x8fb80000, 0x8fbfffff) AM_WRITE(vram_bulk_w)
AM_RANGE(0x8fff8000, 0x8fff8003) AM_WRITEONLY AM_BASE(m_vram_bulk_latch)
AM_RANGE(0x9e280000, 0x9e2fffff) AM_WRITE(vram_copy_w)
ADDRESS_MAP_END