Ok, last major rename for this round:

memory_region()        == machine->region()->base()
memory_region_length() == machine->region()->bytes()

region_info -> memory_region

Regex searches:

S: memory_region( *)\(( *)([^,&]+), *([^)]+)\)
R: \3->region\1\(\2\4\)->base\(\)

S: memory_region_length( *)\(( *)([^,&]+), *([^)]+)\)
R: \3->region\1\(\2\4\)->bytes\(\)
This commit is contained in:
Aaron Giles 2011-01-01 00:41:25 +00:00
parent 6d02b55f4a
commit 5db7b9e8a3
953 changed files with 3559 additions and 3571 deletions

View File

@ -286,7 +286,7 @@ static CPU_INIT( cquestsnd )
memset(cpustate, 0, sizeof(*cpustate));
cpustate->dac_w = _config->dac_w;
cpustate->sound_data = (UINT16*)memory_region(device->machine, _config->sound_data_region);
cpustate->sound_data = (UINT16*)device->machine->region(_config->sound_data_region)->base();
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);

View File

@ -256,7 +256,7 @@ static CPU_INIT( esrip )
/* Register configuration structure callbacks */
cpustate->fdt_r = _config->fdt_r;
cpustate->fdt_w = _config->fdt_w;
cpustate->lbrm = (UINT8*)memory_region(device->machine, _config->lbrm_prom);
cpustate->lbrm = (UINT8*)device->machine->region(_config->lbrm_prom)->base();
cpustate->status_in = _config->status_in;
cpustate->draw = _config->draw;

View File

@ -125,7 +125,7 @@ static CPU_INIT( mb86233 )
memset( cpustate->RAM, 0, 2 * 0x200 * sizeof(UINT32) );
cpustate->ARAM = &cpustate->RAM[0];
cpustate->BRAM = &cpustate->RAM[0x200];
cpustate->Tables = (UINT32*) memory_region(device->machine, _config->tablergn);
cpustate->Tables = (UINT32*) device->machine->region(_config->tablergn)->base();
state_save_register_global_pointer(device->machine, cpustate->RAM,2 * 0x200 * sizeof(UINT32));
}

View File

@ -1291,7 +1291,7 @@ static UINT64 expression_read_program_direct(address_space *_space, int opcode,
static UINT64 expression_read_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size)
{
const region_info *region = machine->region(rgntag);
const memory_region *region = machine->region(rgntag);
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
/* make sure we get a valid base before proceeding */
@ -1465,7 +1465,7 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
static void expression_write_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size, UINT64 data)
{
debugcpu_private *global = machine->debugcpu_data;
const region_info *region = machine->region(rgntag);
const memory_region *region = machine->region(rgntag);
/* make sure we get a valid base before proceeding */
if (region != NULL)
@ -1574,7 +1574,7 @@ static expression_error::error_code expression_validate(void *param, const char
case EXPSPACE_REGION:
if (name == NULL)
return expression_error::MISSING_MEMORY_NAME;
if (memory_region(machine, name) == NULL)
if (machine->region(name)->base() == NULL)
return expression_error::INVALID_MEMORY_NAME;
break;
}

View File

@ -84,7 +84,7 @@ debug_view_memory_source::debug_view_memory_source(const char *name, address_spa
{
}
debug_view_memory_source::debug_view_memory_source(const char *name, const region_info &region)
debug_view_memory_source::debug_view_memory_source(const char *name, const memory_region &region)
: debug_view_source(name),
m_space(NULL),
m_memintf(NULL),
@ -165,7 +165,7 @@ void debug_view_memory::enumerate_sources()
}
// then add all the memory regions
for (const region_info *region = m_machine.m_regionlist.first(); region != NULL; region = region->next())
for (const memory_region *region = m_machine.m_regionlist.first(); region != NULL; region = region->next())
{
name.printf("Region '%s'", region->name());
m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, *region)));

View File

@ -53,7 +53,7 @@ class debug_view_memory_source : public debug_view_source
friend class debug_view_memory;
debug_view_memory_source(const char *name, address_space &space);
debug_view_memory_source(const char *name, const region_info &region);
debug_view_memory_source(const char *name, const memory_region &region);
debug_view_memory_source(const char *name, void *base, int element_size, int num_elements);
public:

View File

@ -569,7 +569,7 @@ device_t::~device_t()
// info for a given region
//-------------------------------------------------
const region_info *device_t::subregion(const char *_tag) const
const memory_region *device_t::subregion(const char *_tag) const
{
// safety first
if (this == NULL)

View File

@ -115,7 +115,7 @@ device_t *_ConfigClass::alloc_device(running_machine &machine) const \
//**************************************************************************
// forward references
class region_info;
class memory_region;
class device_debug;
class device_config;
class device_config_interface;
@ -408,7 +408,7 @@ public:
// owned object helpers
astring &subtag(astring &dest, const char *tag) const { return m_baseconfig.subtag(dest, tag); }
astring &siblingtag(astring &dest, const char *tag) const { return m_baseconfig.siblingtag(dest, tag); }
const region_info *subregion(const char *tag) const;
const memory_region *subregion(const char *tag) const;
device_t *subdevice(const char *tag) const;
device_t *siblingdevice(const char *tag) const;
template<class T> inline T *subdevice(const char *tag) { return downcast<T *>(subdevice(tag)); }
@ -416,7 +416,7 @@ public:
// configuration helpers
const device_config &baseconfig() const { return m_baseconfig; }
const region_info *region() const { return m_region; }
const memory_region *region() const { return m_region; }
// state helpers
bool started() const { return m_started; }
@ -484,7 +484,7 @@ protected:
bool m_started; // true if the start function has succeeded
UINT32 m_clock; // device clock
const region_info * m_region; // our device-local region
const memory_region * m_region; // our device-local region
const device_config & m_baseconfig; // reference to our device_config
UINT32 m_unscaled_clock; // unscaled clock

View File

@ -432,7 +432,7 @@ UINT8 *device_image_interface::get_software_region(const char *tag)
return NULL;
sprintf( full_tag, "%s:%s", device().tag(), tag );
return memory_region( device().machine, full_tag );
return device().machine->region( full_tag )->base();
}
@ -445,7 +445,7 @@ UINT32 device_image_interface::get_software_region_length(const char *tag)
char full_tag[256];
sprintf( full_tag, "%s:%s", device().tag(), tag );
return memory_region_length( device().machine, full_tag );
return device().machine->region( full_tag )->bytes();
}

View File

