mirror of
https://github.com/holub/mame
synced 2025-05-22 13:48:55 +03:00
Added new functions:
memory_install_ram() to assign a un-named bank to a region and specify a pointer to where the RAM lives. If this is called in the DRIVER_INIT function or MACHINE/SOUND/VIDEO_START functions, then it is permissible to specify NULL, in which case the memory system will allocate memory and register it for save states. memory_install_rom() is like the above except that it only installs a read handler. memory_install_writeonly() is like the above except that it only installs a write handler. Updated several instances in the code that were assigning banks to these sorts of static RAM regions and simplified the code. Also fixed several regressions reported by Tafoid.
This commit is contained in:
parent
f47d21d30a
commit
fd34a32091
@ -1316,8 +1316,7 @@ static void mips_update_scratchpad( const address_space *space )
|
||||
}
|
||||
else
|
||||
{
|
||||
memory_install_readwrite_bank( space, 0x1f800000, 0x1f8003ff, 0, 0, "bank32" );
|
||||
memory_set_bankptr(space->machine, "bank32", psxcpu->dcache );
|
||||
memory_install_ram( space, 0x1f800000, 0x1f8003ff, 0, 0, psxcpu->dcache );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,7 +406,7 @@ static void *space_find_backing_memory(const address_space *space, offs_t addrst
|
||||
static int space_needs_backing_store(const address_space *space, const address_map_entry *entry);
|
||||
|
||||
/* banking helpers */
|
||||
static void *bank_find_or_allocate(const address_space *space, const char *tag, offs_t addrstart, offs_t addrend, read_or_write readorwrite);
|
||||
static void *bank_find_or_allocate(const address_space *space, const char *tag, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read_or_write readorwrite);
|
||||
static STATE_POSTLOAD( bank_reattach );
|
||||
|
||||
/* table management */
|
||||
@ -477,7 +477,7 @@ INLINE void force_opbase_update(const address_space *space)
|
||||
given address space in a standard fashion
|
||||
-------------------------------------------------*/
|
||||
|
||||
INLINE void adjust_addresses(address_space *space, offs_t *start, offs_t *end, offs_t *mask, offs_t *mirror)
|
||||
INLINE void adjust_addresses(const address_space *space, offs_t *start, offs_t *end, offs_t *mask, offs_t *mirror)
|
||||
{
|
||||
/* adjust start/end/mask values */
|
||||
if (*mask == 0)
|
||||
@ -1477,14 +1477,14 @@ void _memory_install_bank(const address_space *space, offs_t addrstart, offs_t a
|
||||
/* map the read bank */
|
||||
if (rtag != NULL)
|
||||
{
|
||||
void *handler = bank_find_or_allocate(space, rtag, addrstart, addrend, ROW_READ);
|
||||
void *handler = bank_find_or_allocate(space, rtag, addrstart, addrend, addrmask, addrmirror, ROW_READ);
|
||||
space_map_range(spacerw, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, handler, spacerw, rtag);
|
||||
}
|
||||
|
||||
/* map the write bank */
|
||||
if (wtag != NULL)
|
||||
{
|
||||
void *handler = bank_find_or_allocate(space, wtag, addrstart, addrend, ROW_WRITE);
|
||||
void *handler = bank_find_or_allocate(space, wtag, addrstart, addrend, addrmask, addrmirror, ROW_WRITE);
|
||||
space_map_range(spacerw, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, handler, spacerw, wtag);
|
||||
}
|
||||
|
||||
@ -1498,7 +1498,7 @@ void _memory_install_bank(const address_space *space, offs_t addrstart, offs_t a
|
||||
RAM region into the given address space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void _memory_install_ram(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT8 install_read, UINT8 install_write)
|
||||
void *_memory_install_ram(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT8 install_read, UINT8 install_write, void *baseptr)
|
||||
{
|
||||
memory_private *memdata = space->machine->memory_data;
|
||||
address_space *spacerw = (address_space *)space;
|
||||
@ -1508,34 +1508,52 @@ void _memory_install_ram(const address_space *space, offs_t addrstart, offs_t ad
|
||||
/* map for read */
|
||||
if (install_read)
|
||||
{
|
||||
handler = bank_find_or_allocate(space, NULL, addrstart, addrend, ROW_READ);
|
||||
handler = bank_find_or_allocate(space, NULL, addrstart, addrend, addrmask, addrmirror, ROW_READ);
|
||||
space_map_range(spacerw, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, handler, spacerw, "ram");
|
||||
|
||||
/* if we are provided a pointer, set it */
|
||||
bankindex = (FPTR)handler;
|
||||
if (baseptr != NULL)
|
||||
memdata->bank_ptr[bankindex] = baseptr;
|
||||
|
||||
/* if we don't have a bank pointer yet, try to find one */
|
||||
bankindex = (FPTR)handler;
|
||||
if (memdata->bank_ptr[bankindex] == NULL)
|
||||
memdata->bank_ptr[bankindex] = (UINT8 *)space_find_backing_memory(space, addrstart, addrend);
|
||||
|
||||
/* if we still don't have a pointer, and we're past the initialization phase, allocate a new block */
|
||||
if (memdata->bank_ptr[bankindex] == NULL && memdata->initialized)
|
||||
{
|
||||
if (mame_get_phase(space->machine) >= MAME_PHASE_RESET)
|
||||
fatalerror("Attempted to call memory_install_ram() after initialization time without a baseptr!");
|
||||
memdata->bank_ptr[bankindex] = block_allocate(space, memory_address_to_byte(space, addrstart), memory_address_to_byte_end(space, addrend), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* map for write */
|
||||
if (install_write)
|
||||
{
|
||||
handler = bank_find_or_allocate(space, NULL, addrstart, addrend, ROW_WRITE);
|
||||
handler = bank_find_or_allocate(space, NULL, addrstart, addrend, addrmask, addrmirror, ROW_WRITE);
|
||||
space_map_range(spacerw, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, handler, spacerw, "ram");
|
||||
|
||||
/* if we don't have a bank pointer yet, try to find one */
|
||||
/* if we are provided a pointer, set it */
|
||||
bankindex = (FPTR)handler;
|
||||
if (baseptr != NULL)
|
||||
memdata->bank_ptr[bankindex] = baseptr;
|
||||
|
||||
/* if we don't have a bank pointer yet, try to find one */
|
||||
if (memdata->bank_ptr[bankindex] == NULL)
|
||||
memdata->bank_ptr[bankindex] = (UINT8 *)space_find_backing_memory(space, addrstart, addrend);
|
||||
|
||||
/* if we still don't have a pointer, and we're past the initialization phase, allocate a new block */
|
||||
if (memdata->bank_ptr[bankindex] == NULL && memdata->initialized)
|
||||
{
|
||||
if (mame_get_phase(space->machine) >= MAME_PHASE_RESET)
|
||||
fatalerror("Attempted to call memory_install_ram() after initialization time without a baseptr!");
|
||||
memdata->bank_ptr[bankindex] = block_allocate(space, memory_address_to_byte(space, addrstart), memory_address_to_byte_end(space, addrend), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return (void *)space_find_backing_memory(spacerw, addrstart, addrend);
|
||||
}
|
||||
|
||||
|
||||
@ -1931,7 +1949,7 @@ static void memory_init_map_entry(address_space *space, const address_map_entry
|
||||
|
||||
case AMH_RAM:
|
||||
_memory_install_ram(space, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror,
|
||||
readorwrite == ROW_READ, readorwrite == ROW_WRITE);
|
||||
readorwrite == ROW_READ, readorwrite == ROW_WRITE, NULL);
|
||||
break;
|
||||
|
||||
case AMH_NOP:
|
||||
@ -2559,7 +2577,7 @@ static void *space_find_backing_memory(const address_space *space, offs_t addrst
|
||||
{
|
||||
offs_t maskstart = bytestart & entry->bytemask;
|
||||
offs_t maskend = byteend & entry->bytemask;
|
||||
if (maskstart >= entry->bytestart && maskend <= entry->byteend)
|
||||
if (entry->memory != NULL && maskstart >= entry->bytestart && maskend <= entry->byteend)
|
||||
{
|
||||
VPRINTF(("found in entry %08X-%08X [%p]\n", entry->addrstart, entry->addrend, (UINT8 *)entry->memory + (maskstart - entry->bytestart)));
|
||||
return (UINT8 *)entry->memory + (maskstart - entry->bytestart);
|
||||
@ -2616,15 +2634,20 @@ static int space_needs_backing_store(const address_space *space, const address_m
|
||||
read/write handler
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void *bank_find_or_allocate(const address_space *space, const char *tag, offs_t addrstart, offs_t addrend, read_or_write readorwrite)
|
||||
static void *bank_find_or_allocate(const address_space *space, const char *tag, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read_or_write readorwrite)
|
||||
{
|
||||
offs_t bytestart = memory_address_to_byte(space, addrstart);
|
||||
offs_t byteend = memory_address_to_byte_end(space, addrend);
|
||||
memory_private *memdata = space->machine->memory_data;
|
||||
offs_t bytemirror = addrmirror;
|
||||
offs_t bytestart = addrstart;
|
||||
offs_t bytemask = addrmask;
|
||||
offs_t byteend = addrend;
|
||||
bank_info *bank = NULL;
|
||||
char temptag[10];
|
||||
char name[30];
|
||||
|
||||
/* adjust the addresses, handling mirrors and such */
|
||||
adjust_addresses(space, &bytestart, &byteend, &bytemask, &bytemirror);
|
||||
|
||||
/* if this bank is named, look it up */
|
||||
if (tag != NULL)
|
||||
bank = tagmap_find_hash_only(memdata->bankmap, tag);
|
||||
|
@ -490,6 +490,8 @@ union _addrmap64_token
|
||||
_memory_install_port(space, start, end, mask, mirror, rtag, NULL)
|
||||
#define memory_install_read_bank(space, start, end, mask, mirror, rtag) \
|
||||
_memory_install_bank(space, start, end, mask, mirror, rtag, NULL)
|
||||
#define memory_install_rom(space, start, end, mask, mirror, baseptr) \
|
||||
_memory_install_ram(space, start, end, mask, mirror, TRUE, FALSE, baseptr)
|
||||
#define memory_unmap_read(space, start, end, mask, mirror) \
|
||||
_memory_unmap(space, start, end, mask, mirror, TRUE, FALSE, FALSE)
|
||||
#define memory_nop_read(space, start, end, mask, mirror) \
|
||||
@ -518,6 +520,8 @@ union _addrmap64_token
|
||||
_memory_install_port(space, start, end, mask, mirror, NULL, wtag)
|
||||
#define memory_install_write_bank(space, start, end, mask, mirror, wtag) \
|
||||
_memory_install_bank(space, start, end, mask, mirror, NULL, wtag)
|
||||
#define memory_install_writeonly(space, start, end, mask, mirror, baseptr) \
|
||||
_memory_install_ram(space, start, end, mask, mirror, FALSE, TRUE, baseptr)
|
||||
#define memory_unmap_write(space, start, end, mask, mirror) \
|
||||
_memory_unmap(space, start, end, mask, mirror, FALSE, TRUE, FALSE)
|
||||
#define memory_nop_write(space, start, end, mask, mirror) \
|
||||
@ -546,6 +550,8 @@ union _addrmap64_token
|
||||
_memory_install_port(space, start, end, mask, mirror, rtag, wtag)
|
||||
#define memory_install_readwrite_bank(space, start, end, mask, mirror, tag) \
|
||||
_memory_install_bank(space, start, end, mask, mirror, tag, tag)
|
||||
#define memory_install_ram(space, start, end, mask, mirror, baseptr) \
|
||||
_memory_install_ram(space, start, end, mask, mirror, TRUE, TRUE, baseptr)
|
||||
#define memory_unmap_readwrite(space, start, end, mask, mirror) \
|
||||
_memory_unmap(space, start, end, mask, mirror, TRUE, TRUE, FALSE)
|
||||
#define memory_nop_readwrite(space, start, end, mask, mirror) \
|
||||
@ -1017,7 +1023,7 @@ void _memory_install_port(const address_space *space, offs_t addrstart, offs_t a
|
||||
void _memory_install_bank(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *rtag, const char *wtag) ATTR_NONNULL(1);
|
||||
|
||||
/* install a simple fixed RAM region into the given address space */
|
||||
void _memory_install_ram(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT8 install_read, UINT8 install_write) ATTR_NONNULL(1);
|
||||
void *_memory_install_ram(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT8 install_read, UINT8 install_write, void *baseptr) ATTR_NONNULL(1);
|
||||
|
||||
/* unmap a section of address space */
|
||||
void _memory_unmap(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT8 unmap_read, UINT8 unmap_write, UINT8 quiet) ATTR_NONNULL(1);
|
||||
|
@ -440,7 +440,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( dcs_2k_data_map, ADDRESS_SPACE_DATA, 16 )
|
||||
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_READWRITE(dcs_dataram_r, dcs_dataram_w)
|
||||
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("bank20")
|
||||
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("databank")
|
||||
AM_RANGE(0x3000, 0x33ff) AM_WRITE(dcs_data_bank_select_w)
|
||||
AM_RANGE(0x3400, 0x37ff) AM_READWRITE(input_latch_r, output_latch_w)
|
||||
AM_RANGE(0x3800, 0x39ff) AM_RAM
|
||||
@ -451,7 +451,7 @@ ADDRESS_MAP_END
|
||||
/* DCS 2k with UART memory map */
|
||||
static ADDRESS_MAP_START( dcs_2k_uart_data_map, ADDRESS_SPACE_DATA, 16 )
|
||||
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_READWRITE(dcs_dataram_r, dcs_dataram_w)
|
||||
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("bank20")
|
||||
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("databank")
|
||||
AM_RANGE(0x3000, 0x33ff) AM_WRITE(dcs_data_bank_select_w)
|
||||
AM_RANGE(0x3400, 0x3402) AM_NOP /* UART (ignored) */
|
||||
AM_RANGE(0x3403, 0x3403) AM_READWRITE(input_latch_r, output_latch_w)
|
||||
@ -470,7 +470,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( dcs_8k_data_map, ADDRESS_SPACE_DATA, 16 )
|
||||
AM_RANGE(0x0000, 0x07ff) AM_RAM
|
||||
AM_RANGE(0x0800, 0x1fff) AM_READWRITE(dcs_dataram_r, dcs_dataram_w)
|
||||
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("bank20")
|
||||
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("databank")
|
||||
AM_RANGE(0x3000, 0x33ff) AM_WRITE(dcs_data_bank_select_w)
|
||||
AM_RANGE(0x3400, 0x37ff) AM_READWRITE(input_latch_r, output_latch_w)
|
||||
AM_RANGE(0x3800, 0x39ff) AM_RAM
|
||||
@ -536,7 +536,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( dsio_data_map, ADDRESS_SPACE_DATA, 16 )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x03ff) AM_RAMBANK("bank20")
|
||||
AM_RANGE(0x0000, 0x03ff) AM_RAMBANK("databank")
|
||||
AM_RANGE(0x0400, 0x3fdf) AM_RAM
|
||||
AM_RANGE(0x3fe0, 0x3fff) AM_READWRITE(adsp_control_r, adsp_control_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -568,7 +568,7 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( denver_data_map, ADDRESS_SPACE_DATA, 16 )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("bank20")
|
||||
AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("databank")
|
||||
AM_RANGE(0x0800, 0x3fdf) AM_RAM
|
||||
AM_RANGE(0x3fe0, 0x3fff) AM_READWRITE(adsp_control_r, adsp_control_w)
|
||||
ADDRESS_MAP_END
|
||||
@ -809,7 +809,7 @@ static TIMER_CALLBACK( dcs_reset )
|
||||
/* rev 1: just reset the bank to 0 */
|
||||
case 1:
|
||||
dcs.sounddata_bank = 0;
|
||||
memory_set_bank(machine, "bank20", 0);
|
||||
memory_set_bank(machine, "databank", 0);
|
||||
break;
|
||||
|
||||
/* rev 2: reset the SDRC ASIC */
|
||||
@ -945,7 +945,7 @@ void dcs_init(running_machine *machine)
|
||||
dcs.sounddata = dcs.bootrom;
|
||||
dcs.sounddata_words = dcs.bootrom_words;
|
||||
dcs.sounddata_banks = dcs.sounddata_words / 0x1000;
|
||||
memory_configure_bank(machine, "bank20", 0, dcs.sounddata_banks, dcs.sounddata, 0x1000*2);
|
||||
memory_configure_bank(machine, "databank", 0, dcs.sounddata_banks, dcs.sounddata, 0x1000*2);
|
||||
|
||||
/* create the timers */
|
||||
dcs.internal_timer = timer_alloc(machine, internal_timer_callback, NULL);
|
||||
@ -1007,7 +1007,7 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
|
||||
}
|
||||
dcs.sounddata_banks = dcs.sounddata_words / soundbank_words;
|
||||
if (dcs.rev != 2)
|
||||
memory_configure_bank(machine, "bank20", 0, dcs.sounddata_banks, dcs.sounddata, soundbank_words*2);
|
||||
memory_configure_bank(machine, "databank", 0, dcs.sounddata_banks, dcs.sounddata, soundbank_words*2);
|
||||
|
||||
/* allocate memory for the SRAM */
|
||||
dcs_sram = auto_alloc_array(machine, UINT16, 0x8000*4/2);
|
||||
@ -1068,7 +1068,7 @@ static WRITE16_HANDLER( dcs_dataram_w )
|
||||
static WRITE16_HANDLER( dcs_data_bank_select_w )
|
||||
{
|
||||
dcs.sounddata_bank = data & 0x7ff;
|
||||
memory_set_bank(space->machine, "bank20", dcs.sounddata_bank % dcs.sounddata_banks);
|
||||
memory_set_bank(space->machine, "databank", dcs.sounddata_bank % dcs.sounddata_banks);
|
||||
|
||||
/* bit 11 = sound board led */
|
||||
#if 0
|
||||
@ -1095,15 +1095,15 @@ INLINE void sdrc_update_bank_pointers(running_machine *machine)
|
||||
{
|
||||
/* ROM-based; use the memory page to select from ROM */
|
||||
if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3)
|
||||
memory_set_bankptr(machine, "bank25", &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]);
|
||||
memory_set_bankptr(machine, "rompage", &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* RAM-based; use the ROM page to select from ROM, and the memory page to select from RAM */
|
||||
if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3)
|
||||
memory_set_bankptr(machine, "bank25", &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
|
||||
memory_set_bankptr(machine, "rompage", &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
|
||||
if (SDRC_DM_ST != 0)
|
||||
memory_set_bankptr(machine, "bank26", &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
|
||||
memory_set_bankptr(machine, "drampage", &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1122,29 +1122,23 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
else
|
||||
{
|
||||
/* first start with a clean program map */
|
||||
memory_install_readwrite_bank(dcs.program, 0x0800, 0x3fff, 0, 0, "bank21");
|
||||
memory_set_bankptr(machine, "bank21", dcs_sram + 0x4800);
|
||||
memory_install_ram(dcs.program, 0x0800, 0x3fff, 0, 0, dcs_sram + 0x4800);
|
||||
|
||||
/* set up the data map based on the SRAM banking */
|
||||
/* map 0: ram from 0800-37ff */
|
||||
if (SDRC_SM_BK == 0)
|
||||
{
|
||||
memory_install_readwrite_bank(dcs.data, 0x0800, 0x17ff, 0, 0, "bank22");
|
||||
memory_install_readwrite_bank(dcs.data, 0x1800, 0x27ff, 0, 0, "bank23");
|
||||
memory_install_readwrite_bank(dcs.data, 0x2800, 0x37ff, 0, 0, "bank24");
|
||||
memory_set_bankptr(machine, "bank22", dcs_sram + 0x0000);
|
||||
memory_set_bankptr(machine, "bank23", dcs_sram + 0x1000);
|
||||
memory_set_bankptr(machine, "bank24", dcs_sram + 0x2000);
|
||||
memory_install_ram(dcs.data, 0x0800, 0x17ff, 0, 0, dcs_sram + 0x0000);
|
||||
memory_install_ram(dcs.data, 0x1800, 0x27ff, 0, 0, dcs_sram + 0x1000);
|
||||
memory_install_ram(dcs.data, 0x2800, 0x37ff, 0, 0, dcs_sram + 0x2000);
|
||||
}
|
||||
|
||||
/* map 1: nothing from 0800-17ff, alternate RAM at 1800-27ff, same RAM at 2800-37ff */
|
||||
else
|
||||
{
|
||||
memory_unmap_readwrite(dcs.data, 0x0800, 0x17ff, 0, 0);
|
||||
memory_install_readwrite_bank(dcs.data, 0x1800, 0x27ff, 0, 0, "bank23");
|
||||
memory_install_readwrite_bank(dcs.data, 0x2800, 0x37ff, 0, 0, "bank24");
|
||||
memory_set_bankptr(machine, "bank23", dcs_sram + 0x3000);
|
||||
memory_set_bankptr(machine, "bank24", dcs_sram + 0x2000);
|
||||
memory_install_ram(dcs.data, 0x1800, 0x27ff, 0, 0, dcs_sram + 0x3000);
|
||||
memory_install_ram(dcs.data, 0x2800, 0x37ff, 0, 0, dcs_sram + 0x2000);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1153,14 +1147,14 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
{
|
||||
int baseaddr = (SDRC_ROM_ST == 0) ? 0x0000 : (SDRC_ROM_ST == 1) ? 0x3000 : 0x3400;
|
||||
int pagesize = (SDRC_ROM_SZ == 0 && SDRC_ROM_ST != 0) ? 4096 : 1024;
|
||||
memory_install_read_bank(dcs.data, baseaddr, baseaddr + pagesize - 1, 0, 0, "bank25");
|
||||
memory_install_read_bank(dcs.data, baseaddr, baseaddr + pagesize - 1, 0, 0, "rompage");
|
||||
}
|
||||
|
||||
/* map the DRAM page as bank 26 */
|
||||
if (SDRC_DM_ST != 0)
|
||||
{
|
||||
int baseaddr = (SDRC_DM_ST == 1) ? 0x0000 : (SDRC_DM_ST == 2) ? 0x3000 : 0x3400;
|
||||
memory_install_readwrite_bank(dcs.data, baseaddr, baseaddr + 0x3ff, 0, 0, "bank26");
|
||||
memory_install_readwrite_bank(dcs.data, baseaddr, baseaddr + 0x3ff, 0, 0, "drampage");
|
||||
}
|
||||
|
||||
/* update the bank pointers */
|
||||
@ -1352,7 +1346,7 @@ static WRITE16_HANDLER( dsio_w )
|
||||
/* offset 2 controls RAM pages */
|
||||
case 2:
|
||||
dsio.reg[2] = data;
|
||||
memory_set_bank(space->machine, "bank20", DSIO_DM_PG % dcs.sounddata_banks);
|
||||
memory_set_bank(space->machine, "databank", DSIO_DM_PG % dcs.sounddata_banks);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1418,7 +1412,7 @@ static WRITE16_HANDLER( denver_w )
|
||||
/* offset 2 controls RAM pages */
|
||||
case 2:
|
||||
dsio.reg[2] = data;
|
||||
memory_set_bank(space->machine, "bank20", DENV_DM_PG % dcs.sounddata_bank);
|
||||
memory_set_bank(space->machine, "databank", DENV_DM_PG % dcs.sounddata_bank);
|
||||
break;
|
||||
|
||||
/* offset 3 controls FIFO reset */
|
||||
|
@ -777,8 +777,7 @@ static DRIVER_INIT( asylum )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* asylum appears to have some extra RAM for the slave CPU */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "slave", ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, "bank4");
|
||||
memory_set_bankptr(machine, "bank4", auto_alloc_array(machine, UINT8, 0x1000));
|
||||
memory_install_ram(cputag_get_address_space(machine, "slave", ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, NULL);
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2");
|
||||
|
@ -800,13 +800,12 @@ static WRITE8_HANDLER( analog_select_w )
|
||||
|
||||
static DRIVER_INIT( bradley )
|
||||
{
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x400, 0x7ff, 0, 0, "bank1");
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x400));
|
||||
|
||||
memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1808, 0x1808, 0, 0, "1808");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1809, 0x1809, 0, 0, "1809");
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x180a, 0x180a, 0, 0, analog_data_r);
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1848, 0x1850, 0, 0, analog_select_w);
|
||||
const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
memory_install_ram(space, 0x400, 0x7ff, 0, 0, NULL);
|
||||
memory_install_read_port(space, 0x1808, 0x1808, 0, 0, "1808");
|
||||
memory_install_read_port(space, 0x1809, 0x1809, 0, 0, "1809");
|
||||
memory_install_read8_handler(space, 0x180a, 0x180a, 0, 0, analog_data_r);
|
||||
memory_install_write8_handler(space, 0x1848, 0x1850, 0, 0, analog_select_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -254,7 +254,6 @@ static UINT8 zigzag_ay8910_latch;
|
||||
static UINT8 kingball_speech_dip;
|
||||
static UINT8 kingball_sound;
|
||||
static UINT8 mshuttle_ay8910_cs;
|
||||
static UINT8 *frogg_ram;
|
||||
|
||||
static UINT16 protection_state;
|
||||
static UINT8 protection_result;
|
||||
@ -2522,11 +2521,7 @@ static DRIVER_INIT( frogg )
|
||||
common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
|
||||
|
||||
/* ...but needs a full 2k of RAM */
|
||||
memory_install_readwrite_bank(space, 0x4000, 0x47ff, 0, 0, "bank1");
|
||||
frogg_ram = auto_alloc_array(machine, UINT8, 0x800);
|
||||
memory_set_bankptr(machine, "bank1", frogg_ram);
|
||||
|
||||
state_save_register_global_pointer(machine, frogg_ram, 0x800);
|
||||
memory_install_ram(space, 0x4000, 0x47ff, 0, 0, NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -2810,12 +2805,10 @@ static DRIVER_INIT( skybase )
|
||||
memory_install_write8_handler(space, 0xa002, 0xa002, 0, 0x7f8, galaxian_gfxbank_w);
|
||||
|
||||
/* needs a full 2k of RAM */
|
||||
memory_install_readwrite_bank(space, 0x8000, 0x87ff, 0, 0, "bank1");
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x800));
|
||||
memory_install_ram(space, 0x8000, 0x87ff, 0, 0, NULL);
|
||||
|
||||
/* extend ROM */
|
||||
memory_install_read_bank(space, 0x0000, 0x5fff, 0, 0, "bank2");
|
||||
memory_set_bankptr(machine, "bank2", memory_region(machine, "maincpu"));
|
||||
memory_install_rom(space, 0x0000, 0x5fff, 0, 0, memory_region(machine, "maincpu"));
|
||||
}
|
||||
|
||||
|
||||
@ -2874,12 +2867,10 @@ static DRIVER_INIT( scorpnmc )
|
||||
memory_install_write8_handler(space, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
|
||||
|
||||
/* extra ROM */
|
||||
memory_install_read_bank(space, 0x5000, 0x67ff, 0, 0, "bank1");
|
||||
memory_set_bankptr(machine, "bank1", memory_region(machine, "maincpu") + 0x5000);
|
||||
memory_install_rom(space, 0x5000, 0x67ff, 0, 0, memory_region(machine, "maincpu") + 0x5000);
|
||||
|
||||
/* install RAM at $4000-$4800 */
|
||||
memory_install_readwrite_bank(space, 0x4000, 0x47ff, 0, 0, "bank2");
|
||||
memory_set_bankptr(machine, "bank2", auto_alloc_array(machine, UINT8, 0x800));
|
||||
memory_install_ram(space, 0x4000, 0x47ff, 0, 0, NULL);
|
||||
|
||||
/* doesn't appear to use original RAM */
|
||||
memory_unmap_readwrite(space, 0x8000, 0x87ff, 0, 0);
|
||||
@ -2998,11 +2989,7 @@ static DRIVER_INIT( froggrmc )
|
||||
memory_install_write8_handler(space, 0xb001, 0xb001, 0, 0x7f8, froggrmc_sound_control_w);
|
||||
|
||||
/* actually needs 2k of RAM */
|
||||
memory_install_readwrite_bank(space, 0x8000, 0x87ff, 0, 0, "bank1");
|
||||
frogg_ram = auto_alloc_array(machine, UINT8, 0x800);
|
||||
memory_set_bankptr(machine, "bank1", frogg_ram);
|
||||
|
||||
state_save_register_global_pointer(machine, frogg_ram, 0x800);
|
||||
memory_install_ram(space, 0x8000, 0x87ff, 0, 0, NULL);
|
||||
|
||||
/* decrypt */
|
||||
decode_frogger_sound(machine);
|
||||
|
@ -1212,12 +1212,10 @@ static DRIVER_INIT( gyrodine )
|
||||
static DRIVER_INIT( srdmissn )
|
||||
{
|
||||
/* shared RAM is mapped at 0xe000 as well */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xe7ff, 0, 0, "bank1");
|
||||
memory_set_bankptr(machine, "bank1", shared_ram);
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xe7ff, 0, 0, shared_ram);
|
||||
|
||||
/* extra RAM on sub CPU */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x8800, 0x8fff, 0, 0, "bank2");
|
||||
memory_set_bankptr(machine, "bank2", auto_alloc_array(machine, UINT8, 0x800));
|
||||
memory_install_ram(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x8800, 0x8fff, 0, 0, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2533,14 +2533,12 @@ static WRITE16_HANDLER( _32x_68k_a15100_w )
|
||||
if (data & 0x01)
|
||||
{
|
||||
_32x_adapter_enabled = 1;
|
||||
memory_install_readwrite_bank(space, 0x0880000, 0x08fffff, 0, 0, "bank11"); // 'fixed' 512kb rom bank
|
||||
memory_set_bankptr(space->machine, "bank11", memory_region(space->machine, "gamecart") );
|
||||
memory_install_rom(space, 0x0880000, 0x08fffff, 0, 0, memory_region(space->machine, "gamecart")); // 'fixed' 512kb rom bank
|
||||
|
||||
memory_install_readwrite_bank(space, 0x0900000, 0x09fffff, 0, 0, "bank12"); // 'bankable' 1024kb rom bank
|
||||
memory_install_read_bank(space, 0x0900000, 0x09fffff, 0, 0, "bank12"); // 'bankable' 1024kb rom bank
|
||||
memory_set_bankptr(space->machine, "bank12", memory_region(space->machine, "gamecart") );
|
||||
|
||||
memory_install_readwrite_bank(space, 0x0000000, 0x03fffff, 0, 0, "bank10");
|
||||
memory_set_bankptr(space->machine, "bank10", memory_region(space->machine, "32x_68k_bios") );
|
||||
memory_install_rom(space, 0x0000000, 0x03fffff, 0, 0, memory_region(space->machine, "32x_68k_bios"));
|
||||
|
||||
memory_install_readwrite16_handler(space, 0x0a15180, 0x0a15181, 0, 0, _32x_68k_a15180_r, _32x_68k_a15180_w); // mode control regs
|
||||
memory_install_readwrite16_handler(space, 0x0a15182, 0x0a15183, 0, 0, _32x_68k_a15182_r, _32x_68k_a15182_w); // screen shift
|
||||
@ -2562,8 +2560,7 @@ static WRITE16_HANDLER( _32x_68k_a15100_w )
|
||||
{
|
||||
_32x_adapter_enabled = 0;
|
||||
|
||||
memory_install_readwrite_bank(space, 0x0000000, 0x03fffff, 0, 0, "bank10");
|
||||
memory_set_bankptr(space->machine, "bank10", memory_region(space->machine, "gamecart") );
|
||||
memory_install_rom(space, 0x0000000, 0x03fffff, 0, 0, memory_region(space->machine, "gamecart"));
|
||||
|
||||
|
||||
}
|
||||
@ -3728,8 +3725,7 @@ static void svp_init(running_machine *machine)
|
||||
|
||||
/* SVP stuff */
|
||||
svp.dram = auto_alloc_array(machine, UINT8, 0x20000);
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x300000, 0x31ffff, 0, 0, "bank2");
|
||||
memory_set_bankptr(machine, "bank2", svp.dram );
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x300000, 0x31ffff, 0, 0, svp.dram);
|
||||
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa15000, 0xa150ff, 0, 0, svp_68k_io_r, svp_68k_io_w);
|
||||
// "cell arrange" 1 and 2
|
||||
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x390000, 0x39ffff, 0, 0, svp_68k_cell1_r);
|
||||
@ -6414,8 +6410,7 @@ void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, tag, ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1");
|
||||
memory_set_bankptr(machine, "bank1", genz80.z80_prgram );
|
||||
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, tag, ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank6");
|
||||
memory_set_bankptr(machine, "bank6", genz80.z80_prgram );
|
||||
memory_install_ram(cputag_get_address_space(machine, tag, ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, genz80.z80_prgram);
|
||||
|
||||
|
||||
// not allowed??
|
||||
@ -6458,8 +6453,7 @@ DRIVER_INIT( _32x )
|
||||
|
||||
if (_32x_adapter_enabled == 0)
|
||||
{
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000000, 0x03fffff, 0, 0, "bank10");
|
||||
memory_set_bankptr(machine, "bank10", memory_region(machine, "gamecart") );
|
||||
memory_install_rom(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000000, 0x03fffff, 0, 0, memory_region(machine, "gamecart"));
|
||||
};
|
||||
|
||||
|
||||
|
@ -892,8 +892,7 @@ static DRIVER_INIT (megaplay)
|
||||
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa10000, 0xa1001f, 0, 0, megaplay_io_read, megaplay_io_write);
|
||||
|
||||
/* megaplay has ram shared with the bios cpu here */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "genesis_snd_z80", ADDRESS_SPACE_PROGRAM), 0x2000, 0x3fff, 0, 0, "bank7");
|
||||
memory_set_bankptr(machine, "bank7", &ic36_ram[0]);
|
||||
memory_install_ram(cputag_get_address_space(machine, "genesis_snd_z80", ADDRESS_SPACE_PROGRAM), 0x2000, 0x3fff, 0, 0, &ic36_ram[0]);
|
||||
|
||||
/* instead of a RAM mirror the 68k sees the extra ram of the 2nd z80 too */
|
||||
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa02000, 0xa03fff, 0, 0, megadriv_68k_read_z80_extra_ram, megadriv_68k_write_z80_extra_ram);
|
||||
|
@ -7750,18 +7750,12 @@ static DRIVER_INIT( samsh5sp )
|
||||
|
||||
static DRIVER_INIT( jockeygp )
|
||||
{
|
||||
UINT16* extra_ram;
|
||||
|
||||
neogeo_fixed_layer_bank_type = 1;
|
||||
neogeo_cmc50_m1_decrypt(machine);
|
||||
kof2000_neogeo_gfx_decrypt(machine, 0xac);
|
||||
|
||||
/* install some extra RAM */
|
||||
extra_ram = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, extra_ram, 0x2000 / 2);
|
||||
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x201fff, 0, 0, "bank8");
|
||||
memory_set_bankptr(machine, NEOGEO_BANK_EXTRA_RAM, extra_ram);
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x201fff, 0, 0, NULL);
|
||||
|
||||
// memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x280000, 0x280001, 0, 0, "IN5");
|
||||
// memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2c0000, 0x2c0001, 0, 0, "IN6");
|
||||
@ -7771,14 +7765,7 @@ static DRIVER_INIT( jockeygp )
|
||||
|
||||
static DRIVER_INIT( vliner )
|
||||
{
|
||||
UINT16* extra_ram;
|
||||
|
||||
/* install some extra RAM */
|
||||
extra_ram = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, extra_ram, 0x2000 / 2);
|
||||
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x201fff, 0, 0, "bank8");
|
||||
memory_set_bankptr(machine, NEOGEO_BANK_EXTRA_RAM, extra_ram);
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x201fff, 0, 0, NULL);
|
||||
|
||||
memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x280000, 0x280001, 0, 0, "IN5");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2c0000, 0x2c0001, 0, 0, "IN6");
|
||||
|
@ -5724,8 +5724,7 @@ static READ8_HANDLER( cannonbp_protection_r )
|
||||
static DRIVER_INIT( cannonbp )
|
||||
{
|
||||
/* extra memory */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4800, 0x4bff, 0, 0, "bank5");
|
||||
memory_set_bankptr(machine, "bank5", auto_alloc_array(machine, UINT8, 0x400));
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4800, 0x4bff, 0, 0, NULL);
|
||||
|
||||
/* protection? */
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3000, 0x3fff, 0, 0, cannonbp_protection_r);
|
||||
|
@ -848,8 +848,7 @@ static DRIVER_INIT( pipedrm )
|
||||
/* sprite RAM lives at the end of palette RAM */
|
||||
machine->generic.spriteram.u8 = &machine->generic.paletteram.u8[0xc00];
|
||||
machine->generic.spriteram_size = 0x400;
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xcc00, 0xcfff, 0, 0, "bank3");
|
||||
memory_set_bankptr(machine, "bank3", machine->generic.spriteram.v);
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xcc00, 0xcfff, 0, 0, machine->generic.spriteram.u8);
|
||||
}
|
||||
|
||||
|
||||
|
@ -396,9 +396,7 @@ static void init_systeme_map(running_machine *machine)
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0, segasyse_videoram_w);
|
||||
|
||||
/* main ram area */
|
||||
sms_mainram = auto_alloc_array(machine, UINT8, 0x4000);
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xffff, 0, 0, "bank2");
|
||||
memory_set_bankptr(machine, "bank2", sms_mainram );
|
||||
sms_mainram = memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xffff, 0, 0, NULL);
|
||||
memset(sms_mainram,0x00,0x4000);
|
||||
|
||||
init_ports_systeme(machine);
|
||||
|
@ -1669,11 +1669,7 @@ void megatech_set_genz80_as_sms_standard_map(running_machine *machine, const cha
|
||||
memory_install_readwrite8_handler(cputag_get_address_space(machine, tag, ADDRESS_SPACE_PROGRAM), 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w);
|
||||
|
||||
/* main ram area */
|
||||
sms_mainram = auto_alloc_array(machine, UINT8, 0x2000); // 8kb of main ram
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, tag, ADDRESS_SPACE_PROGRAM), 0xc000, 0xdfff, 0, 0, "bank6");
|
||||
memory_set_bankptr(machine, "bank6", sms_mainram );
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, tag, ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, "bank7");
|
||||
memory_set_bankptr(machine, "bank7", sms_mainram );
|
||||
sms_mainram = memory_install_ram(cputag_get_address_space(machine, tag, ADDRESS_SPACE_PROGRAM), 0xc000, 0xdfff, 0, 0x2000, NULL);
|
||||
memset(sms_mainram,0x00,0x2000);
|
||||
|
||||
megatech_set_genz80_as_sms_standard_ports(machine, tag);
|
||||
|
@ -61,6 +61,8 @@ puzznici note
|
||||
#include "includes/taito_l.h"
|
||||
|
||||
|
||||
static const char * const bankname[] = { "bank2", "bank3", "bank4", "bank5" };
|
||||
|
||||
static const struct
|
||||
{
|
||||
void (*notifier)(running_machine *, int);
|
||||
@ -152,7 +154,7 @@ static void machine_init(running_machine *machine)
|
||||
cur_rambank[i] = 0x80;
|
||||
current_base[i] = palette_ram;
|
||||
current_notifier[i] = palette_notifier;
|
||||
memory_set_bankptr(machine, "bank2"+i, current_base[i]);
|
||||
memory_set_bankptr(machine, bankname[i], current_base[i]);
|
||||
}
|
||||
cur_rombank = cur_rombank2 = 0;
|
||||
memory_set_bankptr(machine, "bank1", memory_region(machine, "maincpu") + 0x10000);
|
||||
@ -392,7 +394,7 @@ logerror("unknown rambankswitch %d, %02x (%04x)\n", offset, data, cpu_get_pc(spa
|
||||
current_notifier[offset] = 0;
|
||||
current_base[offset] = empty_ram;
|
||||
}
|
||||
memory_set_bankptr(space->machine, "bank2"+offset, current_base[offset]);
|
||||
memory_set_bankptr(space->machine, bankname[offset], current_base[offset]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,8 +406,7 @@ static DRIVER_INIT( fixeight )
|
||||
|
||||
if (fixeight_sec_cpu_mem)
|
||||
{
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x28f002, 0x28fbff, 0, 0, "bank2" );
|
||||
memory_set_bankptr(machine, "bank2", fixeight_sec_cpu_mem);
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x28f002, 0x28fbff, 0, 0, fixeight_sec_cpu_mem );
|
||||
}
|
||||
|
||||
toaplan2_sub_cpu = CPU_2_V25;
|
||||
@ -936,8 +935,7 @@ static WRITE16_HANDLER( fixeight_sec_cpu_w )
|
||||
/* game keeping service mode. It writes/reads the settings to/from */
|
||||
/* these shared RAM locations. The secondary CPU reads/writes them */
|
||||
/* from/to nvram to store the settings (a 93C45 EEPROM) */
|
||||
//memory_install_readwrite_bank(space, 0x28f002, 0x28fbff, 0, 0, "bank2");
|
||||
//memory_set_bankptr(space->machine, "bank2", fixeight_sec_cpu_mem);
|
||||
//memory_install_ram(space, 0x28f002, 0x28fbff, 0, 0, fixeight_sec_cpu_mem);
|
||||
memory_install_read_port(space, 0x28f004, 0x28f005, 0, 0, "DSWA"); /* Dip Switch A - Wrong !!! */
|
||||
memory_install_read_port(space, 0x28f006, 0x28f007, 0, 0, "DSWB"); /* Dip Switch B - Wrong !!! */
|
||||
memory_install_read_port(space, 0x28f008, 0x28f009, 0, 0, "JMPR"); /* Territory Jumper block - Wrong !!! */
|
||||
|
@ -24,7 +24,6 @@
|
||||
#define NEOGEO_BANK_CARTRIDGE "cartridge"
|
||||
#define NEOGEO_BANK_BIOS "bios"
|
||||
#define NEOGEO_BANK_VECTORS "vectors"
|
||||
#define NEOGEO_BANK_EXTRA_RAM "extra_ram"
|
||||
#define NEOGEO_BANK_AUDIO_CPU_MAIN_BANK "audio_main"
|
||||
|
||||
|
||||
|
@ -117,7 +117,6 @@ WRITE8_HANDLER( beezer_bankswitch_w )
|
||||
else
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "maincpu") + 0x10000;
|
||||
memory_install_readwrite_bank(space, 0xc000, 0xcfff, 0, 0, "bank1");
|
||||
memory_set_bankptr(space->machine, "bank1", rom + (data & 0x07) * 0x2000 + ((data & 0x08) ? 0x1000: 0));
|
||||
memory_install_ram(space, 0xc000, 0xcfff, 0, 0, rom + (data & 0x07) * 0x2000 + ((data & 0x08) ? 0x1000: 0));
|
||||
}
|
||||
}
|
||||
|
@ -465,8 +465,7 @@ DRIVER_INIT( mktunit )
|
||||
memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1b00000, 0x1b6ffff, 0, 0, mk_prot_r, mk_prot_w);
|
||||
|
||||
/* sound chip protection (hidden RAM) */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), 0xfb9c, 0xfbc6, 0, 0, "bank9");
|
||||
memory_set_bankptr(machine, "bank9", auto_alloc_array(machine, UINT8, 0x80));
|
||||
memory_install_ram(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), 0xfb9c, 0xfbc6, 0, 0, NULL);
|
||||
}
|
||||
|
||||
DRIVER_INIT( mkturbo )
|
||||
@ -498,10 +497,9 @@ static void init_nbajam_common(running_machine *machine, int te_protection)
|
||||
|
||||
/* sound chip protection (hidden RAM) */
|
||||
if (!te_protection)
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), 0xfbaa, 0xfbd4, 0, 0, "bank9");
|
||||
memory_install_ram(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), 0xfbaa, 0xfbd4, 0, 0, NULL);
|
||||
else
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), 0xfbec, 0xfc16, 0, 0, "bank9");
|
||||
memory_set_bankptr(machine, "bank9", auto_alloc_array(machine, UINT8, 0x80));
|
||||
memory_install_ram(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), 0xfbec, 0xfc16, 0, 0, NULL);
|
||||
}
|
||||
|
||||
DRIVER_INIT( nbajam )
|
||||
|
@ -298,20 +298,17 @@ static void init_generic(running_machine *machine, int bpp, int sound, int prot_
|
||||
|
||||
case SOUND_CVSD:
|
||||
williams_cvsd_init(machine);
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "cvsdcpu", ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, "bank9");
|
||||
memory_set_bankptr(machine, "bank9", auto_alloc_array(machine, UINT8, 0x80));
|
||||
memory_install_ram(cputag_get_address_space(machine, "cvsdcpu", ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, NULL);
|
||||
break;
|
||||
|
||||
case SOUND_ADPCM:
|
||||
williams_adpcm_init(machine);
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, "bank9");
|
||||
memory_set_bankptr(machine, "bank9", auto_alloc_array(machine, UINT8, 0x80));
|
||||
memory_install_ram(cputag_get_address_space(machine, "adpcm", ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, NULL);
|
||||
break;
|
||||
|
||||
case SOUND_NARC:
|
||||
williams_narc_init(machine);
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "narc1cpu", ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, "bank9");
|
||||
memory_set_bankptr(machine, "bank9", auto_alloc_array(machine, UINT8, 0x80));
|
||||
memory_install_ram(cputag_get_address_space(machine, "narc1cpu", ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, NULL);
|
||||
break;
|
||||
|
||||
case SOUND_YAWDIM:
|
||||
|
@ -708,8 +708,7 @@ DRIVER_INIT( pcdboard )
|
||||
DRIVER_INIT( pcdboard_2 )
|
||||
{
|
||||
/* extra ram at $6000-$7fff */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
/* common init */
|
||||
DRIVER_INIT_CALL(pcdboard);
|
||||
@ -811,8 +810,7 @@ DRIVER_INIT( pceboard )
|
||||
ppu_latch = mapper9_latch;
|
||||
|
||||
/* nvram at $6000-$6fff */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x1000));
|
||||
memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6fff, 0, 0, NULL );
|
||||
|
||||
/* common init */
|
||||
DRIVER_INIT_CALL(playch10);
|
||||
@ -846,8 +844,7 @@ DRIVER_INIT( pcfboard )
|
||||
DRIVER_INIT( pcfboard_2 )
|
||||
{
|
||||
/* extra ram at $6000-$6fff */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x1000));
|
||||
memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6fff, 0, 0, NULL );
|
||||
|
||||
vram = NULL;
|
||||
|
||||
@ -1026,8 +1023,7 @@ DRIVER_INIT( pcgboard )
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, gboard_rom_switch_w );
|
||||
|
||||
/* extra ram at $6000-$7fff */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
gboard_banks[0] = 0x1e;
|
||||
gboard_banks[1] = 0x1f;
|
||||
@ -1144,8 +1140,7 @@ DRIVER_INIT( pchboard )
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, hboard_rom_switch_w );
|
||||
|
||||
/* extra ram at $6000-$7fff */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
gboard_banks[0] = 0x1e;
|
||||
gboard_banks[1] = 0x1f;
|
||||
@ -1172,8 +1167,7 @@ DRIVER_INIT( pckboard )
|
||||
mmc1_rom_mask = 0x0f;
|
||||
|
||||
/* extra ram at $6000-$7fff */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
/* Roms are banked at $8000 to $bfff */
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w );
|
||||
|
@ -312,8 +312,7 @@ MACHINE_START( vsnes )
|
||||
}
|
||||
else
|
||||
{
|
||||
memory_install_readwrite_bank(ppu1_space, 0x0000, 0x1fff, 0, 0, "bank2");
|
||||
memory_set_bankptr(machine, "bank2", vram);
|
||||
memory_install_ram(ppu1_space, 0x0000, 0x1fff, 0, 0, vram);
|
||||
}
|
||||
}
|
||||
|
||||
@ -495,8 +494,7 @@ DRIVER_INIT( suprmrio )
|
||||
DRIVER_INIT_CALL(vsnormal);
|
||||
|
||||
/* extra ram at $6000 is enabled with bit 1 of $4016 */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
/* now override the vidaccess callback */
|
||||
/* we need to remap color tables */
|
||||
@ -1148,8 +1146,7 @@ DRIVER_INIT( MMC3 )
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, mapper4_w );
|
||||
|
||||
/* extra ram at $6000-$7fff */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
/* common init */
|
||||
init_vsnes(machine);
|
||||
@ -1372,8 +1369,7 @@ DRIVER_INIT( bnglngby )
|
||||
memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0231, 0x0231, 0, 0, set_bnglngby_irq_r, set_bnglngby_irq_w );
|
||||
|
||||
/* extra ram */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
ret = 0;
|
||||
|
||||
@ -1460,10 +1456,8 @@ DRIVER_INIT( vstennis )
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, vstennis_vrom_banking );
|
||||
|
||||
/* shared ram at $6000 */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
|
||||
memory_set_bankptr(machine, "bank1", &prg[0x6000]);
|
||||
memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, &prg[0x6000] );
|
||||
memory_install_ram(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, &prg[0x6000] );
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
@ -1527,8 +1521,7 @@ DRIVER_INIT( btlecity )
|
||||
DRIVER_INIT( vstetris )
|
||||
{
|
||||
/* extra ram at $6000 is enabled with bit 1 of $4016 */
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, "bank1" );
|
||||
memory_set_bankptr(machine, "bank1", auto_alloc_array(machine, UINT8, 0x2000));
|
||||
memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL );
|
||||
|
||||
init_vsnes(machine);
|
||||
DRIVER_INIT_CALL(vsnormal);
|
||||
|
Loading…
Reference in New Issue
Block a user