diff options
author | 2009-07-09 07:10:40 +0000 | |
---|---|---|
committer | 2009-07-09 07:10:40 +0000 | |
commit | 5201d52344024ddc2f3288cf090b9a6ee37bc342 (patch) | |
tree | cc333fd344bd72055f1f71ba6bb7df1f3c997ebc /src/emu/memory.h | |
parent | 2577a0b22d7b5d43ea7078e5ff9cfd0ae47a3a69 (diff) |
Expanded address maps from 3 to 4. Moved ADDRESS_SPACE_PROGRAM/DATA/IO
constants to cpuintrf, as those names are really only applicable to
CPUs. Added new ADDRESS_MAP_0/1/2/3 constants to identify address maps
more generically.
Updated memory system to be more general about address map handling.
Added the concept of default address maps (in addition to the already
existing internal memory maps). The difference between internal and
default memory maps is that internal memory maps always override
everything (including user-specified maps), but default memory maps
simply provide a default that can be overridden.
Converted the okim6295 sound driver to use address maps for access.
By default, it defines a ROM address map that overlays its full
region. As a result, the validity checks require all okim6295 regions
to be at least 256k, unless you provide your own address map. Updated
all regions to meet this requirement.
Updated the atarijsa code to use a custom address space for its
okim6295 accesses (which are banked on the first half and static on
the second half), as an example of configuring a device with a
custom address space.
For now, attempts to use okim6295_set_bank_base() will still work,
though banking for the okim chips should be moved to custom address
maps in the drivers eventually. The first time okim6295_set_bank_base()
is called, it will install a banked memory handler over the region
and use memory_set_bankptr() to change the base on subsequent bank
switches.
Moved address map validity checks to be run for each device instead of
just each CPU.
Diffstat (limited to 'src/emu/memory.h')
-rw-r--r-- | src/emu/memory.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/emu/memory.h b/src/emu/memory.h index 06661c744de..55ec17a49e3 100644 --- a/src/emu/memory.h +++ b/src/emu/memory.h @@ -27,9 +27,10 @@ /* address spaces */ enum { - ADDRESS_SPACE_PROGRAM = 0, /* program address space */ - ADDRESS_SPACE_DATA, /* data address space */ - ADDRESS_SPACE_IO, /* I/O address space */ + ADDRESS_SPACE_0, /* first address space */ + ADDRESS_SPACE_1, /* second address space */ + ADDRESS_SPACE_2, /* third address space */ + ADDRESS_SPACE_3, /* fourth address space */ ADDRESS_SPACES /* maximum number of address spaces */ }; @@ -854,6 +855,9 @@ int memory_get_bank(running_machine *machine, int banknum) ATTR_NONNULL(1); /* set the absolute address of a bank base */ void memory_set_bankptr(running_machine *machine, int banknum, void *base) ATTR_NONNULL(1, 3); +/* return the index of an unused bank */ +int memory_find_unused_bank(running_machine *machine) ATTR_NONNULL(1); + /* ----- dynamic address space mapping ----- */ |