@ -92,7 +92,7 @@ void gfx_init(running_machine *machine)
for (curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != NULL; curgfx++)
{
const gfx_decode_entry *gfxdecode = &gfxdecodeinfo[curgfx];
const region_info *region = (gfxdecode->memory_region != NULL) ? machine->region(gfxdecode->memory_region) : NULL;
const memory_region *region = (gfxdecode->memory_region != NULL) ? machine->region(gfxdecode->memory_region) : NULL;
UINT32 region_length = (region != NULL) ? (8 * region->bytes()) : 0;
const UINT8 *region_base = (region != NULL) ? region->base() : NULL;
UINT32 xscale = (gfxdecode->xscale == 0) ? 1 : gfxdecode->xscale;

View File

@ -616,15 +616,15 @@ void running_machine::resume()
// region_alloc - allocates memory for a region
//-------------------------------------------------
region_info *running_machine::region_alloc(const char *name, UINT32 length, UINT32 flags)
memory_region *running_machine::region_alloc(const char *name, UINT32 length, UINT32 flags)
{
// make sure we don't have a region of the same name; also find the end of the list
region_info *info = m_regionlist.find(name);
memory_region *info = m_regionlist.find(name);
if (info != NULL)
fatalerror("region_alloc called with duplicate region name \"%s\"\n", name);
// allocate the region
return m_regionlist.append(name, auto_alloc(this, region_info(*this, name, length, flags)));
return m_regionlist.append(name, auto_alloc(this, memory_region(*this, name, length, flags)));
}
@ -898,10 +898,10 @@ void running_machine::logfile_callback(running_machine &machine, const char *buf
***************************************************************************/
//-------------------------------------------------
// region_info - constructor
// memory_region - constructor
//-------------------------------------------------
region_info::region_info(running_machine &machine, const char *name, UINT32 length, UINT32 flags)
memory_region::memory_region(running_machine &machine, const char *name, UINT32 length, UINT32 flags)
: m_machine(machine),
m_next(NULL),
m_name(name),
@ -913,10 +913,10 @@ region_info::region_info(running_machine &machine, const char *name, UINT32 leng
//-------------------------------------------------
// ~region_info - destructor
// ~memory_region - destructor
//-------------------------------------------------
region_info::~region_info()
memory_region::~memory_region()
{
auto_free(&m_machine, m_base.v);
}
@ -1188,7 +1188,7 @@ void driver_device::device_start()
// call palette_init if present
if (m_config.m_palette_init != NULL)
(*m_config.m_palette_init)(&m_machine, memory_region(machine, "proms"));
(*m_config.m_palette_init)(&m_machine, machine->region("proms")->base());
// start the various pieces
driver_start();

View File

@ -208,7 +208,7 @@ typedef struct _generic_audio_private generic_audio_private;
// template specializations
typedef tagged_list<region_info> region_list;
typedef tagged_list<memory_region> region_list;
// legacy callback functions
@ -218,24 +218,24 @@ typedef UINT32 (*video_update_func)(screen_device *screen, bitmap_t *bitmap, con
// ======================> region_info
// ======================> memory_region
// memory region object; should eventually be renamed memory_region
class region_info
class memory_region
{
DISABLE_COPYING(region_info);
DISABLE_COPYING(memory_region);
friend class running_machine;
template<class T> friend class tagged_list;
friend resource_pool_object<region_info>::~resource_pool_object();
friend resource_pool_object<memory_region>::~resource_pool_object();
// construction/destruction
region_info(running_machine &machine, const char *name, UINT32 length, UINT32 flags);
~region_info();
memory_region(running_machine &machine, const char *name, UINT32 length, UINT32 flags);
~memory_region();
public:
// getters
region_info *next() const { return m_next; }
memory_region *next() const { return m_next; }
UINT8 *base() const { return (this != NULL) ? m_base.u8 : NULL; }
UINT8 *end() const { return (this != NULL) ? m_base.u8 + m_length : NULL; }
UINT32 bytes() const { return (this != NULL) ? m_length : 0; }
@ -267,7 +267,7 @@ public:
private:
// internal data
running_machine & m_machine;
region_info * m_next;
memory_region * m_next;
astring m_name;
generic_ptr m_base;
UINT32 m_length;
@ -346,7 +346,7 @@ public:
inline device_t *device(const char *tag);
template<class T> inline T *device(const char *tag) { return downcast<T *>(device(tag)); }
inline const input_port_config *port(const char *tag);
inline const region_info *region(const char *tag);
inline const memory_region *region(const char *tag);
// configuration helpers
UINT32 total_colors() const { return m_config.m_total_colors; }
@ -386,7 +386,7 @@ public:
void current_datetime(system_time &systime);
// regions
region_info *region_alloc(const char *name, UINT32 length, UINT32 flags);
memory_region *region_alloc(const char *name, UINT32 length, UINT32 flags);
void region_free(const char *name);
// managers
@ -663,22 +663,10 @@ inline const input_port_config *running_machine::port(const char *tag)
return m_portlist.find(tag);
}
inline const region_info *running_machine::region(const char *tag)
inline const memory_region *running_machine::region(const char *tag)
{
return m_regionlist.find(tag);
}
inline UINT8 *memory_region(running_machine *machine, const char *name)
{
const region_info *region = machine->region(name);
return (region != NULL) ? region->base() : NULL;
}
inline UINT32 memory_region_length(running_machine *machine, const char *name)
{
const region_info *region = machine->region(name);
return (region != NULL) ? region->bytes() : 0;
}
#endif /* __MACHINE_H__ */

View File

@ -1935,7 +1935,7 @@ inline void address_space::adjust_addresses(offs_t &start, offs_t &end, offs_t &
void address_space::prepare_map()
{
const region_info *devregion = (m_spacenum == ADDRESS_SPACE_0) ? m_machine.region(m_device.tag()) : NULL;
const memory_region *devregion = (m_spacenum == ADDRESS_SPACE_0) ? m_machine.region(m_device.tag()) : NULL;
UINT32 devregionsize = (devregion != NULL) ? devregion->bytes() : 0;
// allocate the address map
@ -1981,7 +1981,7 @@ void address_space::prepare_map()
// validate adjusted addresses against implicit regions
if (entry->m_region != NULL && entry->m_share == NULL && entry->m_baseptr == NULL)
{
const region_info *region = m_machine.region(entry->m_region);
const memory_region *region = m_machine.region(entry->m_region);
if (region == NULL)
fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", m_device.tag(), m_name, entry->m_addrstart, entry->m_addrend, entry->m_region);
@ -3020,7 +3020,7 @@ bool address_space::needs_backing_store(const address_map_entry *entry)
return true;
// if we're reading from RAM or from ROM outside of address space 0 or its region, then yes, we do need backing
const region_info *region = m_machine.region(m_device.tag());
const memory_region *region = m_machine.region(m_device.tag());
if (entry->m_read.m_type == AMH_RAM ||
(entry->m_read.m_type == AMH_ROM && (m_spacenum != ADDRESS_SPACE_0 || region == NULL || entry->m_addrstart >= region->bytes())))
return true;
@ -4078,7 +4078,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
}
// register for saving, but only if we're not part of a memory region
const region_info *region;
const memory_region *region;
for (region = space.m_machine.m_regionlist.first(); region != NULL; region = region->next())
if (m_data >= region->base() && (m_data + (byteend - bytestart + 1)) < region->end())
{

View File

@ -64,7 +64,7 @@ struct _romload_private
open_chd * chd_list; /* disks */
open_chd ** chd_list_tailptr;
region_info * region; /* info about current region */
memory_region * region; /* info about current region */
astring errorstring; /* error string */
};
@ -562,7 +562,7 @@ static void display_rom_load_results(rom_load_data *romdata)
static void region_post_process(rom_load_data *romdata, const char *rgntag)
{
const region_info *region = romdata->machine->region(rgntag);
const memory_region *region = romdata->machine->region(rgntag);
UINT8 *base;
int i, j;
@ -832,7 +832,7 @@ static void copy_rom_data(rom_load_data *romdata, const rom_entry *romp)
fatalerror("Error in RomModule definition: COPY has an invalid length\n");
/* make sure the source was valid */
const region_info *region = romdata->machine->region(srcrgntag);
const memory_region *region = romdata->machine->region(srcrgntag);
if (region == NULL)
fatalerror("Error in RomModule definition: COPY from an invalid region\n");
@ -1251,7 +1251,7 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
assert(ROMENTRY_ISREGION(region));
/* if this is a device region, override with the device width and endianness */
const region_info *memregion = romdata->machine->region(regiontag);
const memory_region *memregion = romdata->machine->region(regiontag);
if (memregion != NULL)
{
if (romdata->machine->device(regiontag) != NULL)

View File

@ -166,8 +166,8 @@ static DEVICE_START( ym2610 )
pcmbufa = *device->region();
pcmsizea = device->region()->bytes();
name.printf("%s.deltat", device->tag());
pcmbufb = (void *)(memory_region(device->machine, name));
pcmsizeb = memory_region_length(device->machine, name);
pcmbufb = (void *)(device->machine->region(name)->base());
pcmsizeb = device->machine->region(name)->bytes();
if (pcmbufb == NULL || pcmsizeb == 0)
{
pcmbufb = pcmbufa;

View File

@ -649,7 +649,7 @@ static DEVICE_START(digitalker)
{
digitalker *dg = get_safe_token(device);
dg->device = device;
dg->rom = memory_region(device->machine, device->tag());
dg->rom = device->machine->region(device->tag())->base();
dg->stream = stream_create(device, 0, 1, device->clock()/4, dg, digitalker_update);
dg->dac_index = 128;
dg->data = 0xff;

View File

@ -914,10 +914,10 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
chip->stream = stream_create(device, 0, 2, device->clock() / (16*32), chip, es5506_update);
/* initialize the regions */
chip->region_base[0] = intf->region0 ? (UINT16 *)memory_region(device->machine, intf->region0) : NULL;
chip->region_base[1] = intf->region1 ? (UINT16 *)memory_region(device->machine, intf->region1) : NULL;
chip->region_base[2] = intf->region2 ? (UINT16 *)memory_region(device->machine, intf->region2) : NULL;
chip->region_base[3] = intf->region3 ? (UINT16 *)memory_region(device->machine, intf->region3) : NULL;
chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine->region(intf->region0)->base() : NULL;
chip->region_base[1] = intf->region1 ? (UINT16 *)device->machine->region(intf->region1)->base() : NULL;
chip->region_base[2] = intf->region2 ? (UINT16 *)device->machine->region(intf->region2)->base() : NULL;
chip->region_base[3] = intf->region3 ? (UINT16 *)device->machine->region(intf->region3)->base() : NULL;
/* initialize the rest of the structure */
chip->device = device;

View File

@ -4231,17 +4231,17 @@ void ym2610_reset_chip(void *chip)
/* setup PCM buffers again */
name.printf("%s",dev->tag());
F2610->pcmbuf = (const UINT8 *)memory_region(dev->machine,name);
F2610->pcm_size = memory_region_length(dev->machine,name);
F2610->pcmbuf = (const UINT8 *)dev->machine->region(name)->base();
F2610->pcm_size = dev->machine->region(name)->bytes();
name.printf("%s.deltat",dev->tag());
F2610->deltaT.memory = (UINT8 *)memory_region(dev->machine,name);
F2610->deltaT.memory = (UINT8 *)dev->machine->region(name)->base();
if(F2610->deltaT.memory == NULL)
{
F2610->deltaT.memory = (UINT8*)F2610->pcmbuf;
F2610->deltaT.memory_size = F2610->pcm_size;
}
else
F2610->deltaT.memory_size = memory_region_length(dev->machine,name);
F2610->deltaT.memory_size = dev->machine->region(name)->bytes();
/* Reset Prescaler */
OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */

View File

@ -261,7 +261,7 @@ static DEVICE_START( gaelco )
info->banks[j] = intf->banks[j];
}
info->stream = stream_create(device, 0, 2, 8000, info, gaelco_update);
info->snd_data = (UINT8 *)memory_region(device->machine, intf->gfxregion);
info->snd_data = (UINT8 *)device->machine->region(intf->gfxregion)->base();
if (info->snd_data == NULL)
info->snd_data = *device->region();

View File

@ -222,7 +222,7 @@ static DEVICE_START( k053260 )
ic->mode = 0;
const region_info *region = (ic->intf->rgnoverride != NULL) ? device->machine->region(ic->intf->rgnoverride) : device->region();
const memory_region *region = (ic->intf->rgnoverride != NULL) ? device->machine->region(ic->intf->rgnoverride) : device->region();
ic->rom = *region;
ic->rom_size = region->bytes();

View File

@ -457,7 +457,7 @@ static void k054539_init_chip(device_t *device, k054539_state *info)
info->cur_ptr = 0;
memset(info->ram, 0, 0x4000*2+device->clock()/50*2);
const region_info *region = (info->intf->rgnoverride != NULL) ? device->machine->region(info->intf->rgnoverride) : device->region();
const memory_region *region = (info->intf->rgnoverride != NULL) ? device->machine->region(info->intf->rgnoverride) : device->region();
info->rom = *region;
info->rom_size = region->bytes();
info->rom_mask = 0xffffffffU;

View File

@ -1416,7 +1416,7 @@ static DEVICE_START( tmsprom )
tms->rom = *device->region();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No rom region found");
tms->prom = memory_region(device->machine, tms->intf->prom_region);
tms->prom = device->machine->region(tms->intf->prom_region)->base();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No prom region found");
tms->device = device;

View File

@ -229,7 +229,7 @@ static DEVICE_START( zsg2 )
info->stream = stream_create(device, 0, 2, info->sample_rate, info, update_stereo);
info->bank_samples = memory_region(device->machine, intf->samplergn);
info->bank_samples = device->machine->region(intf->samplergn)->base();
}
/**************************************************************************

View File

@ -103,7 +103,7 @@ WRITE16_HANDLER( vga_port16le_03d0_w );
*/
#if 0
int i;
UINT8 *memory=memory_region(machine, "maincpu")+0xc0000;
UINT8 *memory=machine->region("maincpu")->base()+0xc0000;
UINT8 chksum;
/* oak vga */

View File

@ -277,7 +277,7 @@ static DEVICE_START( tms9927 )
/* get the self-load PROM */
if (tms->intf->selfload_region != NULL)
{
tms->selfload = memory_region(device->machine, tms->intf->selfload_region);
tms->selfload = device->machine->region(tms->intf->selfload_region)->base();
assert(tms->selfload != NULL);
}
}

View File

@ -133,7 +133,7 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
test_mask = testmask;
/* predetermine the bank base */
rgn = memory_region(machine, "jsa");
rgn = machine->region("jsa")->base();
bank_base = &rgn[0x03000];
bank_source_data = &rgn[0x10000];
@ -161,8 +161,8 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
/* the upper 128k is fixed, the lower 128k is bankswitched */
for (rgn = 0; rgn < ARRAY_LENGTH(regions); rgn++)
{
UINT8 *base = memory_region(machine, regions[rgn]);
if (base != NULL && memory_region_length(machine, regions[rgn]) >= 0x80000)
UINT8 *base = machine->region(regions[rgn])->base();
if (base != NULL && machine->region(regions[rgn])->bytes() >= 0x80000)
{
const char *bank = (rgn != 2) ? "bank12" : "bank14";
const char *bank_plus_1 = (rgn != 2) ? "bank13" : "bank15";

View File

@ -160,8 +160,8 @@ void cage_init(running_machine *machine, offs_t speedup)
cage_irqhandler = NULL;
memory_set_bankptr(machine, "bank10", memory_region(machine, "cageboot"));
memory_set_bankptr(machine, "bank11", memory_region(machine, "cage"));
memory_set_bankptr(machine, "bank10", machine->region("cageboot")->base());
memory_set_bankptr(machine, "bank11", machine->region("cage")->base());
cage_cpu = machine->device<cpu_device>("cage");
cage_cpu_clock_period = ATTOTIME_IN_HZ(cage_cpu->clock());

View File

@ -17,16 +17,16 @@ static SAMPLES_START( cclimber_sh_start )
{
running_machine *machine = device->machine;
samplebuf = 0;
if (memory_region(machine, "samples"))
samplebuf = auto_alloc_array(machine, INT16, 2 * memory_region_length(machine, "samples"));
if (machine->region("samples")->base())
samplebuf = auto_alloc_array(machine, INT16, 2 * machine->region("samples")->bytes());
}
static void cclimber_play_sample(running_machine *machine, int start,int freq,int volume)
{
int len;
int romlen = memory_region_length(machine, "samples");
const UINT8 *rom = memory_region(machine, "samples");
int romlen = machine->region("samples")->bytes();
const UINT8 *rom = machine->region("samples")->base();
device_t *samples = machine->device("samples");

View File

@ -1635,7 +1635,7 @@ static MACHINE_RESET( qb3_sound )
/* this patch prevents the sound ROM from eating itself when command $0A is sent */
/* on a cube rotate */
memory_region(machine, "audiocpu")[0x11dc] = 0x09;
machine->region("audiocpu")->base()[0x11dc] = 0x09;
}

View File

@ -175,7 +175,7 @@ WRITE8_HANDLER( circus_clown_z_w )
circus_state *state = space->machine->driver_data<circus_state>();
state->clown_z = (data & 0x0f);
*(memory_region(space->machine, "maincpu") + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
*(space->machine->region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
/* Bits 4-6 enable/disable trigger different events */
switch (state->game_id)

View File

@ -20,7 +20,7 @@ void cyberbal_sound_reset(running_machine *machine)
cyberbal_state *state = machine->driver_data<cyberbal_state>();
/* reset the sound system */
state->bank_base = &memory_region(machine, "audiocpu")[0x10000];
state->bank_base = &machine->region("audiocpu")->base()[0x10000];
memory_set_bankptr(machine, "soundbank", &state->bank_base[0x0000]);
state->fast_68k_int = state->io_68k_int = 0;
state->sound_data_from_68k = state->sound_data_from_6502 = 0;

View File

@ -946,8 +946,8 @@ void dcs_init(running_machine *machine)
dcs.dmadac[0] = machine->device<dmadac_sound_device>("dac");
/* configure boot and sound ROMs */
dcs.bootrom = (UINT16 *)memory_region(machine, "dcs");
dcs.bootrom_words = memory_region_length(machine, "dcs") / 2;
dcs.bootrom = (UINT16 *)machine->region("dcs")->base();
dcs.bootrom_words = machine->region("dcs")->bytes() / 2;
dcs.sounddata = dcs.bootrom;
dcs.sounddata_words = dcs.bootrom_words;
dcs.sounddata_banks = dcs.sounddata_words / 0x1000;
@ -997,8 +997,8 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
dcs.dmadac[1] = machine->device<dmadac_sound_device>("dac2");
/* always boot from the base of "dcs" */
dcs.bootrom = (UINT16 *)memory_region(machine, "dcs");
dcs.bootrom_words = memory_region_length(machine, "dcs") / 2;
dcs.bootrom = (UINT16 *)machine->region("dcs")->base();
dcs.bootrom_words = machine->region("dcs")->bytes() / 2;
/* supports both RAM and ROM variants */
if (dram_in_mb != 0)

View File

@ -1124,7 +1124,7 @@ static SOUND_START( dkong)
{
dkong_state *state = machine->driver_data<dkong_state>();
state->snd_rom = memory_region(machine, "soundcpu");
state->snd_rom = machine->region("soundcpu")->base();
}

View File

@ -165,7 +165,7 @@ static DEVICE_START( exidy440_sound )
stream = stream_create(device, 0, 2, device->clock(), NULL, channel_update);
/* allocate the sample cache */
length = memory_region_length(machine, "cvsd") * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
length = machine->region("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
sound_cache = (sound_cache_entry *)auto_alloc_array(machine, UINT8, length);
/* determine the hard end of the cache and reset */
@ -652,7 +652,7 @@ static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address,
if (current->address == address && current->length == length && current->bits == bits && current->frequency == frequency)
return current->data;
return add_to_sound_cache(&memory_region(machine, "cvsd")[address], address, length, bits, frequency);
return add_to_sound_cache(&machine->region("cvsd")->base()[address], address, length, bits, frequency);
}

View File

@ -185,8 +185,8 @@ static DEVICE_START( flower_sound )
state->num_voices = 8;
state->last_channel = state->channel_list + state->num_voices;
state->sound_rom1 = memory_region(machine, "sound1");
state->sound_rom2 = memory_region(machine, "sound2");
state->sound_rom1 = machine->region("sound1")->base();
state->sound_rom2 = machine->region("sound2")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;

View File

@ -193,7 +193,7 @@ static DEVICE_START( gomoku_sound )
state->num_voices = MAX_VOICES;
state->last_channel = state->channel_list + state->num_voices;
state->sound_rom = memory_region(machine, "gomoku");
state->sound_rom = machine->region("gomoku")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;

View File

@ -24,8 +24,8 @@
void hdsnd_init(running_machine *machine)
{
harddriv_state *state = machine->driver_data<harddriv_state>();
state->rombase = (UINT8 *)memory_region(machine, "serialroms");
state->romsize = memory_region_length(machine, "serialroms");
state->rombase = (UINT8 *)machine->region("serialroms")->base();
state->romsize = machine->region("serialroms")->bytes();
}

View File

@ -552,7 +552,7 @@ static DEVICE_START( common_sh_start )
/* if we have a 2151, install an externally driven DAC stream */
if (state->has_ym2151)
{
state->ext_base = memory_region(machine, "dac");
state->ext_base = machine->region("dac")->base();
state->extern_stream = stream_create(device, 0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update);
}

View File

@ -200,11 +200,11 @@ WRITE8_HANDLER( poundfor_sample_addr_w )
READ8_HANDLER( m72_sample_r )
{
return memory_region(space->machine, "samples")[sample_addr];
return space->machine->region("samples")->base()[sample_addr];
}
WRITE8_DEVICE_HANDLER( m72_sample_w )
{
dac_signed_data_w(device, data);
sample_addr = (sample_addr + 1) & (memory_region_length(device->machine, "samples") - 1);
sample_addr = (sample_addr + 1) & (device->machine->region("samples")->bytes() - 1);
}

View File

@ -416,7 +416,7 @@ static SOUND_START( mario )
mario_state *state = machine->driver_data<mario_state>();
device_t *audiocpu = machine->device("audiocpu");
#if USE_8039
UINT8 *SND = memory_region(machine, "audiocpu");
UINT8 *SND = machine->region("audiocpu")->base();
SND[0x1001] = 0x01;
#endif
@ -426,8 +426,8 @@ static SOUND_START( mario )
{
state->eabank = "bank1";
memory_install_read_bank(cpu_get_address_space(audiocpu, ADDRESS_SPACE_PROGRAM), 0x000, 0x7ff, 0, 0, "bank1");
memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, "audiocpu"), 0);
memory_configure_bank(machine, "bank1", 1, 1, memory_region(machine, "audiocpu") + 0x1000, 0x800);
memory_configure_bank(machine, "bank1", 0, 1, machine->region("audiocpu")->base(), 0);
memory_configure_bank(machine, "bank1", 1, 1, machine->region("audiocpu")->base() + 0x1000, 0x800);
}
state_save_register_global(machine, state->last);
@ -482,8 +482,8 @@ static READ8_HANDLER( mario_sh_t1_r )
static READ8_HANDLER( mario_sh_tune_r )
{
UINT8 *SND = memory_region(space->machine, "audiocpu");
UINT16 mask = memory_region_length(space->machine, "audiocpu")-1;
UINT8 *SND = space->machine->region("audiocpu")->base();
UINT16 mask = space->machine->region("audiocpu")->bytes()-1;
UINT8 p2 = I8035_P2_R(space);
if ((p2 >> 7) & 1)

View File

@ -242,7 +242,7 @@ void mcr_sound_reset(running_machine *machine)
*/
static void ssio_compute_ay8910_modulation(running_machine *machine)
{
UINT8 *prom = memory_region(machine, "proms");
UINT8 *prom = machine->region("proms")->base();
int volval;
/* loop over all possible values of the duty cycle */

View File

@ -79,7 +79,7 @@ void namcoc7x_sound_write16(UINT16 command, UINT32 offset)
void namcoc7x_on_driver_init(running_machine *machine)
{
UINT8 *pROM = (UINT8 *)memory_region(machine, "c7x");
UINT8 *pROM = (UINT8 *)machine->region("c7x")->base();
device_t *cpu;
// clear the two 16-bits magic values at the start of the rom

View File

@ -81,7 +81,7 @@ static STREAM_UPDATE( engine_sound_update )
/* determine the volume */
slot = (state->sample_msb >> 3) & 7;
volume = volume_table[slot];
base = &memory_region(device->machine, "engine")[slot * 0x800];
base = &device->machine->region("engine")->base()[slot * 0x800];
/* fill in the sample */
while (samples--)

View File

@ -509,7 +509,7 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
INLINE void sega005_update_sound_data(running_machine *machine)
{
UINT8 newval = memory_region(machine, "005")[sound_addr];
UINT8 newval = machine->region("005")->base()[sound_addr];
UINT8 diff = newval ^ sound_data;
//mame_printf_debug(" [%03X] = %02X\n", sound_addr, newval);
@ -607,7 +607,7 @@ DEVICE_GET_INFO( sega005_sound )
static STREAM_UPDATE( sega005_stream_update )
{
const UINT8 *sound_prom = memory_region(device->machine, "proms");
const UINT8 *sound_prom = device->machine->region("proms")->base();
int i;
/* no implementation yet */
@ -898,7 +898,7 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
tms36xx_note_w(tms, 0, data & 15);
/* Top four data lines address an 82S123 ROM that enables/disables voices */
enable_val = memory_region(device->machine, "prom")[(data & 0xF0) >> 4];
enable_val = device->machine->region("prom")->base()[(data & 0xF0) >> 4];
tms3617_enable_w(tms, enable_val >> 2);
}
@ -976,7 +976,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
case 3:
sound_addr &= 0xfff;
{
int numroms = memory_region_length(device->machine, "n7751") / 0x1000;
int numroms = device->machine->region("n7751")->bytes() / 0x1000;
if (!(data & 0x01) && numroms >= 1) sound_addr |= 0x0000;
if (!(data & 0x02) && numroms >= 2) sound_addr |= 0x1000;
if (!(data & 0x04) && numroms >= 3) sound_addr |= 0x2000;
@ -990,7 +990,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
static READ8_HANDLER( n7751_rom_r )
{
/* read from BUS */
return memory_region(space->machine, "n7751")[sound_addr];
return space->machine->region("n7751")->base()[sound_addr];
}

View File

@ -169,7 +169,7 @@ static READ8_HANDLER( speech_p1_r )
static READ8_HANDLER( speech_rom_r )
{
return memory_region(space->machine, "speech")[0x100 * (speech_p2 & 0x3f) + offset];
return space->machine->region("speech")->base()[0x100 * (speech_p2 & 0x3f) + offset];
}
static WRITE8_HANDLER( speech_p1_w )

View File

@ -106,7 +106,7 @@ void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length)
{
address_space *space = cputag_get_address_space(machine, cpu, ADDRESS_SPACE_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
UINT8 *rom = memory_region(machine, cpu);
UINT8 *rom = machine->region(cpu)->base();
int i;
space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
@ -176,7 +176,7 @@ static DEVICE_START( seibu_adpcm )
state->playing = 0;
state->stream = stream_create(device, 0, 1, device->clock(), state, seibu_adpcm_callback);
state->base = memory_region(machine, "adpcm");
state->base = machine->region("adpcm")->base();
state->adpcm.reset();
}
@ -203,8 +203,8 @@ DEVICE_GET_INFO( seibu_adpcm )
void seibu_adpcm_decrypt(running_machine *machine, const char *region)
{
UINT8 *ROM = memory_region(machine, region);
int len = memory_region_length(machine, region);
UINT8 *ROM = machine->region(region)->base();
int len = machine->region(region)->bytes();
int i;
for (i = 0; i < len; i++)
@ -332,8 +332,8 @@ void seibu_ym2203_irqhandler(device_t *device, int linestate)
MACHINE_RESET( seibu_sound )
{
int romlength = memory_region_length(machine, "audiocpu");
UINT8 *rom = memory_region(machine, "audiocpu");
int romlength = machine->region("audiocpu")->bytes();
UINT8 *rom = machine->region("audiocpu")->base();
sound_cpu = machine->device("audiocpu");
update_irq_lines(machine, VECTOR_INIT);

View File

@ -1170,7 +1170,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
if ((data & 0x80) != (spc700->ram[0xf1] & 0x80))
{
if (data & 0x80)
memcpy(spc700->ipl_region, memory_region(device->machine, "user5"), 64);
memcpy(spc700->ipl_region, device->machine->region("user5")->base(), 64);
else
memcpy(spc700->ipl_region, &spc700->ram[0xffc0], 64);
}
@ -1318,7 +1318,7 @@ static DEVICE_START( snes_sound )
spc700->ram[0xf1] = 0x80;
/* put IPL image at the top of RAM */
memcpy(spc700->ipl_region, memory_region(machine, "user5"), 64);
memcpy(spc700->ipl_region, machine->region("user5")->base(), 64);
/* Initialize the timers */
spc700->timer[0] = timer_alloc(machine, snes_spc_timer, spc700);

View File

@ -655,7 +655,7 @@ static DEVICE_START( snk6502_sound )
snk6502_sound_state *state = get_safe_token(device);
state->samples = device->machine->device("samples");
state->ROM = memory_region(device->machine, "snk6502");
state->ROM = device->machine->region("snk6502")->base();
// adjusted
snk6502_set_music_freq(device->machine, 43000);

View File

@ -48,8 +48,8 @@ WRITE8_DEVICE_HANDLER( suna8_samples_number_w )
SAMPLES_START( suna8_sh_start )
{
running_machine *machine = device->machine;
int i, len = memory_region_length(machine, "samples");
UINT8 *ROM = memory_region(machine, "samples");
int i, len = machine->region("samples")->bytes();
UINT8 *ROM = machine->region("samples")->base();
samplebuf = auto_alloc_array(machine, INT16, len);

View File

@ -36,7 +36,7 @@ static WRITE16_HANDLER(f3_68000_share_w)
static WRITE16_HANDLER( f3_es5505_bank_w )
{
UINT32 max_banks_this_game=(memory_region_length(space->machine, "ensoniq.0")/0x200000)-1;
UINT32 max_banks_this_game=(space->machine->region("ensoniq.0")->bytes()/0x200000)-1;
#if 0
{
@ -191,7 +191,7 @@ static READ16_HANDLER(es5510_dsp_r)
static WRITE16_HANDLER(es5510_dsp_w)
{
UINT8 *snd_mem = (UINT8 *)memory_region(space->machine, "ensoniq.0");
UINT8 *snd_mem = (UINT8 *)space->machine->region("ensoniq.0")->base();
// if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0)
// logerror("%06x: DSP write offset %04x %04x\n",cpu_get_pc(space->cpu),offset,data);
@ -249,7 +249,7 @@ ADDRESS_MAP_END
SOUND_RESET( taito_f3_soundsystem_reset )
{
/* Sound cpu program loads to 0xc00000 so we use a bank */
UINT16 *ROM = (UINT16 *)memory_region(machine, "audiocpu");
UINT16 *ROM = (UINT16 *)machine->region("audiocpu")->base();
memory_set_bankptr(machine, "bank1",&ROM[0x80000]);
memory_set_bankptr(machine, "bank2",&ROM[0x90000]);
memory_set_bankptr(machine, "bank3",&ROM[0xa0000]);

View File

@ -115,7 +115,7 @@ WRITE8_HANDLER( targ_audio_2_w )
if ((data & 0x01) && !(port_2_last & 0x01))
{
device_t *samples = space->machine->device("samples");
UINT8 *prom = memory_region(space->machine, "targ");
UINT8 *prom = space->machine->region("targ")->base();
tone_pointer = (tone_pointer + 1) & 0x0f;

View File

@ -274,7 +274,7 @@ void williams_cvsd_init(running_machine *machine)
soundalt_cpu = NULL;
/* configure master CPU banks */
ROM = memory_region(machine, "cvsdcpu");
ROM = machine->region("cvsdcpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@ -306,7 +306,7 @@ void williams_narc_init(running_machine *machine)
soundalt_cpu = machine->device("narc2cpu");
/* configure master CPU banks */
ROM = memory_region(machine, "narc1cpu");
ROM = machine->region("narc1cpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@ -320,7 +320,7 @@ void williams_narc_init(running_machine *machine)
memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
/* configure slave CPU banks */
ROM = memory_region(machine, "narc2cpu");
ROM = machine->region("narc2cpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@ -349,13 +349,13 @@ void williams_adpcm_init(running_machine *machine)
soundalt_cpu = NULL;
/* configure banks */
ROM = memory_region(machine, "adpcm");
ROM = machine->region("adpcm")->base();
memory_configure_bank(machine, "bank5", 0, 8, &ROM[0x10000], 0x8000);
memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
/* expand ADPCM data */
/* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */
ROM = memory_region(machine, "oki");
ROM = machine->region("oki")->base();
memcpy(ROM + 0x1c0000, ROM + 0x080000, 0x20000); /* expand individual banks */
memcpy(ROM + 0x180000, ROM + 0x0a0000, 0x20000);
memcpy(ROM + 0x140000, ROM + 0x0c0000, 0x20000);

View File

@ -193,8 +193,8 @@ static DEVICE_START( wiping_sound )
state->num_voices = 8;
state->last_channel = state->channel_list + state->num_voices;
state->sound_rom = memory_region(machine, "samples");
state->sound_prom = memory_region(machine, "soundproms");
state->sound_rom = machine->region("samples")->base();
state->sound_prom = machine->region("soundproms")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;

View File

@ -506,7 +506,7 @@ ROM_END
static DRIVER_INIT( 1942 )
{
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x4000);
}

View File

@ -535,7 +535,7 @@ ROM_END
static DRIVER_INIT( 1943 )
{
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 29, &ROM[0x10000], 0x1000);
memory_configure_bank(machine, "bank2", 0, 29, &ROM[0x11000], 0x1000);
memory_configure_bank(machine, "bank3", 0, 29, &ROM[0x12000], 0x1000);

View File

@ -147,7 +147,7 @@ static void set_bankptr(running_machine *machine)
_20pacgal_state *state = machine->driver_data<_20pacgal_state>();
if (state->game_selected == 0)
{
UINT8 *rom = memory_region(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
memory_set_bankptr(machine, "bank1", rom + 0x08000);
}
else

View File

@ -493,9 +493,9 @@ ROM_END
static DRIVER_INIT( drill )
{
// rearrange gfx roms to something we can decode, two of the roms form 4bpp of the graphics, the third forms another 2bpp but is in a different format
UINT32 *src = (UINT32*)memory_region( machine, "gfx2" );
UINT32 *dst = (UINT32*)memory_region( machine, "gfx1" );// + 0x400000;
// UINT8 *rom = memory_region( machine, "maincpu" );
UINT32 *src = (UINT32*)machine->region( "gfx2" )->base();
UINT32 *dst = (UINT32*)machine->region( "gfx1" )->base();// + 0x400000;
// UINT8 *rom = machine->region( "maincpu" )->base();
int i;
for (i = 0; i < 0x400000 / 4; i++)

View File

@ -1565,7 +1565,7 @@ static void pxa255_start(running_machine* machine)
static MACHINE_START(39in1)
{
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
int i;
for (i = 0; i < 0x80000; i += 2)

View File

@ -574,7 +574,7 @@ static READ8_HANDLER( undoukai_mcu_status_r )
static DRIVER_INIT( undoukai )
{
fortyl_state *state = machine->driver_data<fortyl_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
state->pix_color[0] = 0x000;
@ -586,14 +586,14 @@ static DRIVER_INIT( undoukai )
static DRIVER_INIT( 40love )
{
fortyl_state *state = machine->driver_data<fortyl_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
#if 0
/* character ROM hack
to show a white line on the opponent side */
UINT8 *ROM = memory_region(machine, "gfx2");
UINT8 *ROM = machine->region("gfx2")->base();
int adr = 0x10 * 0x022b;
ROM[adr + 0x000a] = 0x00;
ROM[adr + 0x000b] = 0x00;

View File

@ -1180,7 +1180,7 @@ static DRIVER_INIT( fclown )
/* Decrypting main program */
int x;
UINT8 *src = memory_region( machine, "maincpu" );
UINT8 *src = machine->region( "maincpu" )->base();
for (x = 0x0000; x < 0x10000; x++)
{
@ -1190,8 +1190,8 @@ static DRIVER_INIT( fclown )
/* Decrypting GFX by segments */
UINT8 *gfx1_src = memory_region( machine, "gfx1" );
UINT8 *gfx2_src = memory_region( machine, "gfx2" );
UINT8 *gfx1_src = machine->region( "gfx1" )->base();
UINT8 *gfx2_src = machine->region( "gfx2" )->base();
for (x = 0x2000; x < 0x3000; x++)
{
@ -1211,7 +1211,7 @@ static DRIVER_INIT( fclown )
/* Decrypting sound samples */
UINT8 *samples_src = memory_region( machine, "oki6295" );
UINT8 *samples_src = machine->region( "oki6295" )->base();
for (x = 0x0000; x < 0x10000; x++)
{

View File

@ -2163,8 +2163,8 @@ MACHINE_CONFIG_END
/* decrypt function for vortex */
static DRIVER_INIT( vortex )
{
UINT8 *rom = memory_region(machine, "maincpu");
int length = memory_region_length(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
int length = machine->region("maincpu")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
for (x = 0; x < length; x++)

View File

@ -275,7 +275,7 @@ INPUT_PORTS_END
static KONAMI_SETLINES_CALLBACK( k88games_banking )
{
_88games_state *state = device->machine->driver_data<_88games_state>();
UINT8 *RAM = memory_region(device->machine, "maincpu");
UINT8 *RAM = device->machine->region("maincpu")->base();
int offs;
logerror("%04x: bank select %02x\n", cpu_get_pc(device), lines);
@ -339,7 +339,7 @@ static MACHINE_RESET( 88games )
_88games_state *state = machine->driver_data<_88games_state>();
konami_configure_set_lines(machine->device("maincpu"), k88games_banking);
machine->generic.paletteram.u8 = &memory_region(machine, "maincpu")[0x20000];
machine->generic.paletteram.u8 = &machine->region("maincpu")->base()[0x20000];
state->videobank = 0;
state->zoomreadroms = 0;

View File

@ -577,7 +577,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( sidewndr )
{
UINT8 *ROM = memory_region( machine, "maincpu" );
UINT8 *ROM = machine->region( "maincpu" )->base();
/* replace "ret nc" ( 0xd0 ) with "di" */
ROM[ 0 ] = 0xf3;
/* this is either a bad dump or the cpu core should set the carry flag on reset */

View File

@ -223,7 +223,7 @@ static MACHINE_START( skattv )
// hack to handle acrt rom
{
UINT16 *rom = (UINT16*)memory_region(machine, "gfx1");
UINT16 *rom = (UINT16*)machine->region("gfx1")->base();
int i;
device_t *hd63484 = machine->device("hd63484");

View File

@ -230,8 +230,8 @@ static MACHINE_START( formatz )
{
aeroboto_state *state = machine->driver_data<aeroboto_state>();
state->stars_rom = memory_region(machine, "gfx2");
state->stars_length = memory_region_length(machine, "gfx2");
state->stars_rom = machine->region("gfx2")->base();
state->stars_length = machine->region("gfx2")->bytes();
state_save_register_global(machine, state->disable_irq);
state_save_register_global(machine, state->count);

View File

@ -134,7 +134,7 @@ static WRITE16_DEVICE_HANDLER( aerfboo2_okim6295_banking_w )
static WRITE8_HANDLER( aerfboot_okim6295_banking_w )
{
UINT8 *oki = memory_region(space->machine, "oki");
UINT8 *oki = space->machine->region("oki")->base();
/*bit 2 (0x4) setted too?*/
if (data & 0x4)
memcpy(&oki[0x20000], &oki[((data & 0x3) * 0x20000) + 0x40000], 0x20000);
@ -1307,7 +1307,7 @@ static MACHINE_START( common )
static MACHINE_START( aerofgt )
{
UINT8 *rom = memory_region(machine, "audiocpu");
UINT8 *rom = machine->region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rom[0x10000], 0x8000);

View File

@ -576,9 +576,9 @@ static INTERRUPT_GEN( slave_interrupt )
static MACHINE_START( airbustr )
{
airbustr_state *state = machine->driver_data<airbustr_state>();
UINT8 *MASTER = memory_region(machine, "master");
UINT8 *SLAVE = memory_region(machine, "slave");
UINT8 *AUDIO = memory_region(machine, "audiocpu");
UINT8 *MASTER = machine->region("master")->base();
UINT8 *SLAVE = machine->region("slave")->base();
UINT8 *AUDIO = machine->region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &MASTER[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 3, 5, &MASTER[0x10000], 0x4000);

View File

@ -376,7 +376,7 @@ INPUT_PORTS_END
static MACHINE_START( yumefuda )
{
albazg_state *state = machine->driver_data<albazg_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);

View File

@ -603,7 +603,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( aleck64 )
{
UINT8 *rom = memory_region(machine, "user2");
UINT8 *rom = machine->region("user2")->base();
rom[0x67c] = 0;
rom[0x67d] = 0;

View File

@ -696,7 +696,7 @@ static void alg_init(running_machine *machine)
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
memory_configure_bank(machine, "bank1", 1, 1, memory_region(machine, "user1"), 0);
memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
}
@ -709,8 +709,8 @@ static void alg_init(running_machine *machine)
static DRIVER_INIT( palr1 )
{
UINT32 length = memory_region_length(machine, "user2");
UINT8 *rom = memory_region(machine, "user2");
UINT32 length = machine->region("user2")->bytes();
UINT8 *rom = machine->region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@ -729,8 +729,8 @@ static DRIVER_INIT( palr1 )
static DRIVER_INIT( palr3 )
{
UINT32 length = memory_region_length(machine, "user2");
UINT8 *rom = memory_region(machine, "user2");
UINT32 length = machine->region("user2")->bytes();
UINT8 *rom = machine->region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@ -748,8 +748,8 @@ static DRIVER_INIT( palr3 )
static DRIVER_INIT( palr6 )
{
UINT32 length = memory_region_length(machine, "user2");
UINT8 *rom = memory_region(machine, "user2");
UINT32 length = machine->region("user2")->bytes();
UINT8 *rom = machine->region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@ -770,7 +770,7 @@ static DRIVER_INIT( palr6 )
static DRIVER_INIT( aplatoon )
{
/* NOT DONE TODO FIGURE OUT THE RIGHT ORDER!!!! */
UINT8 *rom = memory_region(machine, "user2");
UINT8 *rom = machine->region("user2")->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x40000);
int i;

View File

@ -238,7 +238,7 @@ static const k051960_interface aliens_k051960_intf =
static MACHINE_START( aliens )
{
aliens_state *state = machine->driver_data<aliens_state>();
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 20, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);

View File

@ -1895,7 +1895,7 @@ static MACHINE_RESET( common )
static MACHINE_START( alpha68k_V )
{
alpha68k_state *state = machine->driver_data<alpha68k_state>();
UINT8 *ROM = memory_region(machine, "audiocpu");
UINT8 *ROM = machine->region("audiocpu")->base();
memory_configure_bank(machine, "bank7", 0, 32, &ROM[0x10000], 0x4000);
@ -1931,7 +1931,7 @@ static MACHINE_RESET( alpha68k_II )
static MACHINE_START( alpha68k_II )
{
alpha68k_state *state = machine->driver_data<alpha68k_state>();
UINT8 *ROM = memory_region(machine, "audiocpu");
UINT8 *ROM = machine->region("audiocpu")->base();
memory_configure_bank(machine, "bank7", 0, 28, &ROM[0x10000], 0x4000);
@ -3152,7 +3152,7 @@ static DRIVER_INIT( btlfieldb )
static DRIVER_INIT( skysoldr )
{
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_set_bankptr(machine, "bank8", (memory_region(machine, "user1")) + 0x40000);
memory_set_bankptr(machine, "bank8", (machine->region("user1")->base()) + 0x40000);
state->invert_controls = 0;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@ -3171,7 +3171,7 @@ static DRIVER_INIT( goldmedl )
static DRIVER_INIT( goldmedla )
{
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_set_bankptr(machine, "bank8", memory_region(machine, "maincpu") + 0x20000);
memory_set_bankptr(machine, "bank8", machine->region("maincpu")->base() + 0x20000);
state->invert_controls = 0;
state->microcontroller_id = 0x8803; //Guess - routine to handle coinage is the same as in 'goldmedl'
state->coin_id = 0x23 | (0x24 << 8);
@ -3199,7 +3199,7 @@ static DRIVER_INIT( skyadvntu )
static DRIVER_INIT( gangwarsu )
{
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_set_bankptr(machine, "bank8", memory_region(machine, "user1"));
memory_set_bankptr(machine, "bank8", machine->region("user1")->base());
state->invert_controls = 0;
state->microcontroller_id = 0x8512;
state->coin_id = 0x23 | (0x24 << 8);
@ -3209,7 +3209,7 @@ static DRIVER_INIT( gangwarsu )
static DRIVER_INIT( gangwars )
{
alpha68k_state *state = machine->driver_data<alpha68k_state>();
memory_set_bankptr(machine, "bank8", memory_region(machine, "user1"));
memory_set_bankptr(machine, "bank8", machine->region("user1")->base());
state->invert_controls = 0;
state->microcontroller_id = 0x8512;
state->coin_id = 0x23 | (0x24 << 8);
@ -3219,7 +3219,7 @@ static DRIVER_INIT( gangwars )
static DRIVER_INIT( sbasebal )
{
alpha68k_state *state = machine->driver_data<alpha68k_state>();
UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu");
UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
/* Patch protection check, it does a divide by zero because the MCU is trying to
calculate the ball speed when a strike is scored, notice that current emulation

View File

@ -1406,8 +1406,8 @@ ROM_END
static DRIVER_INIT( rabbitpk )
{
UINT8 *rom = memory_region(machine, "maincpu");
int size = memory_region_length(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
int size = machine->region("maincpu")->bytes();
int start = 0;
int i;
@ -1458,7 +1458,7 @@ static DRIVER_INIT( piccolop )
*/
UINT8 *rom = memory_region(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
/* NOP'ing the mortal jump... */
rom[0x154b] = 0x00;

View File

@ -94,7 +94,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( amspdwy_port_r )
{
UINT8 *tracks = memory_region(space->machine, "maincpu") + 0x10000;
UINT8 *tracks = space->machine->region("maincpu")->base() + 0x10000;
return tracks[offset];
}

View File

@ -749,13 +749,13 @@ ROM_END
static DRIVER_INIT( angelkds )
{
UINT8 *RAM = memory_region(machine, "user1");
UINT8 *RAM = machine->region("user1")->base();
memory_configure_bank(machine, "bank1", 0, 8, &RAM[0x0000], 0x4000);
}
static DRIVER_INIT( spcpostn )
{
UINT8 *RAM = memory_region(machine, "user1");
UINT8 *RAM = machine->region("user1")->base();
sega_317_0005_decode(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 10, &RAM[0x0000], 0x4000);

View File

@ -177,7 +177,7 @@ static void appoooh_adpcm_int(device_t *device)
{
if (state->adpcm_data == 0xffffffff)
{
UINT8 *RAM = memory_region(device->machine, "adpcm");
UINT8 *RAM = device->machine->region("adpcm")->base();
state->adpcm_data = RAM[state->adpcm_address++];
msm5205_data_w(device, state->adpcm_data >> 4);
@ -597,7 +597,7 @@ static DRIVER_INIT(robowres)
static DRIVER_INIT(robowresb)
{
address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
space->set_decrypted_region(0x0000, 0x7fff, memory_region(machine, "maincpu") + 0x1c000);
space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x1c000);
}

View File

@ -62,7 +62,7 @@ Stephh's notes (based on the game M68000 code and some tests) :
#if AQUARIUS_HACK
static MACHINE_RESET( aquarium_hack )
{
UINT16 *RAM = (UINT16 *)memory_region(machine, "maincpu");
UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
int data = input_port_read(machine, "FAKE");
/* Language : 0x0000 = Japanese - Other value = English */
@ -279,13 +279,13 @@ static const gfx_layout tilelayout =
static DRIVER_INIT( aquarium )
{
UINT8 *Z80 = memory_region(machine, "audiocpu");
UINT8 *Z80 = machine->region("audiocpu")->base();
/* The BG tiles are 5bpp, this rearranges the data from
the roms containing the 1bpp data so we can decode it
correctly */
UINT8 *DAT2 = memory_region(machine, "gfx1") + 0x080000;
UINT8 *DAT = memory_region(machine, "user1");
UINT8 *DAT2 = machine->region("gfx1")->base() + 0x080000;
UINT8 *DAT = machine->region("user1")->base();
int len = 0x0200000;
for (len = 0; len < 0x020000; len++)
@ -300,8 +300,8 @@ static DRIVER_INIT( aquarium )
DAT2[len * 4 + 2] |= (DAT[len] & 0x01) << 3;
}
DAT2 = memory_region(machine, "gfx4") + 0x080000;
DAT = memory_region(machine, "user2");
DAT2 = machine->region("gfx4")->base() + 0x080000;
DAT = machine->region("user2")->base();
for (len = 0; len < 0x020000; len++)
{

View File

@ -398,7 +398,7 @@ ROM_END
static DRIVER_INIT( sparkz )
{
memset(memory_region(machine, "gfx1"), 0, memory_region_length(machine, "gfx1"));
memset(machine->region("gfx1")->base(), 0, machine->region("gfx1")->bytes());
}

View File

@ -727,7 +727,7 @@ ROM_END
INLINE void generic_decode(running_machine *machine, const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
{
UINT16 *rom = (UINT16 *)memory_region(machine, tag);
UINT16 *rom = (UINT16 *)machine->region(tag)->base();
int i;
/* only the low byte of ROMs are encrypted in these games */
@ -736,8 +736,8 @@ INLINE void generic_decode(running_machine *machine, const char *tag, int bit7,
#if 0
{
UINT8 *ROM = memory_region(machine, tag);
int size = memory_region_length(machine, tag);
UINT8 *ROM = machine->region(tag)->base();
int size = machine->region(tag)->bytes();
FILE *fp;
char filename[256];
@ -779,10 +779,10 @@ static void arcadia_init(running_machine *machine)
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
memory_configure_bank(machine, "bank1", 1, 1, memory_region(machine, "user1"), 0);
memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
/* OnePlay bios is encrypted, TenPlay is not */
biosrom = (UINT16 *)memory_region(machine, "user2");
biosrom = (UINT16 *)machine->region("user2")->base();
if (biosrom[0] != 0x4afc)
generic_decode(machine, "user2", 6, 1, 0, 2, 3, 4, 5, 7);
}

View File

@ -165,7 +165,7 @@ static const ym2203_interface ym2203_config =
static WRITE8_HANDLER( argus_bankselect_w )
{
UINT8 *RAM = memory_region(space->machine, "maincpu");
UINT8 *RAM = space->machine->region("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + ((data & 7) * 0x4000);

View File

@ -1168,7 +1168,7 @@ static PALETTE_INIT( aristmk4 )
static DRIVER_INIT( aristmk4 )
{
shapeRomPtr = (UINT8 *)memory_region(machine, "tile_gfx");
shapeRomPtr = (UINT8 *)machine->region("tile_gfx")->base();
memcpy(shapeRom,shapeRomPtr,sizeof(shapeRom)); // back up
}

View File

@ -211,7 +211,7 @@ INPUT_PORTS_END
static DRIVER_INIT( aristmk5 )
{
UINT8 *SRAM = memory_region(machine, "sram");
UINT8 *SRAM = machine->region("sram")->base();
archimedes_driver_init(machine);
memory_configure_bank(machine, "sram_bank", 0, 4, &SRAM[0], 0x8000);
@ -243,8 +243,8 @@ static MACHINE_RESET( aristmk5 )
/* load the roms according to what the operator wants */
{
UINT8 *ROM = memory_region(machine,"maincpu");
UINT8 *PRG = memory_region(machine,"prg_code");
UINT8 *ROM = machine->region("maincpu")->base();
UINT8 *PRG = machine->region("prg_code")->base();
int i;
UINT8 op_mode;

View File

@ -1470,7 +1470,7 @@ static DRIVER_INIT( block2 )
arkanoid_state *state = machine->driver_data<arkanoid_state>();
// the graphics on this bootleg have the data scrambled
int tile;
UINT8* srcgfx = memory_region(machine,"gfx1");
UINT8* srcgfx = machine->region("gfx1")->base();
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x18000);
for (tile = 0; tile < 0x3000; tile++)
@ -1532,7 +1532,7 @@ static DRIVER_INIT( paddle2 )
static DRIVER_INIT( tetrsark )
{
UINT8 *ROM = memory_region(machine, "maincpu");
UINT8 *ROM = machine->region("maincpu")->base();
int x;
for (x = 0; x < 0x8000; x++)
@ -1546,7 +1546,7 @@ static DRIVER_INIT( tetrsark )
static DRIVER_INIT( hexa )
{
UINT8 *RAM = memory_region(machine, "maincpu");
UINT8 *RAM = machine->region("maincpu")->base();
#if 0

View File

@ -1530,7 +1530,7 @@ static DRIVER_INIT( legion )
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
UINT16 *RAM = (UINT16 *)memory_region(machine, "maincpu");
UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
RAM[0x0001d6 / 2] = 0x0001;
/* To avoid checksum error */
RAM[0x000488 / 2] = 0x4e71;
@ -1545,7 +1545,7 @@ static DRIVER_INIT( legiono )
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
UINT16 *RAM = (UINT16 *)memory_region(machine, "maincpu");
UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
RAM[0x0001d6/2] = 0x0001;
/* No need to patch the checksum routine (see notes) ! */
#endif

View File

@ -467,7 +467,7 @@ ROM_END
static DRIVER_INIT( ashnojoe )
{
UINT8 *ROM = memory_region(machine, "adpcm");
UINT8 *ROM = machine->region("adpcm")->base();
memory_configure_bank(machine, "bank4", 0, 16, &ROM[0x00000], 0x8000);
memory_set_bank(machine, "bank4", 0);

View File

@ -468,8 +468,8 @@ ROM_END
static DRIVER_INIT( asterix )
{
#if 0
*(UINT16 *)(memory_region(machine, "maincpu") + 0x07f34) = 0x602a;
*(UINT16 *)(memory_region(machine, "maincpu") + 0x00008) = 0x0400;
*(UINT16 *)(machine->region("maincpu")->base() + 0x07f34) = 0x602a;
*(UINT16 *)(machine->region("maincpu")->base() + 0x00008) = 0x0400;
#endif
}

View File

@ -154,7 +154,7 @@ static void plot_byte( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT
static VIDEO_UPDATE( astinvad )
{
astinvad_state *state = screen->machine->driver_data<astinvad_state>();
const UINT8 *color_prom = memory_region(screen->machine, "proms");
const UINT8 *color_prom = screen->machine->region("proms")->base();
UINT8 yoffs = state->flip_yoffs & state->screen_flip;
int x, y;
@ -174,7 +174,7 @@ static VIDEO_UPDATE( astinvad )
static VIDEO_UPDATE( spaceint )
{
astinvad_state *state = screen->machine->driver_data<astinvad_state>();
const UINT8 *color_prom = memory_region(screen->machine, "proms");
const UINT8 *color_prom = screen->machine->region("proms")->base();
int offs;
for (offs = 0; offs < state->videoram_size; offs++)

View File

@ -430,14 +430,14 @@ static WRITE8_HANDLER( profpac_banksw_w )
/* set the main banking */
memory_install_read_bank(space, 0x4000, 0xbfff, 0, 0, "bank1");
memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "user1") + 0x8000 * bank);
memory_set_bankptr(space->machine, "bank1", space->machine->region("user1")->base() + 0x8000 * bank);
/* bank 0 reads video RAM in the 4000-7FFF range */
if (bank == 0)
memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, profpac_videoram_r);
/* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
if ((data & 0x80) && memory_region(space->machine, "user2") != NULL)
if ((data & 0x80) && space->machine->region("user2")->base() != NULL)
{
/* Note: There is a jumper which could change the base offset to 0xa8 instead */
bank = data - 0x80;
@ -446,7 +446,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
if (bank < 0x28)
{
memory_install_read_bank(space, 0x4000, 0x7fff, 0, 0, "bank2");
memory_set_bankptr(space->machine, "bank2", memory_region(space->machine, "user2") + 0x4000 * bank);
memory_set_bankptr(space->machine, "bank2", space->machine->region("user2")->base() + 0x4000 * bank);
}
else
memory_unmap_read(space, 0x4000, 0x7fff, 0, 0);

View File

@ -963,7 +963,7 @@ ROM_END
static DRIVER_INIT( showhand )
{
#if 0
UINT16 *rom = (UINT16*)memory_region(machine, "maincpu");
UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
rom[0x0a1a/2] = 0x6000; // hopper jam
@ -979,7 +979,7 @@ static DRIVER_INIT( showhand )
static DRIVER_INIT( showhanc )
{
#if 0
UINT16 *rom = (UINT16*)memory_region(machine, "maincpu");
UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
rom[0x14d4/2] = 0x4e71; // enable full test mode
rom[0x14d6/2] = 0x4e71; // ""

View File

@ -209,7 +209,7 @@ static void astrof_get_pens( running_machine *machine, pen_t *pens )
offs_t i;
UINT8 bank = (state->astrof_palette_bank ? 0x10 : 0x00);
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
UINT8 *prom = memory_region(machine, "proms");
UINT8 *prom = machine->region("proms")->base();
/* a common wire hack to the pcb causes the prom halves to be inverted */
/* this results in e.g. astrof background being black */
@ -243,7 +243,7 @@ static void astrof_get_pens( running_machine *machine, pen_t *pens )
static void tomahawk_get_pens( running_machine *machine, pen_t *pens )
{
offs_t i;
UINT8 *prom = memory_region(machine, "proms");
UINT8 *prom = machine->region("proms")->base();
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
@ -1297,8 +1297,8 @@ ROM_END
static DRIVER_INIT( abattle )
{
/* use the protection PROM to decrypt the ROMs */
UINT8 *rom = memory_region(machine, "maincpu");
UINT8 *prom = memory_region(machine, "user1");
UINT8 *rom = machine->region("maincpu")->base();
UINT8 *prom = machine->region("user1")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
@ -1312,7 +1312,7 @@ static DRIVER_INIT( abattle )
static DRIVER_INIT( afire )
{
UINT8 *rom = memory_region(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
@ -1326,7 +1326,7 @@ static DRIVER_INIT( afire )
static DRIVER_INIT( sstarbtl )
{
UINT8 *rom = memory_region(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)

View File

@ -270,7 +270,7 @@ static void asuka_msm5205_vck( device_t *device )
}
else
{
state->adpcm_data = memory_region(device->machine, "ymsnd")[state->adpcm_pos];
state->adpcm_data = device->machine->region("ymsnd")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->adpcm_data >> 4);
}
@ -843,8 +843,8 @@ static MACHINE_START( asuka )
state->tc0100scn = machine->device("tc0100scn");
/* configure the banks */
memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, "audiocpu"), 0);
memory_configure_bank(machine, "bank1", 1, 3, memory_region(machine, "audiocpu") + 0x10000, 0x04000);
memory_configure_bank(machine, "bank1", 0, 1, machine->region("audiocpu")->base(), 0);
memory_configure_bank(machine, "bank1", 1, 3, machine->region("audiocpu")->base() + 0x10000, 0x04000);
state_save_register_global(machine, state->adpcm_pos);
state_save_register_global(machine, state->adpcm_data);

View File

@ -727,7 +727,7 @@ static DRIVER_INIT( guardian )
/* it looks like they jsr to $80000 as some kind of protection */
/* put an RTS there so we don't die */
*(UINT16 *)&memory_region(machine, "maincpu")[0x80000] = 0x4E75;
*(UINT16 *)&machine->region("maincpu")->base()[0x80000] = 0x4E75;
address_space *main = machine->device<m68000_device>("maincpu")->space(AS_PROGRAM);
state->sloop_base = memory_install_readwrite16_handler(main, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_r, guardians_sloop_data_w);

View File

@ -339,7 +339,7 @@ static WRITE16_HANDLER( bankselect_w )
COMBINE_DATA(&newword);
state->bankselect[offset] = newword;
base = &memory_region(space->machine, "maincpu")[bankoffset[(newword >> 10) & 0x3f]];
base = &space->machine->region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
memcpy(offset ? state->rombank2 : state->rombank1, base, 0x2000);
}
@ -3080,7 +3080,7 @@ static DRIVER_INIT( paperboy )
{
int i;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
UINT8 *cpu1 = memory_region(machine, "maincpu");
UINT8 *cpu1 = machine->region("maincpu")->base();
slapstic_init(machine, 105);
@ -3116,7 +3116,7 @@ static DRIVER_INIT( ssprint )
{
atarisy2_state *state = machine->driver_data<atarisy2_state>();
int i;
UINT8 *cpu1 = memory_region(machine, "maincpu");
UINT8 *cpu1 = machine->region("maincpu")->base();
slapstic_init(machine, 108);
@ -3133,7 +3133,7 @@ static DRIVER_INIT( csprint )
{
int i;
atarisy2_state *state = machine->driver_data<atarisy2_state>();
UINT8 *cpu1 = memory_region(machine, "maincpu");
UINT8 *cpu1 = machine->region("maincpu")->base();
slapstic_init(machine, 109);

View File

@ -940,13 +940,13 @@ static DRIVER_INIT( laststar )
shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
/* Populate the 68000 address space with data from the HEX files */
load_hexfile(main, memory_region(machine, "code"));
load_hexfile(main, memory_region(machine, "data"));
load_hexfile(main, machine->region("code")->base());
load_hexfile(main, machine->region("data")->base());
/* Set up the DSP */
memory_set_bankptr(machine, "dsp0_bank0", shared_ram[0]);
memory_set_bankptr(machine, "dsp0_bank1", &shared_ram[0][0x800]);
load_ldafile(cputag_get_address_space(machine, "dsp0", ADDRESS_SPACE_PROGRAM), memory_region(machine, "dsp"));
load_ldafile(cputag_get_address_space(machine, "dsp0", ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
}
static DRIVER_INIT( airrace )
@ -956,17 +956,17 @@ static DRIVER_INIT( airrace )
shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000);
/* Populate RAM with data from the HEX files */
load_hexfile(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), memory_region(machine, "code"));
load_hexfile(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), machine->region("code")->base());
/* Set up the first DSP */
memory_set_bankptr(machine, "dsp0_bank0", shared_ram[0]);
memory_set_bankptr(machine, "dsp0_bank1", &shared_ram[0][0x800]);
load_ldafile(cputag_get_address_space(machine, "dsp0", ADDRESS_SPACE_PROGRAM), memory_region(machine, "dsp"));
load_ldafile(cputag_get_address_space(machine, "dsp0", ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
/* Set up the second DSP */
memory_set_bankptr(machine, "dsp1_bank0", shared_ram[1]);
memory_set_bankptr(machine, "dsp1_bank1", &shared_ram[1][0x800]);
load_ldafile(cputag_get_address_space(machine, "dsp1", ADDRESS_SPACE_PROGRAM), memory_region(machine, "dsp"));
load_ldafile(cputag_get_address_space(machine, "dsp1", ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
}
static MACHINE_RESET( atarisy4 )

View File

@ -494,7 +494,7 @@ ROM_END
static DRIVER_INIT( atetris )
{
UINT8 *rgn = memory_region(machine, "maincpu");
UINT8 *rgn = machine->region("maincpu")->base();
slapstic_init(machine, 101);
slapstic_source = &rgn[0x10000];
slapstic_base = &rgn[0x04000];

View File

@ -645,7 +645,7 @@ ROM_END
static void descramble_sound( running_machine *machine )
{
UINT8 *rom = memory_region(machine, "ymz");
UINT8 *rom = machine->region("ymz")->base();
int length = 0x200000; // only the first rom is swapped on backfire!
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;

View File

@ -591,8 +591,8 @@ static DRIVER_INIT( badlands )
badlands_state *state = machine->driver_data<badlands_state>();
/* initialize the audio system */
state->bank_base = &memory_region(machine, "audiocpu")[0x03000];
state->bank_source_data = &memory_region(machine, "audiocpu")[0x10000];
state->bank_base = &machine->region("audiocpu")->base()[0x03000];
state->bank_source_data = &machine->region("audiocpu")->base()[0x10000];
}

View File

@ -2046,8 +2046,8 @@ static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
UINT8 *temp = auto_alloc_array(machine, UINT8, 0x20000);
{
UINT8 *rom = memory_region(machine, "maincpu");
UINT32 len = memory_region_length(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
UINT32 len = machine->region("maincpu")->bytes();
UINT32 base;
for (base = 0x10000; base < len; base += 0x30000)
@ -2121,7 +2121,7 @@ static DRIVER_INIT( stocker ) { expand_roms(machine, EXPAND_ALL); config_shoot
static DRIVER_INIT( triviag1 ) { expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( triviag2 )
{
UINT8 *rom = memory_region(machine, "maincpu");
UINT8 *rom = machine->region("maincpu")->base();
memcpy(&rom[0x20000], &rom[0x28000], 0x4000);
memcpy(&rom[0x24000], &rom[0x28000], 0x4000);
expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0 /* noanalog */);

View File

@ -537,7 +537,7 @@ static DRIVER_INIT( baraduke )
int i;
/* unpack the third tile ROM */
rom = memory_region(machine, "gfx2") + 0x8000;
rom = machine->region("gfx2")->base() + 0x8000;
for (i = 0x2000;i < 0x4000;i++)
{
rom[i + 0x2000] = rom[i];

View File

@ -281,9 +281,9 @@ ROM_END
static DRIVER_INIT( battlex )
{
UINT8 *cold = memory_region(machine, "user1");
UINT8 *mskd = memory_region(machine, "user2");
UINT8 *dest = memory_region(machine, "gfx1");
UINT8 *cold = machine->region("user1")->base();
UINT8 *mskd = machine->region("user2")->base();
UINT8 *dest = machine->region("gfx1")->base();
int outcount;

Some files were not shown because too many files have changed in this diff Show More