diff options
| author | 2011-06-23 13:27:35 +0000 | |
|---|---|---|
| committer | 2011-06-23 13:27:35 +0000 | |
| commit | f58d71ae0b9cc3f9d22c9592932023c6d3959320 (patch) | |
| tree | f22853a7bbbc0bb0ecb3a0b41dda40a41cf6bc07 /src | |
| parent | 66855e0ddbb41aa981ec68330ac9e3aa7dbdc6e2 (diff) | |
Added device-relative functions for memory banking. [Curt Coder]
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/memory.c | 59 | ||||
| -rw-r--r-- | src/emu/memory.h | 5 |
2 files changed, 64 insertions, 0 deletions
diff --git a/src/emu/memory.c b/src/emu/memory.c index 2f19d82bfa3..9dde8c9b48c 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -1785,6 +1785,18 @@ void memory_configure_bank(running_machine &machine, const char *tag, int starte //------------------------------------------------- +// memory_configure_bank - configure the +// addresses for a bank +//------------------------------------------------- + +void memory_configure_bank(device_t *device, const char *tag, int startentry, int numentries, void *base, offs_t stride) +{ + astring tempstring; + memory_configure_bank(device->machine(), device->subtag(tempstring, tag), startentry, numentries, base, stride); +} + + +//------------------------------------------------- // memory_configure_bank_decrypted - configure // the decrypted addresses for a bank //------------------------------------------------- @@ -1805,6 +1817,18 @@ void memory_configure_bank_decrypted(running_machine &machine, const char *tag, //------------------------------------------------- +// memory_configure_bank_decrypted - configure +// the decrypted addresses for a bank +//------------------------------------------------- + +void memory_configure_bank_decrypted(device_t *device, const char *tag, int startentry, int numentries, void *base, offs_t stride) +{ + astring tempstring; + memory_configure_bank_decrypted(device->machine(), device->subtag(tempstring, tag), startentry, numentries, base, stride); +} + + +//------------------------------------------------- // memory_set_bank - select one pre-configured // entry to be the new bank base //------------------------------------------------- @@ -1822,6 +1846,18 @@ void memory_set_bank(running_machine &machine, const char *tag, int entrynum) //------------------------------------------------- +// memory_set_bank - select one pre-configured +// entry to be the new bank base +//------------------------------------------------- + +void memory_set_bank(device_t *device, const char *tag, int entrynum) +{ + astring tempstring; + memory_set_bank(device->machine(), device->subtag(tempstring, tag), entrynum); +} + + +//------------------------------------------------- // memory_get_bank - return the currently // selected bank //------------------------------------------------- @@ -1839,6 +1875,18 @@ int memory_get_bank(running_machine &machine, const char *tag) //------------------------------------------------- +// memory_get_bank - return the currently +// selected bank +//------------------------------------------------- + +int memory_get_bank(device_t *device, const char *tag) +{ + astring tempstring; + return memory_get_bank(device->machine(), device->subtag(tempstring, tag)); +} + + +//------------------------------------------------- // memory_set_bankptr - set the base of a bank //------------------------------------------------- @@ -1855,6 +1903,17 @@ void memory_set_bankptr(running_machine &machine, const char *tag, void *base) //------------------------------------------------- +// memory_set_bankptr - set the base of a bank +//------------------------------------------------- + +void memory_set_bankptr(device_t *device, const char *tag, void *base) +{ + astring tempstring; + return memory_set_bankptr(device->machine(), device->subtag(tempstring, tag), base); +} + + +//------------------------------------------------- // memory_get_shared - get a pointer to a shared // memory region by tag //------------------------------------------------- diff --git a/src/emu/memory.h b/src/emu/memory.h index d92054339fe..a7db4a71a20 100644 --- a/src/emu/memory.h +++ b/src/emu/memory.h @@ -676,18 +676,23 @@ void memory_init(running_machine &machine); // configure the addresses for a bank void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5); +void memory_configure_bank(device_t *device, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5); // configure the decrypted addresses for a bank void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5); +void memory_configure_bank_decrypted(device_t *device, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5); // select one pre-configured entry to be the new bank base void memory_set_bank(running_machine &machine, const char *tag, int entrynum); +void memory_set_bank(device_t *device, const char *tag, int entrynum); // return the currently selected bank int memory_get_bank(running_machine &machine, const char *tag); +int memory_get_bank(device_t *device, const char *tag); // set the absolute address of a bank base void memory_set_bankptr(running_machine &machine, const char *tag, void *base) ATTR_NONNULL(3); +void memory_set_bankptr(device_t *device, const char *tag, void *base) ATTR_NONNULL(3); // get a pointer to a shared memory region by tag void *memory_get_shared(running_machine &machine, const char *tag); |
