mirror of
https://github.com/holub/mame
synced 2025-05-20 20:58:51 +03:00
Memory banking now requires a machine object. This makes the memory
system fully global-free, apart from the "active_address_space" which will eventually go away. Also fixed compiler errors from last checkin.
This commit is contained in:
parent
3dcbbe190e
commit
ba6a03d734
@ -1307,7 +1307,7 @@ static void mips_update_scratchpad( const address_space *space )
|
||||
{
|
||||
memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32, SMH_BANK32 );
|
||||
|
||||
memory_set_bankptr( 32, psxcpu->dcache );
|
||||
memory_set_bankptr(space->machine, 32, psxcpu->dcache );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,6 @@
|
||||
|
||||
#include "driver.h"
|
||||
#include "profiler.h"
|
||||
#include "deprecat.h"
|
||||
#include "debug/debugcpu.h"
|
||||
|
||||
|
||||
@ -349,7 +348,7 @@ static genf *get_static_handler(int handlerbits, int readorwrite, int which);
|
||||
/* debugging */
|
||||
static const char *handler_to_string(const address_table *table, UINT8 entry);
|
||||
static void dump_map(FILE *file, const address_space *space, const address_table *table);
|
||||
static void mem_dump(void);
|
||||
static void mem_dump(running_machine *machine);
|
||||
|
||||
|
||||
|
||||
@ -362,10 +361,11 @@ static void mem_dump(void);
|
||||
the opcode base
|
||||
-------------------------------------------------*/
|
||||
|
||||
INLINE void force_opbase_update(address_space *space)
|
||||
INLINE void force_opbase_update(const address_space *space)
|
||||
{
|
||||
space->direct.entry = 0xff;
|
||||
memory_set_direct_region(space, cpu_get_physical_pc_byte(space->cpu));
|
||||
address_space *spacerw = (address_space *)space;
|
||||
spacerw->direct.max = 0;
|
||||
spacerw->direct.min = 1;
|
||||
}
|
||||
|
||||
|
||||
@ -684,7 +684,7 @@ void memory_init(running_machine *machine)
|
||||
memory_init_locate(machine);
|
||||
|
||||
/* dump the final memory configuration */
|
||||
mem_dump();
|
||||
mem_dump(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -821,8 +821,8 @@ void memory_set_decrypted_region(const address_space *space, offs_t addrstart, o
|
||||
found = TRUE;
|
||||
|
||||
/* if we are executing from here, force an opcode base update */
|
||||
if (active_address_space[ADDRESS_SPACE_PROGRAM] != NULL && active_address_space[ADDRESS_SPACE_PROGRAM]->direct.entry == banknum)
|
||||
force_opbase_update((address_space *)space);
|
||||
if (space->direct.entry == banknum)
|
||||
force_opbase_update(space);
|
||||
}
|
||||
|
||||
/* fatal error if the decrypted region straddles the bank */
|
||||
@ -1045,9 +1045,10 @@ void memory_configure_bank_decrypted(running_machine *machine, int banknum, int
|
||||
entry to be the new bank base
|
||||
-------------------------------------------------*/
|
||||
|
||||
void memory_set_bank(int banknum, int entrynum)
|
||||
void memory_set_bank(running_machine *machine, int banknum, int entrynum)
|
||||
{
|
||||
memory_private *memdata = Machine->memory_data;
|
||||
const address_space *space = active_address_space[ADDRESS_SPACE_PROGRAM];
|
||||
memory_private *memdata = machine->memory_data;
|
||||
bank_info *bank = &memdata->bankdata[banknum];
|
||||
|
||||
/* validation checks */
|
||||
@ -1066,8 +1067,8 @@ void memory_set_bank(int banknum, int entrynum)
|
||||
memdata->bankd_ptr[banknum] = bank->entryd[entrynum];
|
||||
|
||||
/* if we're executing out of this bank, adjust the opbase pointer */
|
||||
if (active_address_space[ADDRESS_SPACE_PROGRAM] != NULL && active_address_space[ADDRESS_SPACE_PROGRAM]->direct.entry == banknum)
|
||||
force_opbase_update((address_space *)active_address_space[ADDRESS_SPACE_PROGRAM]);
|
||||
if (space != NULL && space->direct.entry == banknum)
|
||||
force_opbase_update(space);
|
||||
}
|
||||
|
||||
|
||||
@ -1076,9 +1077,9 @@ void memory_set_bank(int banknum, int entrynum)
|
||||
selected bank
|
||||
-------------------------------------------------*/
|
||||
|
||||
int memory_get_bank(int banknum)
|
||||
int memory_get_bank(running_machine *machine, int banknum)
|
||||
{
|
||||
memory_private *memdata = Machine->memory_data;
|
||||
memory_private *memdata = machine->memory_data;
|
||||
bank_info *bank = &memdata->bankdata[banknum];
|
||||
|
||||
/* validation checks */
|
||||
@ -1094,9 +1095,10 @@ int memory_get_bank(int banknum)
|
||||
memory_set_bankptr - set the base of a bank
|
||||
-------------------------------------------------*/
|
||||
|
||||
void memory_set_bankptr(int banknum, void *base)
|
||||
void memory_set_bankptr(running_machine *machine, int banknum, void *base)
|
||||
{
|
||||
memory_private *memdata = Machine->memory_data;
|
||||
const address_space *space = active_address_space[ADDRESS_SPACE_PROGRAM];
|
||||
memory_private *memdata = machine->memory_data;
|
||||
bank_info *bank = &memdata->bankdata[banknum];
|
||||
|
||||
/* validation checks */
|
||||
@ -1113,8 +1115,8 @@ void memory_set_bankptr(int banknum, void *base)
|
||||
memdata->bank_ptr[banknum] = base;
|
||||
|
||||
/* if we're executing out of this bank, adjust the opbase pointer */
|
||||
if (active_address_space[ADDRESS_SPACE_PROGRAM] != NULL && active_address_space[ADDRESS_SPACE_PROGRAM]->direct.entry == banknum)
|
||||
force_opbase_update((address_space *)active_address_space[ADDRESS_SPACE_PROGRAM]);
|
||||
if (space != NULL && space->direct.entry == banknum)
|
||||
force_opbase_update(space);
|
||||
}
|
||||
|
||||
|
||||
@ -1139,7 +1141,7 @@ void *_memory_install_handler(const address_space *space, offs_t addrstart, offs
|
||||
space_map_range(spacerw, ROW_READ, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, spacerw, rhandler_name);
|
||||
if (whandler != 0)
|
||||
space_map_range(spacerw, ROW_WRITE, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, spacerw, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1156,7 +1158,7 @@ UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, of
|
||||
space_map_range(spacerw, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1173,7 +1175,7 @@ UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart,
|
||||
space_map_range(spacerw, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1190,7 +1192,7 @@ UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart,
|
||||
space_map_range(spacerw, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1207,7 +1209,7 @@ UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart,
|
||||
space_map_range(spacerw, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1228,7 +1230,7 @@ void *_memory_install_device_handler(const address_space *space, const device_co
|
||||
space_map_range(spacerw, ROW_READ, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, (void *)device, rhandler_name);
|
||||
if (whandler != 0)
|
||||
space_map_range(spacerw, ROW_WRITE, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, (void *)device, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1245,7 +1247,7 @@ UINT8 *_memory_install_device_handler8(const address_space *space, const device_
|
||||
space_map_range(spacerw, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1262,7 +1264,7 @@ UINT16 *_memory_install_device_handler16(const address_space *space, const devic
|
||||
space_map_range(spacerw, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1279,7 +1281,7 @@ UINT32 *_memory_install_device_handler32(const address_space *space, const devic
|
||||
space_map_range(spacerw, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -1296,7 +1298,7 @@ UINT64 *_memory_install_device_handler64(const address_space *space, const devic
|
||||
space_map_range(spacerw, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
|
||||
if (whandler != NULL)
|
||||
space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
|
||||
mem_dump();
|
||||
mem_dump(space->machine);
|
||||
return space_find_backing_memory(spacerw, ADDR2BYTE(spacerw, addrstart));
|
||||
}
|
||||
|
||||
@ -3241,7 +3243,7 @@ static void dump_map(FILE *file, const address_space *space, const address_table
|
||||
mem_dump - internal memory dump
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void mem_dump(void)
|
||||
static void mem_dump(running_machine *machine)
|
||||
{
|
||||
FILE *file;
|
||||
|
||||
@ -3250,7 +3252,7 @@ static void mem_dump(void)
|
||||
file = fopen("memdump.log", "w");
|
||||
if (file)
|
||||
{
|
||||
memory_dump(Machine, file);
|
||||
memory_dump(machine, file);
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
|
@ -945,13 +945,13 @@ void memory_configure_bank(running_machine *machine, int banknum, int startentry
|
||||
void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride);
|
||||
|
||||
/* select one pre-configured entry to be the new bank base */
|
||||
void memory_set_bank(int banknum, int entrynum);
|
||||
void memory_set_bank(running_machine *machine, int banknum, int entrynum);
|
||||
|
||||
/* return the currently selected bank */
|
||||
int memory_get_bank(int banknum);
|
||||
int memory_get_bank(running_machine *machine, int banknum);
|
||||
|
||||
/* set the absolute address of a bank base */
|
||||
void memory_set_bankptr(int banknum, void *base);
|
||||
void memory_set_bankptr(running_machine *machine, int banknum, void *base);
|
||||
|
||||
|
||||
|
||||
|
@ -158,8 +158,8 @@ void cage_init(running_machine *machine, offs_t speedup)
|
||||
|
||||
cage_irqhandler = NULL;
|
||||
|
||||
memory_set_bankptr(10, memory_region(machine, "cageboot"));
|
||||
memory_set_bankptr(11, memory_region(machine, "cage"));
|
||||
memory_set_bankptr(machine, 10, memory_region(machine, "cageboot"));
|
||||
memory_set_bankptr(machine, 11, memory_region(machine, "cage"));
|
||||
|
||||
cage_cpu = mame_find_cpu_index(machine, "cage");
|
||||
cage_cpu_clock_period = ATTOTIME_IN_HZ(cpu_get_clock(machine->cpu[cage_cpu]));
|
||||
|
@ -24,7 +24,7 @@ void cyberbal_sound_reset(running_machine *machine)
|
||||
{
|
||||
/* reset the sound system */
|
||||
bank_base = &memory_region(machine, "audio")[0x10000];
|
||||
memory_set_bankptr(8, &bank_base[0x0000]);
|
||||
memory_set_bankptr(machine, 8, &bank_base[0x0000]);
|
||||
fast_68k_int = io_68k_int = 0;
|
||||
sound_data_from_68k = sound_data_from_6502 = 0;
|
||||
sound_data_from_68k_ready = sound_data_from_6502_ready = 0;
|
||||
@ -59,7 +59,7 @@ READ8_HANDLER( cyberbal_sound_6502_stat_r )
|
||||
|
||||
WRITE8_HANDLER( cyberbal_sound_bank_select_w )
|
||||
{
|
||||
memory_set_bankptr(8, &bank_base[0x1000 * ((data >> 6) & 3)]);
|
||||
memory_set_bankptr(space->machine, 8, &bank_base[0x1000 * ((data >> 6) & 3)]);
|
||||
coin_counter_w(1, (data >> 5) & 1);
|
||||
coin_counter_w(0, (data >> 4) & 1);
|
||||
cpu_set_input_line(space->machine->cpu[3], INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
@ -786,7 +786,7 @@ static TIMER_CALLBACK( dcs_reset )
|
||||
/* rev 1: just reset the bank to 0 */
|
||||
case 1:
|
||||
dcs.sounddata_bank = 0;
|
||||
memory_set_bank(20, 0);
|
||||
memory_set_bank(machine, 20, 0);
|
||||
break;
|
||||
|
||||
/* rev 2: reset the SDRC ASIC */
|
||||
@ -1046,7 +1046,7 @@ static WRITE16_HANDLER( dcs_dataram_w )
|
||||
static WRITE16_HANDLER( dcs_data_bank_select_w )
|
||||
{
|
||||
dcs.sounddata_bank = data & 0x7ff;
|
||||
memory_set_bank(20, dcs.sounddata_bank % dcs.sounddata_banks);
|
||||
memory_set_bank(space->machine, 20, dcs.sounddata_bank % dcs.sounddata_banks);
|
||||
|
||||
/* bit 11 = sound board led */
|
||||
#if 0
|
||||
@ -1073,15 +1073,15 @@ INLINE void sdrc_update_bank_pointers(void)
|
||||
{
|
||||
/* ROM-based; use the memory page to select from ROM */
|
||||
if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3)
|
||||
memory_set_bankptr(25, &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]);
|
||||
memory_set_bankptr(Machine, 25, &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(25, &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
|
||||
memory_set_bankptr(Machine, 25, &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
|
||||
if (SDRC_DM_ST != 0)
|
||||
memory_set_bankptr(26, &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
|
||||
memory_set_bankptr(Machine, 26, &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1101,7 +1101,7 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
{
|
||||
/* first start with a clean program map */
|
||||
memory_install_readwrite32_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_PROGRAM), 0x0800, 0x3fff, 0, 0, SMH_BANK21, SMH_BANK21);
|
||||
memory_set_bankptr(21, dcs_sram + 0x4800);
|
||||
memory_set_bankptr(machine, 21, dcs_sram + 0x4800);
|
||||
|
||||
/* set up the data map based on the SRAM banking */
|
||||
/* map 0: ram from 0800-37ff */
|
||||
@ -1110,9 +1110,9 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x0800, 0x17ff, 0, 0, SMH_BANK22, SMH_BANK22);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
|
||||
memory_set_bankptr(22, dcs_sram + 0x0000);
|
||||
memory_set_bankptr(23, dcs_sram + 0x1000);
|
||||
memory_set_bankptr(24, dcs_sram + 0x2000);
|
||||
memory_set_bankptr(machine, 22, dcs_sram + 0x0000);
|
||||
memory_set_bankptr(machine, 23, dcs_sram + 0x1000);
|
||||
memory_set_bankptr(machine, 24, dcs_sram + 0x2000);
|
||||
}
|
||||
|
||||
/* map 1: nothing from 0800-17ff, alternate RAM at 1800-27ff, same RAM at 2800-37ff */
|
||||
@ -1121,8 +1121,8 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x0800, 0x17ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
|
||||
memory_set_bankptr(23, dcs_sram + 0x3000);
|
||||
memory_set_bankptr(24, dcs_sram + 0x2000);
|
||||
memory_set_bankptr(machine, 23, dcs_sram + 0x3000);
|
||||
memory_set_bankptr(machine, 24, dcs_sram + 0x2000);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1326,7 +1326,7 @@ static WRITE16_HANDLER( dsio_w )
|
||||
/* offset 2 controls RAM pages */
|
||||
case 2:
|
||||
dsio.reg[2] = data;
|
||||
memory_set_bank(20, DSIO_DM_PG % dcs.sounddata_banks);
|
||||
memory_set_bank(space->machine, 20, DSIO_DM_PG % dcs.sounddata_banks);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1386,7 +1386,7 @@ static WRITE16_HANDLER( denver_w )
|
||||
/* offset 2 controls RAM pages */
|
||||
case 2:
|
||||
dsio.reg[2] = data;
|
||||
memory_set_bank(20, DENV_DM_PG % dcs.sounddata_bank);
|
||||
memory_set_bank(space->machine, 20, DENV_DM_PG % dcs.sounddata_bank);
|
||||
break;
|
||||
|
||||
/* offset 3 controls FIFO reset */
|
||||
|
@ -244,7 +244,7 @@ static void set_ea(const address_space *space, int ea)
|
||||
//printf("ea: %d\n", ea);
|
||||
//cputag_set_input_line(machine, "audio", MCS48_INPUT_EA, (ea) ? ASSERT_LINE : CLEAR_LINE);
|
||||
if (state->eabank != 0)
|
||||
memory_set_bank(state->eabank, ea);
|
||||
memory_set_bank(space->machine, state->eabank, ea);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
|
@ -373,7 +373,7 @@ static int main2sub_pending,sub2main_pending;
|
||||
|
||||
WRITE8_HANDLER( seibu_bank_w )
|
||||
{
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(space->machine, 1, data & 1);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( seibu_coin_w )
|
||||
|
@ -249,9 +249,9 @@ void taito_f3_soundsystem_reset(running_machine *machine)
|
||||
{
|
||||
/* Sound cpu program loads to 0xc00000 so we use a bank */
|
||||
UINT16 *ROM = (UINT16 *)memory_region(machine, "audio");
|
||||
memory_set_bankptr(1,&ROM[0x80000]);
|
||||
memory_set_bankptr(2,&ROM[0x90000]);
|
||||
memory_set_bankptr(3,&ROM[0xa0000]);
|
||||
memory_set_bankptr(machine, 1,&ROM[0x80000]);
|
||||
memory_set_bankptr(machine, 2,&ROM[0x90000]);
|
||||
memory_set_bankptr(machine, 3,&ROM[0xa0000]);
|
||||
|
||||
sound_ram[0]=ROM[0x80000]; /* Stack and Reset vectors */
|
||||
sound_ram[1]=ROM[0x80001];
|
||||
|
@ -284,7 +284,7 @@ void williams_cvsd_init(int pianum)
|
||||
offs_t offset = 0x8000 * ((bank >> 2) & 3) + 0x20000 * (bank & 3);
|
||||
memory_configure_bank(Machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
}
|
||||
memory_set_bank(5, 0);
|
||||
memory_set_bank(sound_cpu->machine, 5, 0);
|
||||
|
||||
/* reset the IRQ state */
|
||||
pia_set_input_ca1(williams_pianum, 1);
|
||||
@ -316,7 +316,7 @@ void williams_narc_init(void)
|
||||
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
|
||||
memory_configure_bank(Machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
}
|
||||
memory_set_bankptr(6, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
|
||||
memory_set_bankptr(sound_cpu->machine, 6, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
|
||||
|
||||
/* configure slave CPU banks */
|
||||
ROM = memory_region(Machine, "narc2");
|
||||
@ -330,7 +330,7 @@ void williams_narc_init(void)
|
||||
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
|
||||
memory_configure_bank(Machine, 7, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
}
|
||||
memory_set_bankptr(8, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
|
||||
memory_set_bankptr(sound_cpu->machine, 8, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
|
||||
|
||||
/* register for save states */
|
||||
state_save_register_global(williams_sound_int_state);
|
||||
@ -350,7 +350,7 @@ void williams_adpcm_init(void)
|
||||
/* configure banks */
|
||||
ROM = memory_region(Machine, "adpcm");
|
||||
memory_configure_bank(Machine, 5, 0, 8, &ROM[0x10000], 0x8000);
|
||||
memory_set_bankptr(6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
|
||||
memory_set_bankptr(sound_cpu->machine, 6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
|
||||
|
||||
/* expand ADPCM data */
|
||||
/* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */
|
||||
@ -440,7 +440,7 @@ static void adpcm_ym2151_irq(running_machine *machine, int state)
|
||||
|
||||
static WRITE8_HANDLER( cvsd_bank_select_w )
|
||||
{
|
||||
memory_set_bank(5, data & 0x0f);
|
||||
memory_set_bank(space->machine, 5, data & 0x0f);
|
||||
}
|
||||
|
||||
|
||||
@ -506,13 +506,13 @@ void williams_cvsd_reset_w(int state)
|
||||
|
||||
static WRITE8_HANDLER( narc_master_bank_select_w )
|
||||
{
|
||||
memory_set_bank(5, data & 0x0f);
|
||||
memory_set_bank(space->machine, 5, data & 0x0f);
|
||||
}
|
||||
|
||||
|
||||
static WRITE8_HANDLER( narc_slave_bank_select_w )
|
||||
{
|
||||
memory_set_bank(7, data & 0x0f);
|
||||
memory_set_bank(space->machine, 7, data & 0x0f);
|
||||
}
|
||||
|
||||
|
||||
@ -625,7 +625,7 @@ int williams_narc_talkback_r(void)
|
||||
|
||||
static WRITE8_HANDLER( adpcm_bank_select_w )
|
||||
{
|
||||
memory_set_bank(5, data & 0x07);
|
||||
memory_set_bank(space->machine, 5, data & 0x07);
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,7 +99,7 @@ extern VIDEO_UPDATE( 1942 );
|
||||
|
||||
static WRITE8_HANDLER( c1942_bankswitch_w )
|
||||
{
|
||||
memory_set_bank(1, data & 0x03);
|
||||
memory_set_bank(space->machine, 1, data & 0x03);
|
||||
}
|
||||
|
||||
|
||||
|
@ -305,7 +305,7 @@ static WRITE8_HANDLER( bank_select_w )
|
||||
// popmessage("WRONG BANK SELECT = %x !!!!\n",data);
|
||||
}
|
||||
|
||||
memory_set_bank( 1, data&1 );
|
||||
memory_set_bank(space->machine, 1, data&1 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,7 +111,7 @@ static WRITE8_HANDLER( aerofgt_sh_bankswitch_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "audio") + 0x10000;
|
||||
|
||||
memory_set_bankptr(1,rom + (data & 0x03) * 0x8000);
|
||||
memory_set_bankptr(space->machine, 1,rom + (data & 0x03) * 0x8000);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( aerofgt )
|
||||
|
@ -289,7 +289,7 @@ static void airbustr_bankswitch(running_machine *machine, const char *cpu, int b
|
||||
else
|
||||
ROM = &ROM[0x10000 + 0x4000 * ((data & 0x07) - 3)];
|
||||
|
||||
memory_set_bankptr(bank, ROM);
|
||||
memory_set_bankptr(machine, bank, ROM);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( master_bankswitch_w )
|
||||
|
@ -198,7 +198,7 @@ static CUSTOM_INPUT( lightgun_holster_r )
|
||||
static void alg_cia_0_porta_w(UINT8 data)
|
||||
{
|
||||
/* switch banks as appropriate */
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(Machine, 1, data & 1);
|
||||
|
||||
/* swap the write handlers between ROM and bank 1 based on the bit */
|
||||
if ((data & 1) == 0)
|
||||
|
@ -490,7 +490,7 @@ static void aliens_banking( int lines )
|
||||
if (lines & 0x10) offs -= 0x8000;
|
||||
|
||||
offs += (lines & 0x0f)*0x2000;
|
||||
memory_set_bankptr( 1, &RAM[offs] );
|
||||
memory_set_bankptr(Machine, 1, &RAM[offs] );
|
||||
}
|
||||
|
||||
static MACHINE_RESET( aliens )
|
||||
@ -500,7 +500,7 @@ static MACHINE_RESET( aliens )
|
||||
cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)aliens_banking);
|
||||
|
||||
/* init the default bank */
|
||||
memory_set_bankptr( 1, &RAM[0x10000] );
|
||||
memory_set_bankptr(machine, 1, &RAM[0x10000] );
|
||||
}
|
||||
|
||||
|
||||
|
@ -772,7 +772,7 @@ static WRITE8_HANDLER( sound_bank_w )
|
||||
UINT8 *RAM = memory_region(space->machine, "audio");
|
||||
|
||||
bankaddress = 0x10000 + (data) * 0x4000;
|
||||
memory_set_bankptr(7,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 7,&RAM[bankaddress]);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
@ -3178,7 +3178,7 @@ static DRIVER_INIT( btlfildb )
|
||||
static DRIVER_INIT( skysoldr )
|
||||
{
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skysoldr_cycle_r);
|
||||
memory_set_bankptr(8, (memory_region(machine, "user1"))+0x40000);
|
||||
memory_set_bankptr(machine, 8, (memory_region(machine, "user1"))+0x40000);
|
||||
invert_controls=0;
|
||||
microcontroller_id=0;
|
||||
coin_id=0x22|(0x22<<8);
|
||||
@ -3193,7 +3193,7 @@ static DRIVER_INIT( goldmedl )
|
||||
|
||||
static DRIVER_INIT( goldmeda )
|
||||
{
|
||||
memory_set_bankptr(8, memory_region(machine, "main") + 0x20000);
|
||||
memory_set_bankptr(machine, 8, memory_region(machine, "main") + 0x20000);
|
||||
invert_controls=0;
|
||||
microcontroller_id=0x8803; //Guess - routine to handle coinage is the same as in 'goldmedl'
|
||||
coin_id=0x23|(0x24<<8);
|
||||
@ -3218,7 +3218,7 @@ static DRIVER_INIT( skyadvnu )
|
||||
static DRIVER_INIT( gangwars )
|
||||
{
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwars_cycle_r);
|
||||
memory_set_bankptr(8, memory_region(machine, "user1"));
|
||||
memory_set_bankptr(machine, 8, memory_region(machine, "user1"));
|
||||
invert_controls=0;
|
||||
microcontroller_id=0x8512;
|
||||
coin_id=0x23|(0x24<<8);
|
||||
@ -3227,7 +3227,7 @@ static DRIVER_INIT( gangwars )
|
||||
static DRIVER_INIT( gangwarb )
|
||||
{
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwarb_cycle_r);
|
||||
memory_set_bankptr(8, memory_region(machine, "user1"));
|
||||
memory_set_bankptr(machine, 8, memory_region(machine, "user1"));
|
||||
invert_controls=0;
|
||||
microcontroller_id=0x8512;
|
||||
coin_id=0x23|(0x24<<8);
|
||||
|
@ -164,7 +164,7 @@ static WRITE8_HANDLER ( angelkds_cpu_bank_write )
|
||||
UINT8 *RAM = memory_region(space->machine, "user1");
|
||||
|
||||
bankaddress = data & 0x0f;
|
||||
memory_set_bankptr(1,&RAM[bankaddress*0x4000]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress*0x4000]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,7 +104,7 @@ static WRITE8_HANDLER( aquarium_z80_bank_w )
|
||||
int soundbank = ((data & 0x7) + 1) * 0x8000;
|
||||
UINT8 *Z80 = (UINT8 *)memory_region(space->machine, "audio");
|
||||
|
||||
memory_set_bankptr(1, &Z80[soundbank + 0x10000]);
|
||||
memory_set_bankptr(space->machine, 1, &Z80[soundbank + 0x10000]);
|
||||
}
|
||||
|
||||
static UINT8 aquarium_snd_bitswap(UINT8 scrambled_data)
|
||||
|
@ -100,7 +100,7 @@ static UINT8 arcadia_cia_0_porta_r(void)
|
||||
static void arcadia_cia_0_porta_w(UINT8 data)
|
||||
{
|
||||
/* switch banks as appropriate */
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(Machine, 1, data & 1);
|
||||
|
||||
/* swap the write handlers between ROM and bank 1 based on the bit */
|
||||
if ((data & 1) == 0)
|
||||
|
@ -135,7 +135,7 @@ static WRITE8_HANDLER( argus_bankselect_w )
|
||||
int bankaddress;
|
||||
|
||||
bankaddress = 0x10000 + ((data & 7) * 0x4000);
|
||||
memory_set_bankptr(1, &RAM[bankaddress]); /* Select 8 banks of 16k */
|
||||
memory_set_bankptr(space->machine, 1, &RAM[bankaddress]); /* Select 8 banks of 16k */
|
||||
}
|
||||
|
||||
|
||||
|
@ -306,7 +306,7 @@ static WRITE8_HANDLER( ym2203_write_a )
|
||||
|
||||
static WRITE8_HANDLER( ym2203_write_b )
|
||||
{
|
||||
memory_set_bankptr(4, memory_region(space->machine, "adpcm") + ((data & 0xf) * 0x8000));
|
||||
memory_set_bankptr(space->machine, 4, memory_region(space->machine, "adpcm") + ((data & 0xf) * 0x8000));
|
||||
}
|
||||
|
||||
static const ym2203_interface ym2203_config =
|
||||
@ -346,7 +346,7 @@ static const msm5205_interface msm5205_config =
|
||||
|
||||
static DRIVER_INIT( ashnojoe )
|
||||
{
|
||||
memory_set_bankptr(4, memory_region(machine, "adpcm"));
|
||||
memory_set_bankptr(machine, 4, memory_region(machine, "adpcm"));
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( ashnojoe )
|
||||
|
@ -422,7 +422,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
|
||||
|
||||
/* set the main banking */
|
||||
memory_install_read8_handler(space, 0x4000, 0xbfff, 0, 0, SMH_BANK1);
|
||||
memory_set_bankptr(1, memory_region(space->machine, "user1") + 0x8000 * bank);
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "user1") + 0x8000 * bank);
|
||||
|
||||
/* bank 0 reads video RAM in the 4000-7FFF range */
|
||||
if (bank == 0)
|
||||
@ -438,7 +438,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
|
||||
if (bank < 0x28)
|
||||
{
|
||||
memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_BANK2);
|
||||
memory_set_bankptr(2, memory_region(space->machine, "user2") + 0x4000 * bank);
|
||||
memory_set_bankptr(space->machine, 2, memory_region(space->machine, "user2") + 0x4000 * bank);
|
||||
}
|
||||
else
|
||||
memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
|
||||
|
@ -257,7 +257,7 @@ static INTERRUPT_GEN( cadash_interrupt )
|
||||
|
||||
static WRITE8_HANDLER( sound_bankswitch_w )
|
||||
{
|
||||
memory_set_bankptr( 1, memory_region(space->machine, "audio") + ((data-1) & 0x03) * 0x4000 + 0x10000 );
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "audio") + ((data-1) & 0x03) * 0x4000 + 0x10000 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -792,7 +792,7 @@ static DRIVER_INIT( asylum )
|
||||
|
||||
/* asylum appears to have some extra RAM for the slave CPU */
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, SMH_BANK4, SMH_BANK4);
|
||||
memory_set_bankptr(4, auto_malloc(0x1000));
|
||||
memory_set_bankptr(machine, 4, auto_malloc(0x1000));
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P2"));
|
||||
|
@ -39,7 +39,7 @@ static WRITE8_HANDLER( battlnts_bankswitch_w )
|
||||
|
||||
/* bits 6 & 7 = bank number */
|
||||
bankaddress = 0x10000 + ((data & 0xc0) >> 6) * 0x4000;
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
|
||||
/* bits 4 & 5 = coin counters */
|
||||
coin_counter_w(0,data & 0x10);
|
||||
|
@ -976,15 +976,15 @@ INLINE void z80_bank(running_machine *machine, int num, int data)
|
||||
|
||||
UINT32 offset = ((bank[0] >> 1) * 0x20000) + offs_table[bank[0] & 0x1][data];
|
||||
|
||||
memory_set_bankptr(num, memory_region(machine, "user1") + offset);
|
||||
memory_set_bankptr(machine, num, memory_region(machine, "user1") + offset);
|
||||
}
|
||||
else if (data < 0x10)
|
||||
{
|
||||
memory_set_bankptr(num, &video_ram[(data - 0x08) * 0x4000]);
|
||||
memory_set_bankptr(machine, num, &video_ram[(data - 0x08) * 0x4000]);
|
||||
}
|
||||
else
|
||||
{
|
||||
memory_set_bankptr(num, &work_ram[(data - 0x10) * 0x4000]);
|
||||
memory_set_bankptr(machine, num, &work_ram[(data - 0x10) * 0x4000]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1672,7 +1672,7 @@ static DRIVER_INIT( bfcobra )
|
||||
bank[3] = 0;
|
||||
|
||||
/* Fixed 16kB ROM region */
|
||||
memory_set_bankptr(4, memory_region(machine, "user1"));
|
||||
memory_set_bankptr(machine, 4, memory_region(machine, "user1"));
|
||||
|
||||
/* Configure the ACIAs */
|
||||
acia6850_config(0, &z80_acia_if);
|
||||
|
@ -377,7 +377,7 @@ send data to them, although obviously there's no response. */
|
||||
memory_configure_bank(machine, 1, 0, 1, &rom[0x10000], 0);
|
||||
memory_configure_bank(machine, 1, 1, 3, &rom[0x02000], 0x02000);
|
||||
|
||||
memory_set_bank(1,3);
|
||||
memory_set_bank(machine, 1,3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -492,7 +492,7 @@ static WRITE8_HANDLER( watchdog_w )
|
||||
|
||||
static WRITE8_HANDLER( bankswitch_w )
|
||||
{
|
||||
memory_set_bank(1,data & 0x03);
|
||||
memory_set_bank(space->machine, 1,data & 0x03);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -78,7 +78,7 @@ static WRITE8_HANDLER( beg_banking_w )
|
||||
/* d0-d3 connect to A11-A14 of the ROMs (via ls273 latch)
|
||||
d4-d7 select one of ROMs (via ls273(above) and then ls154)
|
||||
*/
|
||||
memory_set_bankptr(1, memory_region(space->machine, "main") + 0x10000 + 0x800*(beg_bank&0xff)); /* empty sockets for IC37-IC44 ROMS */
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "main") + 0x10000 + 0x800*(beg_bank&0xff)); /* empty sockets for IC37-IC44 ROMS */
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( from_sound_latch_callback )
|
||||
|
@ -80,7 +80,7 @@ static WRITE8_HANDLER( bladestl_bankswitch_w )
|
||||
|
||||
/* bits 5-6 = bank number */
|
||||
bankaddress = 0x10000 + ((data & 0x60) >> 5) * 0x2000;
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
|
||||
/* bit 7 = select sprite bank */
|
||||
bladestl_spritebank = (data & 0x80) << 3;
|
||||
|
@ -48,7 +48,7 @@ static READ8_HANDLER( blktiger_protection_r )
|
||||
|
||||
static WRITE8_HANDLER( blktiger_bankswitch_w )
|
||||
{
|
||||
memory_set_bank(1, data & 0x0f);
|
||||
memory_set_bank(space->machine, 1, data & 0x0f);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( blktiger_coinlockout_w )
|
||||
|
@ -297,7 +297,7 @@ static void blockhl_banking( int lines )
|
||||
/* bits 0-1 = ROM bank */
|
||||
rombank = lines & 0x03;
|
||||
offs = 0x10000 + (lines & 0x03) * 0x2000;
|
||||
memory_set_bankptr(1,&RAM[offs]);
|
||||
memory_set_bankptr(Machine, 1,&RAM[offs]);
|
||||
|
||||
/* bits 3/4 = coin counters */
|
||||
coin_counter_w(0,lines & 0x08);
|
||||
|
@ -1442,7 +1442,7 @@ static DRIVER_INIT (bnstars)
|
||||
decrypt_ms32_tx(machine, 0x00020,0x7e, "gfx7");
|
||||
decrypt_ms32_bg(machine, 0x00001,0x9b, "gfx6");
|
||||
|
||||
memory_set_bankptr(1, memory_region(machine, "main"));
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "main"));
|
||||
}
|
||||
|
||||
GAME( 1997, bnstars1, 0, bnstars, bnstars, bnstars, ROT0, "Jaleco", "Vs. Janshi Brandnew Stars", GAME_NO_SOUND )
|
||||
|
@ -77,7 +77,7 @@ if ((data & 1) == 0) popmessage("bankswitch RAM bank 0");
|
||||
/* bit 1-4 = ROM bank */
|
||||
if (data & 0x10) offs = 0x20000 + (data & 0x06) * 0x1000;
|
||||
else offs = 0x10000 + (data & 0x0e) * 0x1000;
|
||||
memory_set_bankptr(1,&RAM[offs]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[offs]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( bottom9_1f90_w )
|
||||
|
@ -90,7 +90,7 @@ Dip locations and factory settings verified from dip listing
|
||||
|
||||
static WRITE8_HANDLER( bankswitch_w )
|
||||
{
|
||||
memory_set_bankptr(1,&memory_region(space->machine, "main")[0x10000 + (data & 7) * 0x2000]);
|
||||
memory_set_bankptr(space->machine, 1,&memory_region(space->machine, "main")[0x10000 + (data & 7) * 0x2000]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -803,7 +803,7 @@ static WRITE8_HANDLER( analog_select_w )
|
||||
static DRIVER_INIT( bradley )
|
||||
{
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x400, 0x7ff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
memory_set_bankptr(1, auto_malloc(0x400));
|
||||
memory_set_bankptr(machine, 1, auto_malloc(0x400));
|
||||
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1808, 0x1808, 0, 0, input_port_read_handler8(machine->portconfig, "1808"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1809, 0x1809, 0, 0, input_port_read_handler8(machine->portconfig, "1809"));
|
||||
|
@ -149,7 +149,7 @@ static MACHINE_RESET( capbowl )
|
||||
static WRITE8_HANDLER( capbowl_rom_select_w )
|
||||
{
|
||||
int bankaddress = ((data & 0x0c) << 13) + ((data & 0x01) << 14);
|
||||
memory_set_bankptr(1, memory_region(space->machine, "main") + 0x10000 + bankaddress);
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "main") + 0x10000 + bankaddress);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1176,7 +1176,7 @@ static WRITE8_HANDLER( hotdogst_rombank_w )
|
||||
int bank = data & 0x0f;
|
||||
if ( data & ~0x0f ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(space->cpu),data);
|
||||
if (bank > 1) bank+=2;
|
||||
memory_set_bankptr(2, &RAM[ 0x4000 * bank ]);
|
||||
memory_set_bankptr(space->machine, 2, &RAM[ 0x4000 * bank ]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( hotdogst_okibank_w )
|
||||
@ -1229,7 +1229,7 @@ static WRITE8_HANDLER( mazinger_rombank_w )
|
||||
int bank = data & 0x07;
|
||||
if ( data & ~0x07 ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(space->cpu),data);
|
||||
if (bank > 1) bank+=2;
|
||||
memory_set_bankptr(2, &RAM[ 0x4000 * bank ]);
|
||||
memory_set_bankptr(space->machine, 2, &RAM[ 0x4000 * bank ]);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( mazinger_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
@ -1273,7 +1273,7 @@ static WRITE8_HANDLER( metmqstr_rombank_w )
|
||||
int bank = data & 0xf;
|
||||
if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(space->cpu),data);
|
||||
if (bank >= 2) bank += 2;
|
||||
memory_set_bankptr(1, &ROM[ 0x4000 * bank ]);
|
||||
memory_set_bankptr(space->machine, 1, &ROM[ 0x4000 * bank ]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( metmqstr_okibank0_w )
|
||||
@ -1336,7 +1336,7 @@ static WRITE8_HANDLER( pwrinst2_rombank_w )
|
||||
int bank = data & 0x07;
|
||||
if ( data & ~0x07 ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(space->cpu),data);
|
||||
if (bank > 2) bank+=1;
|
||||
memory_set_bankptr(1, &ROM[ 0x4000 * bank ]);
|
||||
memory_set_bankptr(space->machine, 1, &ROM[ 0x4000 * bank ]);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( pwrinst2_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
@ -1394,7 +1394,7 @@ static WRITE8_HANDLER( sailormn_rombank_w )
|
||||
int bank = data & 0x1f;
|
||||
if ( data & ~0x1f ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(space->cpu),data);
|
||||
if (bank > 1) bank+=2;
|
||||
memory_set_bankptr(1, &RAM[ 0x4000 * bank ]);
|
||||
memory_set_bankptr(space->machine, 1, &RAM[ 0x4000 * bank ]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( sailormn_okibank0_w )
|
||||
@ -4246,7 +4246,7 @@ static DRIVER_INIT( mazinger )
|
||||
time_vblank_irq = 2100;
|
||||
|
||||
/* setup extra ROM */
|
||||
memory_set_bankptr(1,memory_region(machine, "user1"));
|
||||
memory_set_bankptr(machine, 1,memory_region(machine, "user1"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ static WRITE8_HANDLER( cbasebal_bankswitch_w )
|
||||
{
|
||||
/* bits 0-4 select ROM bank */
|
||||
//logerror("%04x: bankswitch %02x\n",cpu_get_pc(space->cpu),data);
|
||||
memory_set_bank(1, data & 0x1f);
|
||||
memory_set_bank(space->machine, 1, data & 0x1f);
|
||||
|
||||
/* bit 5 used but unknown */
|
||||
|
||||
|
@ -284,7 +284,7 @@ static WRITE8_HANDLER( ccounter_w )
|
||||
|
||||
static WRITE8_HANDLER( bankswitch_w )
|
||||
{
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(space->machine, 1, data & 1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -241,7 +241,7 @@ static WRITE8_HANDLER(toprollr_rombank_w)
|
||||
toprollr_rombank |= (data & 1) << offset;
|
||||
|
||||
if (toprollr_rombank < 3)
|
||||
memory_set_bank(1, toprollr_rombank);
|
||||
memory_set_bank(space->machine, 1, toprollr_rombank);
|
||||
}
|
||||
|
||||
|
||||
|
@ -178,7 +178,7 @@ static WRITE8_HANDLER( champbwl_misc_w )
|
||||
coin_lockout_w(0, ~data & 8);
|
||||
coin_lockout_w(1, ~data & 4);
|
||||
|
||||
memory_set_bankptr(1, memory_region(space->machine, "main") + 0x10000 + 0x4000 * ((data & 0x30)>>4));
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "main") + 0x10000 + 0x4000 * ((data & 0x30)>>4));
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( champbwl_objctrl_w )
|
||||
|
@ -304,7 +304,7 @@ static WRITE8_HANDLER(chanbara_ay_out_0_w)
|
||||
static WRITE8_HANDLER(chanbara_ay_out_1_w)
|
||||
{
|
||||
// printf("chanbara_ay_out_1_w %02x\n",data);
|
||||
memory_set_bankptr(1, memory_region(space->machine, "user1") + ((data&4)?0x4000:0x0000) );
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "user1") + ((data&4)?0x4000:0x0000) );
|
||||
scrollhi = data & 0x03;
|
||||
|
||||
//if (data&0xf8) printf("chanbara_ay_out_1_w unused bits set %02x\n",data&0xf8);
|
||||
|
@ -131,13 +131,13 @@ static WRITE8_HANDLER( chinagat_video_ctrl_w )
|
||||
static WRITE8_HANDLER( chinagat_bankswitch_w )
|
||||
{
|
||||
UINT8 *RAM = memory_region(space->machine, "main");
|
||||
memory_set_bankptr( 1,&RAM[ 0x10000 + (0x4000 * (data & 7)) ] );
|
||||
memory_set_bankptr(space->machine, 1,&RAM[ 0x10000 + (0x4000 * (data & 7)) ] );
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( chinagat_sub_bankswitch_w )
|
||||
{
|
||||
UINT8 *RAM = memory_region( space->machine, "sub" );
|
||||
memory_set_bankptr( 4,&RAM[ 0x10000 + (0x4000 * (data & 7)) ] );
|
||||
memory_set_bankptr(space->machine, 4,&RAM[ 0x10000 + (0x4000 * (data & 7)) ] );
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( chinagat_sub_IRQ_w )
|
||||
|
@ -79,7 +79,7 @@ static MACHINE_RESET( chinsan )
|
||||
|
||||
static WRITE8_HANDLER(ctrl_w)
|
||||
{
|
||||
memory_set_bank(1, data >> 6);
|
||||
memory_set_bank(space->machine, 1, data >> 6);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( ym_port_w1 )
|
||||
|
@ -49,13 +49,13 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
|
||||
|
||||
/* bits 0-4 = ROM bank # (0x00-0x11) */
|
||||
bankaddress = 0x10000 + (data & 0x1f)*0x4000;
|
||||
memory_set_bankptr(4,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 4,&RAM[bankaddress]);
|
||||
|
||||
/* bit 5 = memory bank select */
|
||||
if (data & 0x20)
|
||||
{
|
||||
memory_install_readwrite8_handler(space, 0x1800, 0x1fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_set_bankptr(5, paletteram);
|
||||
memory_set_bankptr(space->machine, 5, paletteram);
|
||||
|
||||
if (K051316_readroms)
|
||||
memory_install_readwrite8_handler(space, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */
|
||||
|
@ -72,7 +72,7 @@ static WRITE8_HANDLER( draco_sound_bankswitch_w )
|
||||
|
||||
int bank = BIT(data, 3);
|
||||
|
||||
memory_set_bank(1, bank);
|
||||
memory_set_bank(space->machine, 1, bank);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( draco_sound_g_w )
|
||||
@ -567,7 +567,7 @@ static MACHINE_START( draco )
|
||||
/* setup COP402 memory banking */
|
||||
|
||||
memory_configure_bank(machine, 1, 0, 2, memory_region(machine, "audio"), 0x400);
|
||||
memory_set_bank(1, 0);
|
||||
memory_set_bank(machine, 1, 0);
|
||||
|
||||
/* register for state saving */
|
||||
|
||||
|
@ -281,7 +281,7 @@ static READ8_HANDLER( qb3_frame_r )
|
||||
|
||||
static WRITE8_HANDLER( qb3_ram_bank_w )
|
||||
{
|
||||
memory_set_bank(1, cpu_get_reg(space->machine->cpu[0], CCPU_P) & 3);
|
||||
memory_set_bank(space->machine, 1, cpu_get_reg(space->machine->cpu[0], CCPU_P) & 3);
|
||||
}
|
||||
|
||||
|
||||
|
@ -351,16 +351,16 @@ static MACHINE_RESET( cojag )
|
||||
if (cojag_is_r3000)
|
||||
{
|
||||
memory_configure_bank(machine, 1, 0, 2, rom + 0x800000, 0x400000);
|
||||
memory_set_bank(1, 0);
|
||||
memory_set_bank(machine, 1, 0);
|
||||
}
|
||||
memory_configure_bank(machine, 8, 0, 2, rom + 0x800000, 0x400000);
|
||||
memory_set_bank(8, 0);
|
||||
memory_set_bank(machine, 8, 0);
|
||||
|
||||
/* sound banks */
|
||||
memory_configure_bank(machine, 2, 0, 8, rom + 0x000000, 0x200000);
|
||||
memory_configure_bank(machine, 9, 0, 8, rom + 0x000000, 0x200000);
|
||||
memory_set_bank(2, 0);
|
||||
memory_set_bank(9, 0);
|
||||
memory_set_bank(machine, 2, 0);
|
||||
memory_set_bank(machine, 9, 0);
|
||||
}
|
||||
|
||||
/* clear any spinuntil stuff */
|
||||
@ -425,8 +425,8 @@ static WRITE32_HANDLER( misc_control_w )
|
||||
/* adjust banking */
|
||||
if (memory_region(space->machine, "user2"))
|
||||
{
|
||||
memory_set_bank(2, (data >> 1) & 7);
|
||||
memory_set_bank(9, (data >> 1) & 7);
|
||||
memory_set_bank(space->machine, 2, (data >> 1) & 7);
|
||||
memory_set_bank(space->machine, 9, (data >> 1) & 7);
|
||||
}
|
||||
|
||||
COMBINE_DATA(&misc_control_data);
|
||||
@ -492,8 +492,8 @@ static WRITE32_HANDLER( latch_w )
|
||||
if (memory_region(space->machine, "user2"))
|
||||
{
|
||||
if (cojag_is_r3000)
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(8, data & 1);
|
||||
memory_set_bank(space->machine, 1, data & 1);
|
||||
memory_set_bank(space->machine, 8, data & 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ static WRITE8_HANDLER( compgolf_ctrl_w )
|
||||
if( bank != new_bank )
|
||||
{
|
||||
bank = new_bank;
|
||||
memory_set_bankptr(1, memory_region(space->machine, "user1") + 0x4000 * bank);
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "user1") + 0x4000 * bank);
|
||||
}
|
||||
|
||||
compgolf_scrollx_hi = (data & 1) << 8;
|
||||
|
@ -47,7 +47,7 @@ static WRITE8_HANDLER( contra_bankswitch_w )
|
||||
|
||||
bankaddress = 0x10000 + (data & 0x0f) * 0x2000;
|
||||
if (bankaddress < 0x28000) /* for safety */
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( contra_sh_irqtrigger_w )
|
||||
|
@ -468,7 +468,7 @@ static DRIVER_INIT( couple )
|
||||
dumpers it's just the way it is,a.k.a. it's an "hardware" banking.
|
||||
update 20060118 by f205v: now we have 3 dumps from 3 different boards and they
|
||||
all behave the same...*/
|
||||
memory_set_bankptr(1,ROM + 0x10000 + (0x2000 * 2));
|
||||
memory_set_bankptr(machine, 1,ROM + 0x10000 + (0x2000 * 2));
|
||||
}
|
||||
|
||||
/*Year is uncertain:
|
||||
|
@ -282,7 +282,7 @@ static WRITE8_HANDLER( cps1_snd_bankswitch_w )
|
||||
int bankaddr;
|
||||
|
||||
bankaddr = ((data & 1) * 0x4000);
|
||||
memory_set_bankptr(1,&RAM[0x10000 + bankaddr]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[0x10000 + bankaddr]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( cps1_oki_pin7_w )
|
||||
@ -395,7 +395,7 @@ static WRITE8_HANDLER( qsound_banksw_w )
|
||||
logerror("WARNING: Q sound bank overflow (%02x)\n", data);
|
||||
bankaddress=0x10000;
|
||||
}
|
||||
memory_set_bankptr(1, &RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1, &RAM[bankaddress]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ static UINT8 sample_count;
|
||||
|
||||
static WRITE8_HANDLER( rom_bank_select_w )
|
||||
{
|
||||
memory_set_bank(1, data & 15);
|
||||
memory_set_bank(space->machine, 1, data & 15);
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ static MACHINE_START( crgolf )
|
||||
{
|
||||
/* configure the banking */
|
||||
memory_configure_bank(machine, 1, 0, 16, memory_region(machine, "main") + 0x10000, 0x2000);
|
||||
memory_set_bank(1, 0);
|
||||
memory_set_bank(machine, 1, 0);
|
||||
|
||||
/* register for save states */
|
||||
state_save_register_global(port_select);
|
||||
|
@ -424,7 +424,7 @@ static void crimfght_banking( int lines )
|
||||
if (lines & 0x20)
|
||||
{
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, SMH_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_set_bankptr(3, paletteram);
|
||||
memory_set_bankptr(Machine, 3, paletteram);
|
||||
}
|
||||
else
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
|
||||
@ -433,7 +433,7 @@ static void crimfght_banking( int lines )
|
||||
K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
offs = 0x10000 + ((lines & 0x0f) * 0x2000);
|
||||
memory_set_bankptr(2, &RAM[offs]);
|
||||
memory_set_bankptr(Machine, 2, &RAM[offs]);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( crimfght )
|
||||
@ -443,7 +443,7 @@ static MACHINE_RESET( crimfght )
|
||||
cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)crimfght_banking);
|
||||
|
||||
/* init the default bank */
|
||||
memory_set_bankptr( 2, &RAM[0x10000] );
|
||||
memory_set_bankptr(machine, 2, &RAM[0x10000] );
|
||||
}
|
||||
|
||||
static DRIVER_INIT( crimfght )
|
||||
|
@ -157,7 +157,7 @@ static WRITE8_HANDLER( crshrace_sh_bankswitch_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "audio") + 0x10000;
|
||||
|
||||
memory_set_bankptr(1,rom + (data & 0x03) * 0x8000);
|
||||
memory_set_bankptr(space->machine, 1,rom + (data & 0x03) * 0x8000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -230,9 +230,9 @@ static WRITE32_HANDLER(Banksw_w)
|
||||
{
|
||||
Bank=(data>>1)&7;
|
||||
if(Bank<=2)
|
||||
memory_set_bankptr(1,memory_region(space->machine, "user1")+Bank*0x1000000);
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "user1")+Bank*0x1000000);
|
||||
else
|
||||
memory_set_bankptr(1,memory_region(space->machine, "user2"));
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "user2"));
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( Timercb )
|
||||
@ -516,7 +516,7 @@ static MACHINE_RESET(crystal)
|
||||
IntHigh=0;
|
||||
cpu_set_irq_callback(machine->cpu[0],icallback);
|
||||
Bank=0;
|
||||
memory_set_bankptr(1,memory_region(machine, "user1")+0);
|
||||
memory_set_bankptr(machine, 1,memory_region(machine, "user1")+0);
|
||||
FlashCmd=0xff;
|
||||
OldPort4=0;
|
||||
|
||||
|
@ -234,7 +234,7 @@ static WRITE8_HANDLER ( cshooter_c700_w )
|
||||
|
||||
static WRITE8_HANDLER ( bank_w )
|
||||
{
|
||||
memory_set_bankptr(1,&memory_region(space->machine, "user1")[0x4000*((data>>4)&3)]);
|
||||
memory_set_bankptr(space->machine, 1,&memory_region(space->machine, "user1")[0x4000*((data>>4)&3)]);
|
||||
}
|
||||
|
||||
|
||||
@ -683,7 +683,7 @@ static DRIVER_INIT( cshooter )
|
||||
rom[0xa2] = 0x00;
|
||||
rom[0xa3] = 0x00;
|
||||
rom[0xa4] = 0x00;
|
||||
memory_set_bankptr(1,&memory_region(machine, "user1")[0]);
|
||||
memory_set_bankptr(machine, 1,&memory_region(machine, "user1")[0]);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( cshootre )
|
||||
@ -720,7 +720,7 @@ static DRIVER_INIT( cshootre )
|
||||
rom[A] = BITSWAP8(rom[A],7,6,1,4,3,2,5,0);
|
||||
}
|
||||
|
||||
memory_set_bankptr(1,&memory_region(machine, "user1")[0]);
|
||||
memory_set_bankptr(machine, 1,&memory_region(machine, "user1")[0]);
|
||||
seibu_sound_decrypt(machine,"audio",0x2000);
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ static WRITE32_HANDLER( aga_overlay_w )
|
||||
data = (data >> 16) & 1;
|
||||
|
||||
/* switch banks as appropriate */
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(space->machine, 1, data & 1);
|
||||
|
||||
/* swap the write handlers between ROM and bank 1 based on the bit */
|
||||
if ((data & 1) == 0)
|
||||
|
@ -99,7 +99,7 @@ static VIDEO_UPDATE( cultures )
|
||||
|
||||
static WRITE8_HANDLER( cpu_bankswitch_w )
|
||||
{
|
||||
memory_set_bankptr(1, memory_region(space->machine, "main") + 0x4000 * (data & 0xf));
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "main") + 0x4000 * (data & 0xf));
|
||||
video_enable = ~data & 0x20;
|
||||
}
|
||||
|
||||
|
@ -298,8 +298,8 @@ static UINT8 nmi_enable = 0;
|
||||
|
||||
static void reset_sound_region(running_machine *machine)
|
||||
{
|
||||
memory_set_bankptr( STATIC_BANK1, memory_region(machine, "audio") + (banknum * 0x8000) + 0x10000 );
|
||||
// memory_set_bankptr( 1, memory_region(machine, "audio") + (banknum * 0x8000) + 0x10000 );
|
||||
memory_set_bankptr(machine, STATIC_BANK1, memory_region(machine, "audio") + (banknum * 0x8000) + 0x10000 );
|
||||
// memory_set_bankptr(machine, 1, memory_region(machine, "audio") + (banknum * 0x8000) + 0x10000 );
|
||||
|
||||
}
|
||||
|
||||
@ -1220,7 +1220,7 @@ static MACHINE_RESET( darius )
|
||||
memcpy( RAM + 0x8000*i + 0x10000, RAM, 0x4000 );
|
||||
memcpy( RAM + 0x8000*i + 0x14000, RAM + 0x4000*i, 0x4000 );
|
||||
}
|
||||
memory_set_bankptr(1, RAM);
|
||||
memory_set_bankptr(machine, 1, RAM);
|
||||
|
||||
sound_global_enable( 1 ); /* mixer enabled */
|
||||
|
||||
|
@ -43,7 +43,7 @@ int darkmist_hw;
|
||||
static WRITE8_HANDLER(darkmist_hw_w)
|
||||
{
|
||||
darkmist_hw=data;
|
||||
memory_set_bankptr(1,&memory_region(space->machine, "main")[0x010000+((data&0x80)?0x4000:0)]);
|
||||
memory_set_bankptr(space->machine, 1,&memory_region(space->machine, "main")[0x010000+((data&0x80)?0x4000:0)]);
|
||||
}
|
||||
|
||||
static READ8_HANDLER(t5182shared_r)
|
||||
@ -457,7 +457,7 @@ static DRIVER_INIT(darkmist)
|
||||
}
|
||||
|
||||
memory_set_decrypted_region(space, 0x0000, 0x7fff, decrypt);
|
||||
memory_set_bankptr(1,&ROM[0x010000]);
|
||||
memory_set_bankptr(space->machine, 1,&ROM[0x010000]);
|
||||
|
||||
/* adr line swaps */
|
||||
ROM = memory_region(machine, "user1");
|
||||
|
@ -166,7 +166,7 @@ static WRITE8_HANDLER(bg2_w)
|
||||
bgadr = (bgadr & 0xfb) | ((data & 1)<<2);
|
||||
if(bgadr > 2)
|
||||
bgadr = 0;
|
||||
memory_set_bankptr( 1, memory_region(space->machine, "user1") + bgadr * 0x4000 );
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "user1") + bgadr * 0x4000 );
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( sound_w )
|
||||
@ -572,7 +572,7 @@ static DRIVER_INIT( ddayjlc )
|
||||
free(temp);
|
||||
}
|
||||
|
||||
memory_set_bankptr( 1, memory_region(machine, "user1") );
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "user1") );
|
||||
|
||||
}
|
||||
|
||||
|
@ -1828,11 +1828,11 @@ static WRITE8_HANDLER( rongrong_select_w )
|
||||
|
||||
//logerror("%04x: rongrong_select_w %02x\n",cpu_get_pc(space->cpu),data);
|
||||
/* bits 0-4 = **both** ROM bank **AND** input select */
|
||||
memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0x1f)]);
|
||||
memory_set_bankptr(space->machine, 1, &rom[0x10000 + 0x8000 * (data & 0x1f)]);
|
||||
ddenlovr_select = data;
|
||||
|
||||
/* bits 5-7 = RAM bank */
|
||||
memory_set_bankptr(2, &rom[0x110000 + 0x1000 * ((data & 0xe0) >> 5)]);
|
||||
memory_set_bankptr(space->machine, 2, &rom[0x110000 + 0x1000 * ((data & 0xe0) >> 5)]);
|
||||
}
|
||||
|
||||
|
||||
@ -1943,7 +1943,7 @@ static READ8_HANDLER( magic_r )
|
||||
static WRITE8_HANDLER( mmpanic_rombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main");
|
||||
memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0x7)]);
|
||||
memory_set_bankptr(space->machine, 1, &rom[0x10000 + 0x8000 * (data & 0x7)]);
|
||||
/* Bit 4? */
|
||||
}
|
||||
|
||||
@ -2129,9 +2129,9 @@ static WRITE8_HANDLER( funkyfig_rombank_w )
|
||||
|
||||
ddenlovr_select = data;
|
||||
|
||||
memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0x0f)]);
|
||||
memory_set_bankptr(space->machine, 1, &rom[0x10000 + 0x8000 * (data & 0x0f)]);
|
||||
// bit 4 selects palette ram at 8000?
|
||||
memory_set_bankptr(2, &rom[0x90000 + 0x1000 * ((data & 0xe0) >> 5)]);
|
||||
memory_set_bankptr(space->machine, 2, &rom[0x90000 + 0x1000 * ((data & 0xe0) >> 5)]);
|
||||
}
|
||||
|
||||
static READ8_HANDLER( funkyfig_dsw_r )
|
||||
@ -2240,9 +2240,9 @@ static WRITE8_HANDLER( hanakanz_rombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main");
|
||||
|
||||
memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0x0f)]);
|
||||
memory_set_bankptr(space->machine, 1, &rom[0x10000 + 0x8000 * (data & 0x0f)]);
|
||||
|
||||
memory_set_bankptr(2, &rom[0x90000 + 0x1000 * ((data & 0xf0) >> 4)]);
|
||||
memory_set_bankptr(space->machine, 2, &rom[0x90000 + 0x1000 * ((data & 0xf0) >> 4)]);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( hanakanz_readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
@ -2623,7 +2623,7 @@ ADDRESS_MAP_END
|
||||
static WRITE8_HANDLER( mjmyster_rambank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main");
|
||||
memory_set_bankptr(2, &rom[0x90000 + 0x1000 * (data & 0x07)]);
|
||||
memory_set_bankptr(space->machine, 2, &rom[0x90000 + 0x1000 * (data & 0x07)]);
|
||||
// logerror("%04x: rambank = %02x\n", cpu_get_pc(space->cpu), data);
|
||||
}
|
||||
|
||||
@ -2740,7 +2740,7 @@ static UINT8 hginga_rombank;
|
||||
static WRITE8_HANDLER( hginga_rombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main");
|
||||
memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0x7)]);
|
||||
memory_set_bankptr(space->machine, 1, &rom[0x10000 + 0x8000 * (data & 0x7)]);
|
||||
hginga_rombank = data;
|
||||
}
|
||||
|
||||
@ -3036,8 +3036,8 @@ static WRITE8_HANDLER( hparadis_select_w )
|
||||
ddenlovr_select = data;
|
||||
hginga_ip = 0;
|
||||
|
||||
memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0x07)]);
|
||||
memory_set_bankptr(2, &rom[0x50000 + 0x1000 * ((data & 0xe0) >> 5)]);
|
||||
memory_set_bankptr(space->machine, 1, &rom[0x10000 + 0x8000 * (data & 0x07)]);
|
||||
memory_set_bankptr(space->machine, 2, &rom[0x50000 + 0x1000 * ((data & 0xe0) >> 5)]);
|
||||
}
|
||||
|
||||
|
||||
@ -3273,7 +3273,7 @@ ADDRESS_MAP_END
|
||||
static WRITE8_HANDLER( mjflove_rombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main");
|
||||
memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0xf)]);
|
||||
memory_set_bankptr(space->machine, 1, &rom[0x10000 + 0x8000 * (data & 0xf)]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( mjflove_okibank_w )
|
||||
|
@ -223,7 +223,7 @@ static WRITE8_HANDLER( ddragon_bankswitch_w )
|
||||
else if (dd_sub_cpu_busy == 0)
|
||||
cpu_set_input_line(space->machine->cpu[1], sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
|
||||
|
||||
memory_set_bank(1, (data & 0xe0) >> 5);
|
||||
memory_set_bank(space->machine, 1, (data & 0xe0) >> 5);
|
||||
}
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ static WRITE8_HANDLER( toffy_bankswitch_w )
|
||||
/* bit 3 unknown */
|
||||
|
||||
/* I don't know ... */
|
||||
memory_set_bank(1, (data & 0x20) >> 5);
|
||||
memory_set_bank(space->machine, 1, (data & 0x20) >> 5);
|
||||
}
|
||||
|
||||
|
||||
@ -283,7 +283,7 @@ static WRITE8_HANDLER( darktowr_mcu_bank_w )
|
||||
|
||||
static WRITE8_HANDLER( darktowr_bankswitch_w )
|
||||
{
|
||||
int oldbank = memory_get_bank(1);
|
||||
int oldbank = memory_get_bank(space->machine, 1);
|
||||
int newbank = (data & 0xe0) >> 5;
|
||||
|
||||
ddragon_scrollx_hi = ((data & 0x01) << 8);
|
||||
@ -298,7 +298,7 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
|
||||
else if (dd_sub_cpu_busy == 0)
|
||||
cpu_set_input_line(space->machine->cpu[1], sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
|
||||
|
||||
memory_set_bank(1, newbank);
|
||||
memory_set_bank(space->machine, 1, newbank);
|
||||
if (newbank == 4 && oldbank != 4)
|
||||
memory_install_readwrite8_handler(space, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w);
|
||||
else if (newbank != 4 && oldbank == 4)
|
||||
|
@ -57,7 +57,7 @@ static WRITE8_HANDLER( ddrible_bankswitch_w )
|
||||
UINT8 *RAM = memory_region(space->machine, "main");
|
||||
|
||||
bankaddress = 0x10000 + (data & 0x0f)*0x2000;
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -346,7 +346,7 @@ static WRITE8_HANDLER( dec8_bank_w )
|
||||
UINT8 *RAM = memory_region(space->machine, "main");
|
||||
|
||||
bankaddress = 0x10000 + (data & 0x0f) * 0x4000;
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
}
|
||||
|
||||
/* Used by Ghostbusters, Meikyuu Hunter G & Gondomania */
|
||||
@ -363,7 +363,7 @@ static WRITE8_HANDLER( ghostb_bank_w )
|
||||
*/
|
||||
|
||||
bankaddress = 0x10000 + (data >> 4) * 0x4000;
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
|
||||
if (data&1) int_enable=1; else int_enable=0;
|
||||
if (data&2) nmi_enable=1; else nmi_enable=0;
|
||||
@ -381,7 +381,7 @@ static WRITE8_HANDLER( csilver_control_w )
|
||||
Bit 0x40 - Unused.
|
||||
Bit 0x80 - Hold subcpu reset line high if clear, else low? (Not needed anyway)
|
||||
*/
|
||||
memory_set_bankptr(1,&RAM[0x10000 + (data & 0x0f) * 0x4000]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[0x10000 + (data & 0x0f) * 0x4000]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( dec8_sound_w )
|
||||
@ -423,8 +423,8 @@ static WRITE8_HANDLER( csilver_sound_bank_w )
|
||||
{
|
||||
UINT8 *RAM = memory_region(space->machine, "audio");
|
||||
|
||||
if (data&8) { memory_set_bankptr(3,&RAM[0x14000]); }
|
||||
else { memory_set_bankptr(3,&RAM[0x10000]); }
|
||||
if (data&8) { memory_set_bankptr(space->machine, 3,&RAM[0x14000]); }
|
||||
else { memory_set_bankptr(space->machine, 3,&RAM[0x10000]); }
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -1139,7 +1139,7 @@ static DRIVER_INIT( decocrom )
|
||||
memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "user3"), 0);
|
||||
memory_configure_bank_decrypted(machine, 1, 0, 1, &decrypted[0x6000], 0);
|
||||
memory_configure_bank_decrypted(machine, 1, 1, 1, decrypted2, 0);
|
||||
memory_set_bank(1, 0);
|
||||
memory_set_bank(machine, 1, 0);
|
||||
|
||||
/* install the bank selector */
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe900, 0xe900, 0, 0, decocass_e900_w);
|
||||
|
@ -170,7 +170,7 @@ void discoboy_setrombank(UINT8 data)
|
||||
{
|
||||
UINT8 *ROM = memory_region(machine, "main");
|
||||
data &=0x2f;
|
||||
memory_set_bankptr(1, &ROM[0x6000+(data*0x1000)] );
|
||||
memory_set_bankptr(space->machine, 1, &ROM[0x6000+(data*0x1000)] );
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -197,7 +197,7 @@ static WRITE8_HANDLER( discoboy_port_01_w )
|
||||
discoboy_gfxbank = data&0xf0;
|
||||
rombank = data&0x07;
|
||||
|
||||
memory_set_bankptr(1, &ROM[0x10000 + rombank * 0x4000] );
|
||||
memory_set_bankptr(space->machine, 1, &ROM[0x10000 + rombank * 0x4000] );
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( discoboy_port_03_w ) // sfx? (to sound cpu)
|
||||
@ -525,7 +525,7 @@ static DRIVER_INIT( discoboy )
|
||||
|
||||
discoboy_ram_bank = 0;
|
||||
|
||||
memory_set_bankptr(1, &ROM[0x10000] );
|
||||
memory_set_bankptr(machine, 1, &ROM[0x10000] );
|
||||
}
|
||||
|
||||
ROM_START( discoboy )
|
||||
|
@ -664,7 +664,7 @@ static WRITE8_HANDLER( cpu0_bankswitch_w )
|
||||
{
|
||||
unsigned char *RAM = memory_region(space->machine, "main");
|
||||
data ^= bankxor;
|
||||
memory_set_bankptr(4,&RAM[0x10000]); /* unsure if/how this area is banked */
|
||||
memory_set_bankptr(space->machine, 4,&RAM[0x10000]); /* unsure if/how this area is banked */
|
||||
if( data < 4 )
|
||||
{
|
||||
RAM = &RAM[0x2000 * data];
|
||||
@ -673,7 +673,7 @@ static WRITE8_HANDLER( cpu0_bankswitch_w )
|
||||
{
|
||||
RAM = &RAM[0x10000 + 0x2000 * (data-4)];
|
||||
}
|
||||
memory_set_bankptr(1,RAM);
|
||||
memory_set_bankptr(space->machine, 1,RAM);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
@ -691,20 +691,20 @@ static WRITE8_HANDLER( cpu1_bankswitch_w )
|
||||
switch( data&0xf )
|
||||
{
|
||||
/* bs65.5y */
|
||||
case 0x00: memory_set_bankptr(2,&RAM[0x00000]); break;
|
||||
case 0x01: memory_set_bankptr(2,&RAM[0x04000]); break;
|
||||
case 0x02: memory_set_bankptr(2,&RAM[0x10000]); break;
|
||||
case 0x03: memory_set_bankptr(2,&RAM[0x14000]); break;
|
||||
case 0x00: memory_set_bankptr(space->machine, 2,&RAM[0x00000]); break;
|
||||
case 0x01: memory_set_bankptr(space->machine, 2,&RAM[0x04000]); break;
|
||||
case 0x02: memory_set_bankptr(space->machine, 2,&RAM[0x10000]); break;
|
||||
case 0x03: memory_set_bankptr(space->machine, 2,&RAM[0x14000]); break;
|
||||
|
||||
/* bs101.6w */
|
||||
case 0x08: memory_set_bankptr(2,&RAM[0x18000]); break;
|
||||
case 0x09: memory_set_bankptr(2,&RAM[0x1c000]); break;
|
||||
case 0x0a: memory_set_bankptr(2,&RAM[0x20000]); break;
|
||||
case 0x0b: memory_set_bankptr(2,&RAM[0x24000]); break;
|
||||
case 0x0c: memory_set_bankptr(2,&RAM[0x28000]); break;
|
||||
case 0x0d: memory_set_bankptr(2,&RAM[0x2c000]); break;
|
||||
case 0x0e: memory_set_bankptr(2,&RAM[0x30000]); break;
|
||||
case 0x0f: memory_set_bankptr(2,&RAM[0x34000]); break;
|
||||
case 0x08: memory_set_bankptr(space->machine, 2,&RAM[0x18000]); break;
|
||||
case 0x09: memory_set_bankptr(space->machine, 2,&RAM[0x1c000]); break;
|
||||
case 0x0a: memory_set_bankptr(space->machine, 2,&RAM[0x20000]); break;
|
||||
case 0x0b: memory_set_bankptr(space->machine, 2,&RAM[0x24000]); break;
|
||||
case 0x0c: memory_set_bankptr(space->machine, 2,&RAM[0x28000]); break;
|
||||
case 0x0d: memory_set_bankptr(space->machine, 2,&RAM[0x2c000]); break;
|
||||
case 0x0e: memory_set_bankptr(space->machine, 2,&RAM[0x30000]); break;
|
||||
case 0x0f: memory_set_bankptr(space->machine, 2,&RAM[0x34000]); break;
|
||||
|
||||
default:
|
||||
break;
|
||||
@ -731,7 +731,7 @@ static WRITE8_HANDLER( cpu2_bankswitch_w )
|
||||
{
|
||||
RAM = &RAM[0x10000 + 0x4000*(data-3)];
|
||||
}
|
||||
memory_set_bankptr(3,RAM);
|
||||
memory_set_bankptr(space->machine, 3,RAM);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -470,7 +470,7 @@ static MACHINE_RESET( strtheat )
|
||||
/* The initial state of the counter is 0x08 */
|
||||
memory_configure_bank(machine, 1, 0, 4, &ROM[0x10000], 0x4000);
|
||||
state->decrypt_counter = 0x08;
|
||||
memory_set_bank(1, 0);
|
||||
memory_set_bank(machine, 1, 0);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( drakton )
|
||||
@ -483,7 +483,7 @@ static MACHINE_RESET( drakton )
|
||||
/* The initial state of the counter is 0x09 */
|
||||
memory_configure_bank(machine, 1, 0, 4, &ROM[0x10000], 0x4000);
|
||||
state->decrypt_counter = 0x09;
|
||||
memory_set_bank(1, 1);
|
||||
memory_set_bank(machine, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -633,10 +633,10 @@ static READ8_HANDLER( epos_decrypt_rom )
|
||||
|
||||
switch(state->decrypt_counter)
|
||||
{
|
||||
case 0x08: memory_set_bank(1, 0); break;
|
||||
case 0x09: memory_set_bank(1, 1); break;
|
||||
case 0x0A: memory_set_bank(1, 2); break;
|
||||
case 0x0B: memory_set_bank(1, 3); break;
|
||||
case 0x08: memory_set_bank(space->machine, 1, 0); break;
|
||||
case 0x09: memory_set_bank(space->machine, 1, 1); break;
|
||||
case 0x0A: memory_set_bank(space->machine, 1, 2); break;
|
||||
case 0x0B: memory_set_bank(space->machine, 1, 3); break;
|
||||
default:
|
||||
logerror("Invalid counter = %02X\n",state->decrypt_counter);
|
||||
break;
|
||||
|
@ -59,7 +59,7 @@ Flying Tiger
|
||||
|
||||
static WRITE8_HANDLER( lastday_bankswitch_w )
|
||||
{
|
||||
memory_set_bank(1, data & 0x07);
|
||||
memory_set_bank(space->machine, 1, data & 0x07);
|
||||
|
||||
if (data & 0xf8) popmessage("bankswitch %02x",data);
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ static READ8_HANDLER( dunhuang_input_r )
|
||||
static WRITE8_HANDLER( dunhuang_rombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main");
|
||||
memory_set_bankptr( 1, rom + 0x10000 + 0x8000 * ((data >> 2) & 0x7) );
|
||||
memory_set_bankptr(space->machine, 1, rom + 0x10000 + 0x8000 * ((data >> 2) & 0x7) );
|
||||
|
||||
// ? data & 0x01
|
||||
// ? data & 0x02
|
||||
|
@ -269,13 +269,13 @@ static WRITE8_HANDLER( hanamai_keyboard_w )
|
||||
static WRITE8_HANDLER( dynax_rombank_w )
|
||||
{
|
||||
UINT8 *ROM = memory_region(space->machine, "main");
|
||||
memory_set_bankptr(1,&ROM[0x08000+0x8000*(data & 0x0f)]);
|
||||
memory_set_bankptr(space->machine, 1,&ROM[0x08000+0x8000*(data & 0x0f)]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( jantouki_sound_rombank_w )
|
||||
{
|
||||
UINT8 *ROM = memory_region(space->machine, "sound");
|
||||
memory_set_bankptr(2,&ROM[0x08000+0x8000*data]);
|
||||
memory_set_bankptr(space->machine, 2,&ROM[0x08000+0x8000*data]);
|
||||
}
|
||||
|
||||
|
||||
@ -285,7 +285,7 @@ static WRITE8_HANDLER( hnoridur_rombank_w )
|
||||
{
|
||||
UINT8 *ROM = memory_region(space->machine, "main") + 0x10000 + 0x8000*data;
|
||||
//logerror("%04x: rom bank = %02x\n",cpu_get_pc(space->cpu),data);
|
||||
memory_set_bankptr(1,ROM);
|
||||
memory_set_bankptr(space->machine, 1,ROM);
|
||||
hnoridur_bank = data;
|
||||
}
|
||||
|
||||
@ -655,7 +655,7 @@ static READ8_HANDLER( yarunara_input_r )
|
||||
static WRITE8_HANDLER( yarunara_rombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main") + 0x10000 + 0x8000 * data;
|
||||
memory_set_bankptr(1, rom);
|
||||
memory_set_bankptr(space->machine, 1, rom);
|
||||
|
||||
hnoridur_bank = data;
|
||||
}
|
||||
@ -877,7 +877,7 @@ static READ8_HANDLER( jantouki_blitter_busy_r )
|
||||
static WRITE8_HANDLER( jantouki_rombank_w )
|
||||
{
|
||||
UINT8 *ROM = memory_region(space->machine, "main");
|
||||
memory_set_bankptr(1,&ROM[0x8000 + 0x8000*(data&0x0f)]);
|
||||
memory_set_bankptr(space->machine, 1,&ROM[0x8000 + 0x8000*(data&0x0f)]);
|
||||
set_led_status(0,data & 0x10); // maybe
|
||||
}
|
||||
|
||||
@ -1098,7 +1098,7 @@ static READ8_HANDLER( htengoku_coin_r )
|
||||
static WRITE8_HANDLER( htengoku_rombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main") + 0x10000 + 0x8000 * (data & 0x7);
|
||||
memory_set_bankptr(1, rom);
|
||||
memory_set_bankptr(space->machine, 1, rom);
|
||||
|
||||
hnoridur_bank = data;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ static WRITE8_HANDLER( dealer_decrypt_rom )
|
||||
|
||||
// logerror("PC %08x: ctr=%04x\n",cpu_get_pc(space->cpu),counter);
|
||||
|
||||
memory_set_bankptr(1, rom + 0x10000 * counter);
|
||||
memory_set_bankptr(space->machine, 1, rom + 0x10000 * counter);
|
||||
|
||||
// is the 2nd bank changed by the counter or it always uses the 1st key?
|
||||
}
|
||||
@ -116,7 +116,7 @@ ADDRESS_MAP_END
|
||||
static WRITE8_DEVICE_HANDLER( write_prtc )
|
||||
{
|
||||
UINT8 *rom = memory_region(device->machine, "main");
|
||||
memory_set_bankptr(2, rom + 0x6000 + (0x1000 * (data & 1)));
|
||||
memory_set_bankptr(device->machine, 2, rom + 0x6000 + (0x1000 * (data & 1)));
|
||||
}
|
||||
|
||||
static const ppi8255_interface ppi8255_intf =
|
||||
@ -594,8 +594,8 @@ static MACHINE_RESET( dealer )
|
||||
{
|
||||
UINT8 *rom = memory_region(machine, "main");
|
||||
counter = 0;
|
||||
memory_set_bankptr(1, rom);
|
||||
memory_set_bankptr(2, rom + 0x6000);
|
||||
memory_set_bankptr(machine, 1, rom);
|
||||
memory_set_bankptr(machine, 2, rom + 0x6000);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( dealer )
|
||||
|
@ -280,7 +280,7 @@ static WRITE8_HANDLER( esd16_sound_rombank_w )
|
||||
int bank = data & 0xf;
|
||||
if (data != bank) logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(space->cpu),data);
|
||||
if (bank >= 3) bank += 1;
|
||||
memory_set_bankptr(1, memory_region(space->machine, "audio") + 0x4000 * bank);
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "audio") + 0x4000 * bank);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( multchmp_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
|
@ -174,7 +174,7 @@ static WRITE8_HANDLER( fax_bank_select_w )
|
||||
{
|
||||
UINT8 *RAM = memory_region(space->machine, "main");
|
||||
|
||||
memory_set_bankptr(1, &RAM[0x10000 + (0x2000 * (data & 0x1f))]);
|
||||
memory_set_bankptr(space->machine, 1, &RAM[0x10000 + (0x2000 * (data & 0x1f))]);
|
||||
if ((data & 0x1f) > 0x17)
|
||||
logerror("Banking to unpopulated ROM bank %02X!\n",data & 0x1f);
|
||||
}
|
||||
@ -1372,7 +1372,7 @@ static DRIVER_INIT( phantoma )
|
||||
|
||||
/* the ROM is actually mapped high */
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf800, 0xffff, 0, 0, SMH_BANK1);
|
||||
memory_set_bankptr(1, memory_region(machine, "main") + 0xf800);
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "main") + 0xf800);
|
||||
}
|
||||
|
||||
|
||||
|
@ -316,7 +316,7 @@ void exidy440_bank_select(running_machine *machine, UINT8 bank)
|
||||
|
||||
/* select the bank and update the bank pointer */
|
||||
exidy440_bank = bank;
|
||||
memory_set_bankptr(1, &memory_region(machine, "main")[0x10000 + exidy440_bank * 0x4000]);
|
||||
memory_set_bankptr(machine, 1, &memory_region(machine, "main")[0x10000 + exidy440_bank * 0x4000]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ static WRITE8_HANDLER( exzisus_cpua_bankswitch_w )
|
||||
exzisus_cpua_bank = data & 0x0f;
|
||||
if (exzisus_cpua_bank >= 2)
|
||||
{
|
||||
memory_set_bankptr( 2, &RAM[ 0x10000 + ( (exzisus_cpua_bank - 2) * 0x4000 ) ] );
|
||||
memory_set_bankptr(space->machine, 2, &RAM[ 0x10000 + ( (exzisus_cpua_bank - 2) * 0x4000 ) ] );
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ static WRITE8_HANDLER( exzisus_cpub_bankswitch_w )
|
||||
exzisus_cpub_bank = data & 0x0f;
|
||||
if (exzisus_cpub_bank >= 2)
|
||||
{
|
||||
memory_set_bankptr( 1, &RAM[ 0x10000 + ( (exzisus_cpub_bank - 2) * 0x4000 ) ] );
|
||||
memory_set_bankptr(space->machine, 1, &RAM[ 0x10000 + ( (exzisus_cpub_bank - 2) * 0x4000 ) ] );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ static WRITE8_HANDLER( f1gp_sh_bankswitch_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "audio") + 0x10000;
|
||||
|
||||
memory_set_bankptr(1,rom + (data & 0x01) * 0x8000);
|
||||
memory_set_bankptr(space->machine, 1,rom + (data & 0x01) * 0x8000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,7 +57,7 @@ static WRITE8_HANDLER( fastlane_bankswitch_w )
|
||||
|
||||
/* bits 2 & 3 = bank number */
|
||||
bankaddress = 0x10000 + ((data & 0x0c) >> 2) * 0x4000;
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
|
||||
/* bit 4: bank # for the 007232 (chip 2) */
|
||||
k007232_set_bank(1,0 + ((data & 0x10) >> 4),2 + ((data & 0x10) >> 4));
|
||||
|
@ -60,7 +60,7 @@ static WRITE8_HANDLER( fcrash_snd_bankswitch_w )
|
||||
sndti_set_output_gain(SOUND_MSM5205, 1, 0, (data & 0x10) ? 0.0 : 1.0);
|
||||
|
||||
bankaddr = ((data & 7) * 0x4000);
|
||||
memory_set_bankptr(1,&RAM[0x10000 + bankaddr]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[0x10000 + bankaddr]);
|
||||
}
|
||||
|
||||
static void m5205_int1(running_machine *machine, int data)
|
||||
|
@ -388,7 +388,7 @@ static WRITE8_HANDLER( disk_iobank_w )
|
||||
if (newbank != bank)
|
||||
{
|
||||
bank = newbank;
|
||||
memory_set_bankptr( 1,memory_region(space->machine, "user1") + 0x10000 * bank );
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "user1") + 0x10000 * bank );
|
||||
}
|
||||
|
||||
lastvalue = data;
|
||||
|
@ -144,27 +144,27 @@ static READ8_HANDLER( catchall )
|
||||
|
||||
static WRITE8_HANDLER( banksel_main_w )
|
||||
{
|
||||
memory_set_bankptr(1,memory_region(space->machine, "main") + 0x8000);
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "main") + 0x8000);
|
||||
}
|
||||
static WRITE8_HANDLER( banksel_1_w )
|
||||
{
|
||||
memory_set_bankptr(1,memory_region(space->machine, "main") + 0x10000);
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "main") + 0x10000);
|
||||
}
|
||||
static WRITE8_HANDLER( banksel_2_w )
|
||||
{
|
||||
memory_set_bankptr(1,memory_region(space->machine, "main") + 0x18000);
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "main") + 0x18000);
|
||||
}
|
||||
static WRITE8_HANDLER( banksel_3_w )
|
||||
{
|
||||
memory_set_bankptr(1,memory_region(space->machine, "main") + 0x20000);
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "main") + 0x20000);
|
||||
}
|
||||
static WRITE8_HANDLER( banksel_4_w )
|
||||
{
|
||||
memory_set_bankptr(1,memory_region(space->machine, "main") + 0x28000);
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "main") + 0x28000);
|
||||
}
|
||||
static WRITE8_HANDLER( banksel_5_w )
|
||||
{
|
||||
memory_set_bankptr(1,memory_region(space->machine, "main") + 0x30000);
|
||||
memory_set_bankptr(space->machine, 1,memory_region(space->machine, "main") + 0x30000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -388,7 +388,7 @@ static WRITE8_HANDLER( novram_store_w )
|
||||
|
||||
static WRITE8_HANDLER( rom_bank_w )
|
||||
{
|
||||
memory_set_bank(1, data & 0x1f);
|
||||
memory_set_bank(space->machine, 1, data & 0x1f);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( main_irq_clear_w )
|
||||
|
@ -93,7 +93,7 @@ static WRITE8_HANDLER( firetrap_bankselect_w )
|
||||
UINT8 *RAM = memory_region(space->machine, "main");
|
||||
|
||||
bankaddress = 0x10000 + (data & 0x03) * 0x4000;
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
}
|
||||
|
||||
static READ8_HANDLER( firetrap_8751_bootleg_r )
|
||||
@ -215,7 +215,7 @@ static WRITE8_HANDLER( firetrap_sound_bankselect_w )
|
||||
UINT8 *RAM = memory_region(space->machine, "audio");
|
||||
|
||||
bankaddress = 0x10000 + (data & 0x01) * 0x4000;
|
||||
memory_set_bankptr(2,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 2,&RAM[bankaddress]);
|
||||
}
|
||||
|
||||
static int msm5205next;
|
||||
|
@ -52,7 +52,7 @@ static WRITE8_HANDLER( flkatck_bankswitch_w )
|
||||
/* bits 0-1: bank # */
|
||||
bankaddress += 0x10000 + (data & 0x03)*0x2000;
|
||||
if ((data & 0x03) != 0x03) /* for safety */
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
|
||||
}
|
||||
|
||||
static READ8_HANDLER( flkatck_ls138_r )
|
||||
|
@ -86,7 +86,7 @@ static WRITE8_HANDLER( rom_bank_w )
|
||||
|
||||
bank = new_bank;
|
||||
bankaddress = 0x10000 + 0x40 * bank;
|
||||
memory_set_bankptr(1, &ROM[bankaddress]);
|
||||
memory_set_bankptr(space->machine, 1, &ROM[bankaddress]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ static MACHINE_RESET( pbillrd )
|
||||
|
||||
static WRITE8_HANDLER( pbillrd_bankswitch_w )
|
||||
{
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(space->machine, 1, data & 1);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( nmi_enable_w )
|
||||
|
@ -247,11 +247,11 @@ static WRITE8_HANDLER( fromanc2_subcpu_rombank_w )
|
||||
int rambank = (data & 0x0c) >> 2;
|
||||
|
||||
// Change ROM BANK
|
||||
memory_set_bankptr(1, &RAM[rombank * 0x4000]);
|
||||
memory_set_bankptr(space->machine, 1, &RAM[rombank * 0x4000]);
|
||||
|
||||
// Change RAM BANK
|
||||
if (rambank != 0) memory_set_bankptr(2, &RAM[0x10000 + (rambank * 0x4000)]);
|
||||
else memory_set_bankptr(2, &RAM[0x8000]);
|
||||
if (rambank != 0) memory_set_bankptr(space->machine, 2, &RAM[0x10000 + (rambank * 0x4000)]);
|
||||
else memory_set_bankptr(space->machine, 2, &RAM[0x8000]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -137,7 +137,7 @@ static WRITE8_HANDLER( fromance_rombank_w )
|
||||
{
|
||||
UINT8 *ROM = memory_region(space->machine, "sub");
|
||||
|
||||
memory_set_bankptr(1, &ROM[0x010000 + (0x4000 * data)]);
|
||||
memory_set_bankptr(space->machine, 1, &ROM[0x010000 + (0x4000 * data)]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,16 +63,16 @@ VIDEO_UPDATE(funybubl);
|
||||
static WRITE8_HANDLER ( funybubl_vidram_bank_w )
|
||||
{
|
||||
if ((data&1) == 0)
|
||||
memory_set_bankptr(1,&funybubl_banked_videoram[0x000000]);
|
||||
memory_set_bankptr(space->machine, 1,&funybubl_banked_videoram[0x000000]);
|
||||
else
|
||||
memory_set_bankptr(1,&funybubl_banked_videoram[0x001000]);
|
||||
memory_set_bankptr(space->machine, 1,&funybubl_banked_videoram[0x001000]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER ( funybubl_cpurombank_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "main");
|
||||
|
||||
memory_set_bankptr(2,&rom[0x10000+0x4000*(data&0x3f)]);
|
||||
memory_set_bankptr(space->machine, 2,&rom[0x10000+0x4000*(data&0x3f)]);
|
||||
}
|
||||
|
||||
|
||||
@ -229,7 +229,7 @@ static DRIVER_INIT( funybubl )
|
||||
{
|
||||
funybubl_banked_videoram = auto_malloc (0x2000);
|
||||
|
||||
memory_set_bankptr(1,&funybubl_banked_videoram[0x000000]);
|
||||
memory_set_bankptr(machine, 1,&funybubl_banked_videoram[0x000000]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,7 +130,7 @@ ADDRESS_MAP_END
|
||||
static WRITE8_HANDLER( fuuki16_sound_rombank_w )
|
||||
{
|
||||
if (data <= 2)
|
||||
memory_set_bankptr(1, memory_region(space->machine, "audio") + 0x8000 * data + 0x10000);
|
||||
memory_set_bankptr(space->machine, 1, memory_region(space->machine, "audio") + 0x8000 * data + 0x10000);
|
||||
else
|
||||
logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(space->cpu),data);
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ static WRITE8_HANDLER ( fuuki32_sound_bw_w )
|
||||
{
|
||||
UINT8 *rom = memory_region(space->machine, "sound");
|
||||
|
||||
memory_set_bankptr(1, rom + 0x10000 + (data * 0x8000));
|
||||
memory_set_bankptr(space->machine, 1, rom + 0x10000 + (data * 0x8000));
|
||||
}
|
||||
|
||||
static READ8_HANDLER( snd_z80_r )
|
||||
|
@ -201,7 +201,7 @@ static MACHINE_RESET( common )
|
||||
adsp_autobuffer_timer = timer_alloc(adsp_autobuffer_irq, NULL);
|
||||
|
||||
memory_configure_bank(machine, 1, 0, 256, memory_region(machine, "user1"), 0x4000);
|
||||
memory_set_bank(1, 0);
|
||||
memory_set_bank(machine, 1, 0);
|
||||
|
||||
/* keep the TMS32031 halted until the code is ready to go */
|
||||
cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
|
||||
@ -531,7 +531,7 @@ static WRITE16_HANDLER( adsp_control_w )
|
||||
static WRITE16_HANDLER( adsp_rombank_w )
|
||||
{
|
||||
logerror("adsp_rombank_w(%d) = %04X\n", offset, data);
|
||||
memory_set_bank(1, (offset & 1) * 0x80 + (data & 0x7f));
|
||||
memory_set_bank(space->machine, 1, (offset & 1) * 0x80 + (data & 0x7f));
|
||||
}
|
||||
|
||||
|
||||
|
@ -808,7 +808,7 @@ static INPUT_CHANGED( gmgalax_game_changed )
|
||||
gmgalax_selected_game = newval;
|
||||
|
||||
/* select the bank and graphics bank based on it */
|
||||
memory_set_bank(1, gmgalax_selected_game);
|
||||
memory_set_bank(field->port->machine, 1, gmgalax_selected_game);
|
||||
galaxian_gfxbank_w(space, 0, gmgalax_selected_game);
|
||||
|
||||
/* reset the starts */
|
||||
@ -837,8 +837,8 @@ static CUSTOM_INPUT( gmgalax_port_r )
|
||||
|
||||
static WRITE8_HANDLER( zigzag_bankswap_w )
|
||||
{
|
||||
memory_set_bank(1, data & 1);
|
||||
memory_set_bank(2, ~data & 1);
|
||||
memory_set_bank(space->machine, 1, data & 1);
|
||||
memory_set_bank(space->machine, 2, ~data & 1);
|
||||
}
|
||||
|
||||
|
||||
@ -2385,7 +2385,7 @@ static DRIVER_INIT( frogg )
|
||||
|
||||
/* ...but needs a full 2k of RAM */
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4000, 0x47ff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
memory_set_bankptr(1, auto_malloc(0x800));
|
||||
memory_set_bankptr(machine, 1, auto_malloc(0x800));
|
||||
}
|
||||
|
||||
|
||||
@ -2568,11 +2568,11 @@ static DRIVER_INIT( skybase )
|
||||
|
||||
/* needs a full 2k of RAM */
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
memory_set_bankptr(1, auto_malloc(0x800));
|
||||
memory_set_bankptr(machine, 1, auto_malloc(0x800));
|
||||
|
||||
/* extend ROM */
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, SMH_BANK2);
|
||||
memory_set_bankptr(2, memory_region(machine, "main"));
|
||||
memory_set_bankptr(machine, 2, memory_region(machine, "main"));
|
||||
}
|
||||
|
||||
|
||||
@ -2628,11 +2628,11 @@ static DRIVER_INIT( scorpnmc )
|
||||
|
||||
/* extra ROM */
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x5000, 0x67ff, 0, 0, SMH_BANK1);
|
||||
memory_set_bankptr(1, memory_region(machine, "main") + 0x5000);
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "main") + 0x5000);
|
||||
|
||||
/* install RAM at $4000-$4800 */
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4000, 0x47ff, 0, 0, SMH_BANK2, SMH_BANK2);
|
||||
memory_set_bankptr(2, auto_malloc(0x800));
|
||||
memory_set_bankptr(machine, 2, auto_malloc(0x800));
|
||||
|
||||
/* doesn't appear to use original RAM */
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x87ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
@ -2690,7 +2690,7 @@ static DRIVER_INIT( sfx )
|
||||
|
||||
/* sound board has space for extra ROM */
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1);
|
||||
memory_set_bankptr(1, memory_region(machine, "audio"));
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "audio"));
|
||||
}
|
||||
|
||||
|
||||
@ -2744,7 +2744,7 @@ static DRIVER_INIT( froggrmc )
|
||||
|
||||
/* actually needs 2k of RAM */
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
memory_set_bankptr(1, auto_malloc(0x800));
|
||||
memory_set_bankptr(machine, 1, auto_malloc(0x800));
|
||||
|
||||
/* decrypt */
|
||||
decode_frogger_sound(machine);
|
||||
@ -2787,7 +2787,7 @@ static DRIVER_INIT( scorpion )
|
||||
|
||||
/* extra ROM */
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x5800, 0x67ff, 0, 0, SMH_BANK1);
|
||||
memory_set_bankptr(1, memory_region(machine, "main") + 0x5800);
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "main") + 0x5800);
|
||||
|
||||
/* no background related */
|
||||
// memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6803, 0x6803, 0, 0, SMH_NOP);
|
||||
|
@ -52,7 +52,7 @@ static MACHINE_RESET( galivan )
|
||||
{
|
||||
UINT8 *RAM = memory_region(machine, "main");
|
||||
|
||||
memory_set_bankptr(1,&RAM[0x10000]);
|
||||
memory_set_bankptr(machine, 1,&RAM[0x10000]);
|
||||
// layers = 0x60;
|
||||
}
|
||||
|
||||
@ -957,11 +957,11 @@ static WRITE8_HANDLER( youmab_extra_bank_w )
|
||||
{
|
||||
if (data==0xff)
|
||||
{
|
||||
memory_set_bankptr( 2, memory_region(space->machine, "user2")+0x4000 );
|
||||
memory_set_bankptr(space->machine, 2, memory_region(space->machine, "user2")+0x4000 );
|
||||
}
|
||||
else if (data==0x00)
|
||||
{
|
||||
memory_set_bankptr( 2, memory_region(space->machine, "user2") );
|
||||
memory_set_bankptr(space->machine, 2, memory_region(space->machine, "user2") );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -988,7 +988,7 @@ static DRIVER_INIT( youmab )
|
||||
{
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x82, 0x82, 0, 0, youmab_extra_bank_w); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0, SMH_BANK2);
|
||||
memory_set_bankptr( 2, memory_region(machine, "user2") );
|
||||
memory_set_bankptr(machine, 2, memory_region(machine, "user2") );
|
||||
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x81, 0x81, 0, 0, youmab_81_w); // ?? often, alternating values
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x84, 0x84, 0, 0, youmab_84_w); // ?? often, sequence..
|
||||
|
@ -193,11 +193,11 @@ static void mxtc_config_w(running_machine *machine, int function, int reg, UINT8
|
||||
{
|
||||
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
|
||||
{
|
||||
memory_set_bankptr(1, bios_ram);
|
||||
memory_set_bankptr(machine, 1, bios_ram);
|
||||
}
|
||||
else // disable RAM access (reads go to BIOS ROM)
|
||||
{
|
||||
memory_set_bankptr(1, memory_region(machine, "user1") + 0x30000);
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "user1") + 0x30000);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -586,7 +586,7 @@ static IRQ_CALLBACK(irq_callback)
|
||||
|
||||
static MACHINE_RESET(gamecstl)
|
||||
{
|
||||
memory_set_bankptr(1, memory_region(machine, "user1") + 0x30000);
|
||||
memory_set_bankptr(machine, 1, memory_region(machine, "user1") + 0x30000);
|
||||
|
||||
cpu_set_irq_callback(machine->cpu[0], irq_callback);
|
||||
|
||||
|
@ -132,7 +132,7 @@ static WRITE8_HANDLER( mrgoemon_coin_counter_w )
|
||||
|
||||
/* bits 5-7 = ROM bank select */
|
||||
offs = 0x10000 + ((data & 0xe0) >> 5) * 0x800;
|
||||
memory_set_bankptr(1, &memory_region(space->machine, "main")[offs]);
|
||||
memory_set_bankptr(space->machine, 1, &memory_region(space->machine, "main")[offs]);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( mrgoemon_flipscreen_w )
|
||||
|
@ -421,7 +421,7 @@ static void gbusters_banking( int lines )
|
||||
|
||||
/* bits 0-3 ROM bank */
|
||||
offs += (lines & 0x0f)*0x2000;
|
||||
memory_set_bankptr( 1, &RAM[offs] );
|
||||
memory_set_bankptr(Machine, 1, &RAM[offs] );
|
||||
|
||||
if (lines & 0xf0){
|
||||
//logerror("%04x: (lines) write %02x\n",cpu_get_pc(machine->activecpu), lines);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user