mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
Added device_t::memory() to fetch a reference to the memory interface,
or assert if not present. Split address_space::install_[legacy_]handler into install_[legacy_]read_handler, install_[legacy_]write_handler, and install_[legacy_]readwrite_handler. Added variants of address_space handler installers which don't take mirror or mask parameters, since this is by far the most common case. Deprecated API cleanup. Simple search & replace: cpu_suspend ==> device_suspend cpu_resume ==> device_resume cpu_yield ==> device_yield cpu_spin ==> device_spin cpu_spinuntil_trigger ==> device_spin_until_trigger cpu_spinuntil_time ==> device_spin_until_time cpu_spinuntil_int ==> device_spin_until_interrupt cpu_eat_cycles ==> device_eat_cycles cpu_adjust_icount ==> device_adjust_icount cpu_triggerint ==> device_triggerint cpu_set_input_line ==> device_set_input_line cpu_set_input_line_vector ==> device_set_input_line_vector cpu_set_input_line_and_vector ==> device_set_input_line_and_vector cpu_set_irq_callback ==> device_set_irq_callback More complex changes: device_memory(device) ==> device->memory() device_get_space(device, spacenum) ==> device->memory().space(spacenum) cpu_get_address_space(cpu, spacenum) ==> cpu->memory().space(spacenum) cputag_get_address_space(mach, tag, spacenum) ==> mach->device("tag")->memory().space(spacenum) cputag_get_clock(mach, tag) ==> mach->device("tag")->unscaled_clock() cputag_set_clock(mach, tag, hz) ==> mach->device("tag")->set_unscaled_clock(hz) Some regex'es for the more prevalent cases above: S: cpu_get_address_space( *)\(( *)([^,]+)( *), * R: \3->memory().space\1\(\2 S: cputag_get_address_space( *)\(( *)([^,]+)( *),( *)([^,]+)( *), * R: \3->device\1\(\2\6\7\)->memory().space\1\(\2 S: cputag_get_clock( *)\(( *)([^,]+)( *),( *)([^ )]+) *\) R: \3->device\1\(\2\6\7\)->unscaled_clock\(\)
This commit is contained in:
parent
d89c4e7b8b
commit
4b3aa02618
@ -1561,7 +1561,7 @@ static void cp1610_xori(cp1610_state *cpustate, int d)
|
||||
static CPU_RESET( cp1610 )
|
||||
{
|
||||
/* This is how we set the reset vector */
|
||||
cpu_set_input_line(device, CP1610_RESET, PULSE_LINE);
|
||||
device_set_input_line(device, CP1610_RESET, PULSE_LINE);
|
||||
}
|
||||
|
||||
/***************************************************
|
||||
|
@ -482,7 +482,7 @@ static CPU_EXECUTE( jaguargpu )
|
||||
/* if we're halted, we shouldn't be here */
|
||||
if (!(jaguar->ctrl[G_CTRL] & 1))
|
||||
{
|
||||
//cpu_set_input_line(device, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
//device_set_input_line(device, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
jaguar->icount = 0;
|
||||
return;
|
||||
}
|
||||
@ -521,7 +521,7 @@ static CPU_EXECUTE( jaguardsp )
|
||||
/* if we're halted, we shouldn't be here */
|
||||
if (!(jaguar->ctrl[G_CTRL] & 1))
|
||||
{
|
||||
//cpu_set_input_line(device, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
//device_set_input_line(device, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
jaguar->icount = 0;
|
||||
return;
|
||||
}
|
||||
@ -1299,8 +1299,8 @@ void jaguargpu_ctrl_w(device_t *device, offs_t offset, UINT32 data, UINT32 mem_m
|
||||
jaguar->ctrl[offset] = newval;
|
||||
if ((oldval ^ newval) & 0x01)
|
||||
{
|
||||
cpu_set_input_line(device, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
cpu_yield(device);
|
||||
device_set_input_line(device, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
device_yield(device);
|
||||
}
|
||||
if (newval & 0x02)
|
||||
{
|
||||
@ -1398,8 +1398,8 @@ void jaguardsp_ctrl_w(device_t *device, offs_t offset, UINT32 data, UINT32 mem_m
|
||||
jaguar->ctrl[offset] = newval;
|
||||
if ((oldval ^ newval) & 0x01)
|
||||
{
|
||||
cpu_set_input_line(device, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
cpu_yield(device);
|
||||
device_set_input_line(device, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
device_yield(device);
|
||||
}
|
||||
if (newval & 0x02)
|
||||
{
|
||||
|
@ -270,7 +270,7 @@ static TIMER_CALLBACK( m37710_timer_cb )
|
||||
|
||||
cpustate->m37710_regs[m37710_irq_levels[curirq]] |= 0x04;
|
||||
m37710_set_irq_line(cpustate, curirq, PULSE_LINE);
|
||||
cpu_triggerint(cpustate->device);
|
||||
device_triggerint(cpustate->device);
|
||||
}
|
||||
|
||||
static void m37710_external_tick(m37710i_cpu_struct *cpustate, int timer, int state)
|
||||
|
@ -46,7 +46,7 @@ enum
|
||||
};
|
||||
|
||||
#define M6502_IRQ_LINE 0
|
||||
/* use cpu_set_input_line(cpudevice, M6502_SET_OVERFLOW, level)
|
||||
/* use device_set_input_line(cpudevice, M6502_SET_OVERFLOW, level)
|
||||
to change level of the so input line
|
||||
positiv edge sets overflow flag */
|
||||
#define M6502_SET_OVERFLOW 1
|
||||
|
@ -34,7 +34,7 @@ enum
|
||||
};
|
||||
|
||||
#define M6509_IRQ_LINE M6502_IRQ_LINE
|
||||
/* use cpu_set_input_line(cpudevice, M6509_SET_OVERFLOW, level)
|
||||
/* use device_set_input_line(cpudevice, M6509_SET_OVERFLOW, level)
|
||||
to change level of the so input line
|
||||
positiv edge sets overflow flag */
|
||||
#define M6509_SET_OVERFLOW 3
|
||||
|
@ -753,7 +753,7 @@ void mips3com_get_info(mips3_state *mips, UINT32 state, cpuinfo *info)
|
||||
static TIMER_CALLBACK( compare_int_callback )
|
||||
{
|
||||
legacy_cpu_device *device = (legacy_cpu_device *)ptr;
|
||||
cpu_set_input_line(device, MIPS3_IRQ5, ASSERT_LINE);
|
||||
device_set_input_line(device, MIPS3_IRQ5, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1031,8 +1031,8 @@ void sh4_set_irln_input(device_t *device, int value)
|
||||
if (sh4->irln == value)
|
||||
return;
|
||||
sh4->irln = value;
|
||||
cpu_set_input_line(device, SH4_IRLn, ASSERT_LINE);
|
||||
cpu_set_input_line(device, SH4_IRLn, CLEAR_LINE);
|
||||
device_set_input_line(device, SH4_IRLn, ASSERT_LINE);
|
||||
device_set_input_line(device, SH4_IRLn, CLEAR_LINE);
|
||||
}
|
||||
|
||||
void sh4_set_irq_line(sh4_state *sh4, int irqline, int state) // set state of external interrupt line
|
||||
|
@ -96,7 +96,7 @@ static void unimpl(tms34010_state *tms, UINT16 op)
|
||||
/* extra check to prevent bad things */
|
||||
if (tms->pc == 0 || opcode_table[tms->direct->read_decrypted_word(TOBYTE(tms->pc)) >> 4] == unimpl)
|
||||
{
|
||||
cpu_set_input_line(tms->device, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
device_set_input_line(tms->device, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
debugger_break(tms->device->machine);
|
||||
}
|
||||
}
|
||||
|
@ -769,7 +769,7 @@ static TIMER_CALLBACK( internal_interrupt_callback )
|
||||
LOG(("TMS34010 '%s' set internal interrupt $%04x\n", tms->device->tag(), type));
|
||||
|
||||
/* generate triggers so that spin loops can key off them */
|
||||
cpu_triggerint(tms->device);
|
||||
device_triggerint(tms->device);
|
||||
}
|
||||
|
||||
|
||||
@ -1196,7 +1196,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
|
||||
/* if the CPU is halting itself, stop execution right away */
|
||||
if ((data & 0x8000) && !tms->external_host_access)
|
||||
tms->icount = 0;
|
||||
cpu_set_input_line(tms->device, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(tms->device, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* NMI issued? */
|
||||
if (data & 0x0100)
|
||||
@ -1347,7 +1347,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
|
||||
/* if the CPU is halting itself, stop execution right away */
|
||||
if ((data & 0x8000) && !tms->external_host_access)
|
||||
tms->icount = 0;
|
||||
cpu_set_input_line(tms->device, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(tms->device, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* NMI issued? */
|
||||
if (data & 0x0100)
|
||||
|
@ -545,7 +545,7 @@ static void tms7000_service_timer1( device_t *device )
|
||||
if( --cpustate->t1_decrementer < 0 ) /* Decrement timer1 register and check for underflow */
|
||||
{
|
||||
cpustate->t1_decrementer = cpustate->pf[2]; /* Reload decrementer (8 bit) */
|
||||
cpu_set_input_line(device, TMS7000_IRQ2_LINE, HOLD_LINE);
|
||||
device_set_input_line(device, TMS7000_IRQ2_LINE, HOLD_LINE);
|
||||
//LOG( ("tms7000: trigger int2 (cycles: %d)\t%d\tdelta %d\n", cpustate->device->total_cycles(), cpustate->device->total_cycles() - tick, cpustate->cycles_per_INT2-(cpustate->device->total_cycles() - tick) );
|
||||
//tick = cpustate->device->total_cycles() );
|
||||
/* Also, cascade out to timer 2 - timer 2 unimplemented */
|
||||
|
@ -568,7 +568,7 @@ int debug_command_parameter_cpu_space(running_machine *machine, const char *para
|
||||
return FALSE;
|
||||
|
||||
/* fetch the space pointer */
|
||||
*result = cpu_get_address_space(cpu, spacenum);
|
||||
*result = cpu->memory().space(spacenum);
|
||||
if (*result == NULL)
|
||||
{
|
||||
debug_console_printf(machine, "No matching memory space found for CPU '%s'\n", cpu->tag());
|
||||
|
@ -486,7 +486,7 @@ UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translati
|
||||
result = 0xff;
|
||||
|
||||
/* if there is a custom read handler, and it returns true, use that value */
|
||||
else if (device_memory(space->cpu)->read(space->spacenum(), address, 1, custom))
|
||||
else if (space->cpu->memory().read(space->spacenum(), address, 1, custom))
|
||||
result = custom;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -539,7 +539,7 @@ UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translat
|
||||
result = 0xffff;
|
||||
|
||||
/* if there is a custom read handler, and it returns true, use that value */
|
||||
else if (device_memory(space->cpu)->read(space->spacenum(), address, 2, custom))
|
||||
else if (space->cpu->memory().read(space->spacenum(), address, 2, custom))
|
||||
result = custom;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -594,7 +594,7 @@ UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_transla
|
||||
result = 0xffffffff;
|
||||
|
||||
/* if there is a custom read handler, and it returns true, use that value */
|
||||
else if (device_memory(space->cpu)->read(space->spacenum(), address, 4, custom))
|
||||
else if (space->cpu->memory().read(space->spacenum(), address, 4, custom))
|
||||
result = custom;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -649,7 +649,7 @@ UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_transla
|
||||
result = ~(UINT64)0;
|
||||
|
||||
/* if there is a custom read handler, and it returns true, use that value */
|
||||
else if (device_memory(space->cpu)->read(space->spacenum(), address, 8, custom))
|
||||
else if (space->cpu->memory().read(space->spacenum(), address, 8, custom))
|
||||
result = custom;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -704,7 +704,7 @@ void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int app
|
||||
;
|
||||
|
||||
/* if there is a custom write handler, and it returns true, use that */
|
||||
else if (device_memory(space->cpu)->write(space->spacenum(), address, 1, data))
|
||||
else if (space->cpu->memory().write(space->spacenum(), address, 1, data))
|
||||
;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -756,7 +756,7 @@ void debug_write_word(address_space *_space, offs_t address, UINT16 data, int ap
|
||||
;
|
||||
|
||||
/* if there is a custom write handler, and it returns true, use that */
|
||||
else if (device_memory(space->cpu)->write(space->spacenum(), address, 2, data))
|
||||
else if (space->cpu->memory().write(space->spacenum(), address, 2, data))
|
||||
;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -809,7 +809,7 @@ void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int a
|
||||
;
|
||||
|
||||
/* if there is a custom write handler, and it returns true, use that */
|
||||
else if (device_memory(space->cpu)->write(space->spacenum(), address, 4, data))
|
||||
else if (space->cpu->memory().write(space->spacenum(), address, 4, data))
|
||||
;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -862,7 +862,7 @@ void debug_write_qword(address_space *_space, offs_t address, UINT64 data, int a
|
||||
;
|
||||
|
||||
/* if there is a custom write handler, and it returns true, use that */
|
||||
else if (device_memory(space->cpu)->write(space->spacenum(), address, 8, data))
|
||||
else if (space->cpu->memory().write(space->spacenum(), address, 8, data))
|
||||
;
|
||||
|
||||
/* otherwise, call the byte reading function for the translated address */
|
||||
@ -1180,7 +1180,7 @@ static UINT64 expression_read_memory(void *param, const char *name, int spacenum
|
||||
device = expression_get_device(machine, name);
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
|
||||
space = device->memory().space(ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
|
||||
if (space != NULL)
|
||||
result = debug_read_memory(space, space->address_to_byte(address), size, true);
|
||||
break;
|
||||
@ -1193,7 +1193,7 @@ static UINT64 expression_read_memory(void *param, const char *name, int spacenum
|
||||
device = expression_get_device(machine, name);
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
|
||||
space = device->memory().space(ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
|
||||
if (space != NULL)
|
||||
result = debug_read_memory(space, space->address_to_byte(address), size, false);
|
||||
break;
|
||||
@ -1204,7 +1204,7 @@ static UINT64 expression_read_memory(void *param, const char *name, int spacenum
|
||||
device = expression_get_device(machine, name);
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
result = expression_read_program_direct(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size);
|
||||
result = expression_read_program_direct(device->memory().space(ADDRESS_SPACE_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size);
|
||||
break;
|
||||
|
||||
case EXPSPACE_REGION:
|
||||
@ -1348,7 +1348,7 @@ static void expression_write_memory(void *param, const char *name, int spacenum,
|
||||
device = expression_get_device(machine, name);
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
|
||||
space = device->memory().space(ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
|
||||
if (space != NULL)
|
||||
debug_write_memory(space, space->address_to_byte(address), data, size, true);
|
||||
break;
|
||||
@ -1361,7 +1361,7 @@ static void expression_write_memory(void *param, const char *name, int spacenum,
|
||||
device = expression_get_device(machine, name);
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
|
||||
space = device->memory().space(ADDRESS_SPACE_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
|
||||
if (space != NULL)
|
||||
debug_write_memory(space, space->address_to_byte(address), data, size, false);
|
||||
break;
|
||||
@ -1372,7 +1372,7 @@ static void expression_write_memory(void *param, const char *name, int spacenum,
|
||||
device = expression_get_device(machine, name);
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
expression_write_program_direct(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size, data);
|
||||
expression_write_program_direct(device->memory().space(ADDRESS_SPACE_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size, data);
|
||||
break;
|
||||
|
||||
case EXPSPACE_REGION:
|
||||
@ -1531,7 +1531,7 @@ static expression_error::error_code expression_validate(void *param, const char
|
||||
}
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
if (cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM_LOGICAL)) == NULL)
|
||||
if (device->memory().space(ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM_LOGICAL)) == NULL)
|
||||
return expression_error::NO_SUCH_MEMORY_SPACE;
|
||||
break;
|
||||
|
||||
@ -1547,7 +1547,7 @@ static expression_error::error_code expression_validate(void *param, const char
|
||||
}
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
if (cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM_PHYSICAL)) == NULL)
|
||||
if (device->memory().space(ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM_PHYSICAL)) == NULL)
|
||||
return expression_error::NO_SUCH_MEMORY_SPACE;
|
||||
break;
|
||||
|
||||
@ -1561,7 +1561,7 @@ static expression_error::error_code expression_validate(void *param, const char
|
||||
}
|
||||
if (device == NULL)
|
||||
device = debug_cpu_get_visible_cpu(machine);
|
||||
if (cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM) == NULL)
|
||||
if (device->memory().space(ADDRESS_SPACE_PROGRAM) == NULL)
|
||||
return expression_error::NO_SUCH_MEMORY_SPACE;
|
||||
break;
|
||||
|
||||
|
@ -61,7 +61,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
|
||||
|
||||
resolved->target = resolved;
|
||||
resolved->read = trampoline_read8_to_read_line;
|
||||
resolved->realtarget = device_get_space(targetdev, spacenum);
|
||||
resolved->realtarget = targetdev->memory().space(spacenum);
|
||||
if (resolved->realtarget == NULL)
|
||||
fatalerror("devcb_resolve_read_line: unable to find device '%s' space %d (requested by %s '%s')", config->tag, (int)spacenum, device->name(), device->tag());
|
||||
resolved->real.readspace = config->readspace;
|
||||
@ -120,7 +120,7 @@ static WRITE_LINE_DEVICE_HANDLER( trampoline_writecpu_to_write_line )
|
||||
{
|
||||
const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device;
|
||||
device_t *targetdev = (device_t *)resolved->realtarget;
|
||||
cpu_set_input_line(targetdev, resolved->real.writeline, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(targetdev, resolved->real.writeline, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_write_line *config, device_t *device)
|
||||
@ -150,7 +150,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
|
||||
|
||||
resolved->target = resolved;
|
||||
resolved->write = trampoline_write8_to_write_line;
|
||||
resolved->realtarget = device_get_space(targetdev, spacenum);
|
||||
resolved->realtarget = targetdev->memory().space(spacenum);
|
||||
if (resolved->realtarget == NULL)
|
||||
fatalerror("devcb_resolve_write_line: unable to find device '%s' space %d (requested by %s '%s')", config->tag, (int)spacenum, device->name(), device->tag());
|
||||
resolved->real.writespace = config->writespace;
|
||||
@ -246,7 +246,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
|
||||
if (!targetdev->interface(memory))
|
||||
fatalerror("devcb_resolve_read8: device '%s' (requested by %s '%s') has no memory", config->tag, device->name(), device->tag());
|
||||
|
||||
resolved->target = device_get_space(targetdev, spacenum);
|
||||
resolved->target = targetdev->memory().space(spacenum);
|
||||
if (resolved->target == NULL)
|
||||
fatalerror("devcb_resolve_read8: unable to find device '%s' space %d (requested by %s '%s')", config->tag, (int)spacenum, device->name(), device->tag());
|
||||
resolved->read = (read8_device_func)config->readspace;
|
||||
@ -325,7 +325,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
|
||||
if (!targetdev->interface(memory))
|
||||
fatalerror("devcb_resolve_write8: device '%s' (requested by %s '%s') has no memory", config->tag, device->name(), device->tag());
|
||||
|
||||
resolved->target = device_get_space(targetdev, spacenum);
|
||||
resolved->target = targetdev->memory().space(spacenum);
|
||||
if (resolved->target == NULL)
|
||||
fatalerror("devcb_resolve_write8: unable to find device '%s' space %d (requested by %s '%s')", config->tag, (int)spacenum, device->name(), device->tag());
|
||||
resolved->write = (write8_device_func)config->writespace;
|
||||
|
@ -284,31 +284,7 @@ const device_type name = basename##_device_config::static_alloc_device_config
|
||||
#define CPU_EXPORT_STRING_CALL(name) CPU_EXPORT_STRING_NAME(name)(device, entry, string)
|
||||
|
||||
|
||||
// helpers for accessing common CPU state
|
||||
|
||||
// CPU scheduling
|
||||
#define cpu_suspend device_suspend
|
||||
#define cpu_resume device_resume
|
||||
|
||||
// synchronization helpers
|
||||
#define cpu_yield device_yield
|
||||
#define cpu_spin device_spin
|
||||
#define cpu_spinuntil_trigger device_spin_until_trigger
|
||||
#define cpu_spinuntil_time device_spin_until_time
|
||||
#define cpu_spinuntil_int device_spin_until_interrupt
|
||||
|
||||
// CPU timing
|
||||
#define cpu_eat_cycles device_eat_cycles
|
||||
#define cpu_adjust_icount device_adjust_icount
|
||||
|
||||
#define cpu_triggerint device_triggerint
|
||||
#define cpu_set_input_line device_set_input_line
|
||||
#define cpu_set_input_line_vector device_set_input_line_vector
|
||||
#define cpu_set_input_line_and_vector device_set_input_line_and_vector
|
||||
#define cpu_set_irq_callback device_set_irq_callback
|
||||
|
||||
#define cpu_get_address_space device_get_space
|
||||
|
||||
#define cpu_get_reg(cpu, _reg) device_state(cpu)->state(_reg)
|
||||
#define cpu_get_previouspc(cpu) ((offs_t)device_state(cpu)->state(STATE_GENPCBASE))
|
||||
#define cpu_get_pc(cpu) ((offs_t)device_state(cpu)->state(STATE_GENPC))
|
||||
@ -318,12 +294,8 @@ const device_type name = basename##_device_config::static_alloc_device_config
|
||||
#define INTERRUPT_GEN(func) void func(device_t *device)
|
||||
|
||||
// helpers for using machine/cputag instead of cpu objects
|
||||
#define cputag_get_address_space(mach, tag, spc) downcast<cpu_device *>((mach)->device(tag))->space(spc)
|
||||
#define cputag_get_clock(mach, tag) (mach)->device(tag)->unscaled_clock()
|
||||
#define cputag_set_clock(mach, tag, clock) (mach)->device(tag)->set_unscaled_clock(clock)
|
||||
|
||||
#define cputag_set_input_line(mach, tag, line, state) downcast<cpu_device *>((mach)->device(tag))->set_input_line(line, state)
|
||||
#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) downcast<cpu_device *>((mach)->device(tag))->set_input_line_and_vector(line, state, vec)
|
||||
#define cputag_set_input_line(mach, tag, line, state) device_execute((mach)->device(tag))->set_input_line(line, state)
|
||||
#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach)->device(tag))->set_input_line_and_vector(line, state, vec)
|
||||
|
||||
|
||||
|
||||
|
@ -401,7 +401,8 @@ public:
|
||||
|
||||
// interface helpers
|
||||
template<class T> bool interface(T *&intf) { intf = dynamic_cast<T *>(this); return (intf != NULL); }
|
||||
template<class T> bool next(T *&intf)
|
||||
template<class T> bool interface(T *&intf) const { intf = dynamic_cast<const T *>(this); return (intf != NULL); }
|
||||
template<class T> bool next(T *&intf) const
|
||||
{
|
||||
for (device_t *cur = m_next; cur != NULL; cur = cur->m_next)
|
||||
if (cur->interface(intf))
|
||||
@ -409,10 +410,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// specialized helpers
|
||||
bool interface(device_execute_interface *&intf) { intf = m_execute; return (intf != NULL); }
|
||||
bool interface(device_memory_interface *&intf) { intf = m_memory; return (intf != NULL); }
|
||||
bool interface(device_state_interface *&intf) { intf = m_state; return (intf != NULL); }
|
||||
// specialized helpers for common core interfaces
|
||||
bool interface(device_execute_interface *&intf) const { intf = m_execute; return (intf != NULL); }
|
||||
bool interface(device_memory_interface *&intf) const { intf = m_memory; return (intf != NULL); }
|
||||
bool interface(device_state_interface *&intf) const { intf = m_state; return (intf != NULL); }
|
||||
device_memory_interface &memory() const { assert(m_memory != NULL); return *m_memory; }
|
||||
|
||||
// owned object helpers
|
||||
astring &subtag(astring &dest, const char *tag) const { return m_baseconfig.subtag(dest, tag); }
|
||||
@ -494,7 +496,7 @@ protected:
|
||||
state_manager & m_state_manager;
|
||||
device_debug * m_debug;
|
||||
|
||||
// for speed
|
||||
// core device interfaces for speed
|
||||
device_execute_interface *m_execute;
|
||||
device_memory_interface *m_memory;
|
||||
device_state_interface *m_state;
|
||||
@ -506,7 +508,7 @@ protected:
|
||||
|
||||
bool m_started; // true if the start function has succeeded
|
||||
UINT32 m_clock; // device clock
|
||||
const memory_region * 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
|
||||
|
@ -180,31 +180,6 @@ protected:
|
||||
// INLINE HELPERS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_memory - return a pointer to the device
|
||||
// memory interface for this device
|
||||
//-------------------------------------------------
|
||||
|
||||
inline device_memory_interface *device_memory(device_t *device)
|
||||
{
|
||||
device_memory_interface *intf;
|
||||
if (!device->interface(intf))
|
||||
throw emu_fatalerror("Device '%s' does not have memory interface", device->tag());
|
||||
return intf;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_get_space - return a pointer to the
|
||||
// given address space on this device
|
||||
//-------------------------------------------------
|
||||
|
||||
inline address_space *device_get_space(device_t *device, int spacenum = 0)
|
||||
{
|
||||
return device_memory(device)->space(spacenum);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// devconfig_get_space_config - return a pointer
|
||||
// to sthe given address space's configuration
|
||||
|
@ -127,8 +127,8 @@ static int load_cartridge(device_image_interface *image, const rom_entry *romrgn
|
||||
cpu = image->device().machine->device(type);
|
||||
if (cpu!=NULL && cpu->interface(memory))
|
||||
{
|
||||
datawidth = device_memory(cpu)->space_config(AS_PROGRAM)->m_databus_width / 8;
|
||||
littleendian = (device_memory(cpu)->space_config()->m_endianness == ENDIANNESS_LITTLE);
|
||||
datawidth = cpu->memory().space_config(AS_PROGRAM)->m_databus_width / 8;
|
||||
littleendian = (cpu->memory().space_config()->m_endianness == ENDIANNESS_LITTLE);
|
||||
}
|
||||
|
||||
/* swap the endianness if we need to */
|
||||
|
@ -298,7 +298,7 @@ static int z80bin_load_file(device_image_interface *image, const char *file_type
|
||||
image->message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
cputag_get_address_space(image->device().machine,"maincpu",ADDRESS_SPACE_PROGRAM)->write_byte(j, data);
|
||||
image->device().machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM)->write_byte(j, data);
|
||||
}
|
||||
|
||||
return IMAGE_INIT_PASS;
|
||||
|
@ -584,7 +584,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
|
||||
* the bits low set in the command byte. The only pulse that has
|
||||
* an effect currently is bit 0, which pulses the CPU's reset line
|
||||
*/
|
||||
cpu_set_input_line(space->machine->firstcpu, INPUT_LINE_RESET, PULSE_LINE);
|
||||
device_set_input_line(space->machine->firstcpu, INPUT_LINE_RESET, PULSE_LINE);
|
||||
at_8042_set_outport(space->machine, kbdc8042.outport | 0x02, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ static TIMER_CALLBACK( irq_pulse_clear )
|
||||
{
|
||||
device_t *device = (device_t *)ptr;
|
||||
int irqline = param;
|
||||
cpu_set_input_line(device, irqline, CLEAR_LINE);
|
||||
device_set_input_line(device, irqline, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -581,7 +581,7 @@ static TIMER_CALLBACK( irq_pulse_clear )
|
||||
void generic_pulse_irq_line(device_t *device, int irqline)
|
||||
{
|
||||
assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET);
|
||||
cpu_set_input_line(device, irqline, ASSERT_LINE);
|
||||
device_set_input_line(device, irqline, ASSERT_LINE);
|
||||
|
||||
cpu_device *cpudevice = downcast<cpu_device *>(device);
|
||||
attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles());
|
||||
@ -598,7 +598,7 @@ void generic_pulse_irq_line(device_t *device, int irqline)
|
||||
void generic_pulse_irq_line_and_vector(device_t *device, int irqline, int vector)
|
||||
{
|
||||
assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET);
|
||||
cpu_set_input_line_and_vector(device, irqline, ASSERT_LINE, vector);
|
||||
device_set_input_line_and_vector(device, irqline, ASSERT_LINE, vector);
|
||||
|
||||
cpu_device *cpudevice = downcast<cpu_device *>(device);
|
||||
attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles());
|
||||
@ -663,45 +663,45 @@ READ8_HANDLER( interrupt_enable_r )
|
||||
NMI callbacks
|
||||
-------------------------------------------------*/
|
||||
|
||||
INTERRUPT_GEN( nmi_line_pulse ) { if (interrupt_enabled(device)) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); }
|
||||
INTERRUPT_GEN( nmi_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( nmi_line_pulse ) { if (interrupt_enabled(device)) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); }
|
||||
INTERRUPT_GEN( nmi_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE); }
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
IRQn callbacks
|
||||
-------------------------------------------------*/
|
||||
|
||||
INTERRUPT_GEN( irq0_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 0, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq0_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 0, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq0_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 0); }
|
||||
INTERRUPT_GEN( irq0_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 0, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq0_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 0, ASSERT_LINE); }
|
||||
|
||||
INTERRUPT_GEN( irq1_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 1, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq1_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 1, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq1_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 1); }
|
||||
INTERRUPT_GEN( irq1_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 1, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq1_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 1, ASSERT_LINE); }
|
||||
|
||||
INTERRUPT_GEN( irq2_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 2, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq2_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 2, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq2_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 2); }
|
||||
INTERRUPT_GEN( irq2_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 2, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq2_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 2, ASSERT_LINE); }
|
||||
|
||||
INTERRUPT_GEN( irq3_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 3, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq3_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 3, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq3_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 3); }
|
||||
INTERRUPT_GEN( irq3_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 3, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq3_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 3, ASSERT_LINE); }
|
||||
|
||||
INTERRUPT_GEN( irq4_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 4, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq4_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 4, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq4_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 4); }
|
||||
INTERRUPT_GEN( irq4_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 4, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq4_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 4, ASSERT_LINE); }
|
||||
|
||||
INTERRUPT_GEN( irq5_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 5, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq5_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 5, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq5_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 5); }
|
||||
INTERRUPT_GEN( irq5_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 5, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq5_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 5, ASSERT_LINE); }
|
||||
|
||||
INTERRUPT_GEN( irq6_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 6, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq6_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 6, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq6_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 6); }
|
||||
INTERRUPT_GEN( irq6_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 6, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq6_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 6, ASSERT_LINE); }
|
||||
|
||||
INTERRUPT_GEN( irq7_line_hold ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 7, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq7_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 7, HOLD_LINE); }
|
||||
INTERRUPT_GEN( irq7_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 7); }
|
||||
INTERRUPT_GEN( irq7_line_assert ) { if (interrupt_enabled(device)) cpu_set_input_line(device, 7, ASSERT_LINE); }
|
||||
INTERRUPT_GEN( irq7_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 7, ASSERT_LINE); }
|
||||
|
||||
|
||||
|
||||
|
@ -104,7 +104,7 @@ void k056230_device::network_irq_clear()
|
||||
{
|
||||
if(m_cpu)
|
||||
{
|
||||
cpu_set_input_line(m_cpu, INPUT_LINE_IRQ2, CLEAR_LINE);
|
||||
device_set_input_line(m_cpu, INPUT_LINE_IRQ2, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,13 +126,13 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(k056230, k056230_w)
|
||||
{
|
||||
if(m_cpu)
|
||||
{
|
||||
cpu_set_input_line(m_cpu, INPUT_LINE_IRQ2, ASSERT_LINE);
|
||||
device_set_input_line(m_cpu, INPUT_LINE_IRQ2, ASSERT_LINE);
|
||||
}
|
||||
m_machine.scheduler().timer_set(attotime::from_usec(10), FUNC(network_irq_clear_callback), 0, (void*)this);
|
||||
}
|
||||
}
|
||||
// else
|
||||
// cpu_set_input_line(k056230->cpu, INPUT_LINE_IRQ2, CLEAR_LINE);
|
||||
// device_set_input_line(k056230->cpu, INPUT_LINE_IRQ2, CLEAR_LINE);
|
||||
break;
|
||||
}
|
||||
case 2: // Sub ID register
|
||||
|
@ -83,7 +83,7 @@ READ8_DEVICE_HANDLER( latch8_r )
|
||||
if (latch8->has_read)
|
||||
{
|
||||
/* temporary hack until all relevant systems are devices */
|
||||
address_space *space = cpu_get_address_space(device->machine->firstcpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = device->machine->firstcpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
int i;
|
||||
for (i=0; i<8; i++)
|
||||
{
|
||||
|
@ -845,7 +845,7 @@ static WRITE8_HANDLER( pr8210_port2_w )
|
||||
|
||||
/* bit 6 when low triggers an IRQ on the MCU */
|
||||
if (player->cpu != NULL)
|
||||
cpu_set_input_line(player->cpu, MCS48_INPUT_IRQ, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
device_set_input_line(player->cpu, MCS48_INPUT_IRQ, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
||||
/* standby LED is set accordingl to bit 4 */
|
||||
output_set_value("pr8210_standby", (data & 0x10) != 0);
|
||||
@ -1097,7 +1097,7 @@ static TIMER_CALLBACK( irq_off )
|
||||
{
|
||||
laserdisc_state *ld = (laserdisc_state *)ptr;
|
||||
ldplayer_data *player = ld->player;
|
||||
cpu_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
|
||||
device_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
|
||||
if (LOG_SIMUTREK)
|
||||
printf("%3d:**** Simutrek IRQ clear\n", ld->screen->vpos());
|
||||
}
|
||||
@ -1120,7 +1120,7 @@ static void simutrek_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fie
|
||||
{
|
||||
if (LOG_SIMUTREK)
|
||||
printf("%3d:VSYNC IRQ\n", ld->screen->vpos());
|
||||
cpu_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
|
||||
device_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
|
||||
ld->device->machine->scheduler().timer_set(ld->screen->scan_period(), FUNC(irq_off), 0, ld);
|
||||
}
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ static WRITE_LINE_DEVICE_HANDLER( ctc_interrupt )
|
||||
{
|
||||
laserdisc_state *ld = ldcore_get_safe_token(device->owner());
|
||||
if (ld->player->cpu != NULL)
|
||||
cpu_set_input_line(ld->player->cpu, 0, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(ld->player->cpu, 0, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -335,7 +335,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
|
||||
/* at the start of each line, signal an interrupt and use a timer to turn it off */
|
||||
if (which == 0)
|
||||
{
|
||||
cpu_set_input_line(player->cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
|
||||
device_set_input_line(player->cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
|
||||
machine->scheduler().timer_set(attotime::from_nsec(5580), FUNC(irq_off), 0, ld);
|
||||
}
|
||||
|
||||
@ -391,7 +391,7 @@ static TIMER_CALLBACK( deferred_data_w )
|
||||
static TIMER_CALLBACK( irq_off )
|
||||
{
|
||||
laserdisc_state *ld = (laserdisc_state *)ptr;
|
||||
cpu_set_input_line(ld->player->cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
|
||||
device_set_input_line(ld->player->cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -45,7 +45,7 @@ SCREEN_UPDATE( s3c2400 )
|
||||
|
||||
DEVICE_START( s3c2400 )
|
||||
{
|
||||
address_space *space = cputag_get_address_space( device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = device->machine->device( "maincpu")->memory().space( ADDRESS_SPACE_PROGRAM);
|
||||
DEVICE_START_CALL(s3c24xx);
|
||||
memory_install_readwrite32_device_handler( space, device, 0x14000000, 0x1400003b, 0, 0, s3c24xx_memcon_r, s3c24xx_memcon_w);
|
||||
memory_install_readwrite32_device_handler( space, device, 0x14200000, 0x1420005b, 0, 0, s3c24xx_usb_host_r, s3c24xx_usb_host_w);
|
||||
|
@ -45,7 +45,7 @@ SCREEN_UPDATE( s3c2410 )
|
||||
|
||||
DEVICE_START( s3c2410 )
|
||||
{
|
||||
address_space *space = cputag_get_address_space( device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = device->machine->device( "maincpu")->memory().space( ADDRESS_SPACE_PROGRAM);
|
||||
DEVICE_START_CALL(s3c24xx);
|
||||
memory_install_readwrite32_device_handler( space, device, 0x48000000, 0x4800003b, 0, 0, s3c24xx_memcon_r, s3c24xx_memcon_w);
|
||||
memory_install_readwrite32_device_handler( space, device, 0x49000000, 0x4900005b, 0, 0, s3c24xx_usb_host_r, s3c24xx_usb_host_w);
|
||||
|
@ -45,7 +45,7 @@ SCREEN_UPDATE( s3c2440 )
|
||||
|
||||
DEVICE_START( s3c2440 )
|
||||
{
|
||||
address_space *space = cputag_get_address_space( device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = device->machine->device( "maincpu")->memory().space( ADDRESS_SPACE_PROGRAM);
|
||||
memory_install_readwrite32_device_handler( space, device, 0x48000000, 0x4800003b, 0, 0, s3c24xx_memcon_r, s3c24xx_memcon_w);
|
||||
memory_install_readwrite32_device_handler( space, device, 0x49000000, 0x4900005b, 0, 0, s3c24xx_usb_host_r, s3c24xx_usb_host_w);
|
||||
memory_install_readwrite32_device_handler( space, device, 0x4a000000, 0x4a00001f, 0, 0, s3c24xx_irq_r, s3c24xx_irq_w);
|
||||
|
@ -247,7 +247,7 @@ static void s3c24xx_lcd_dma_init( device_t *device)
|
||||
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
|
||||
{
|
||||
s3c24xx_t *s3c24xx = get_token( device);
|
||||
address_space* space = cputag_get_address_space( device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space* space = device->machine->device( "maincpu")->memory().space( ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *vram, data[4];
|
||||
vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
|
||||
for (int i = 0; i < 2; i++)
|
||||
@ -291,7 +291,7 @@ static UINT32 s3c24xx_lcd_dma_read( device_t *device)
|
||||
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
|
||||
{
|
||||
s3c24xx_t *s3c24xx = get_token( device);
|
||||
address_space* space = cputag_get_address_space( device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space* space = device->machine->device( "maincpu")->memory().space( ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *vram, data[4];
|
||||
vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
|
||||
for (int i = 0; i < 2; i++)
|
||||
@ -1039,7 +1039,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_clkpow_w )
|
||||
case S3C24XX_MPLLCON :
|
||||
{
|
||||
verboselog( device->machine, 5, "CLKPOW - fclk %d hclk %d pclk %d\n", s3c24xx_get_fclk( device), s3c24xx_get_hclk( device), s3c24xx_get_pclk( device));
|
||||
cputag_set_clock( device->machine, "maincpu", s3c24xx_get_fclk( device) * CLOCK_MULTIPLIER);
|
||||
device->machine->device( "maincpu")->set_unscaled_clock(s3c24xx_get_fclk( device) * CLOCK_MULTIPLIER);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1454,7 +1454,7 @@ static void s3c24xx_dma_trigger( device_t *device, int ch)
|
||||
s3c24xx_t *s3c24xx = get_token( device);
|
||||
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[ch].regs;
|
||||
UINT32 curr_tc, curr_src, curr_dst;
|
||||
address_space *space = cputag_get_address_space( device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = device->machine->device( "maincpu")->memory().space( ADDRESS_SPACE_PROGRAM);
|
||||
int dsz, inc_src, inc_dst, servmode, tsz;
|
||||
const UINT32 ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3};
|
||||
verboselog( device->machine, 5, "DMA %d trigger\n", ch);
|
||||
|
@ -47,7 +47,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
|
||||
tmp68301_irq_vector[level] = IVNR & 0x00e0;
|
||||
tmp68301_irq_vector[level] += 4+i;
|
||||
|
||||
cpu_set_input_line(machine->firstcpu,level,HOLD_LINE);
|
||||
device_set_input_line(machine->firstcpu,level,HOLD_LINE);
|
||||
}
|
||||
|
||||
if (TCR & 0x0080) // N/1
|
||||
@ -120,7 +120,7 @@ MACHINE_RESET( tmp68301 )
|
||||
for (i = 0; i < 3; i++)
|
||||
tmp68301_IE[i] = 0;
|
||||
|
||||
cpu_set_irq_callback(machine->firstcpu, tmp68301_irq_callback);
|
||||
device_set_irq_callback(machine->firstcpu, tmp68301_irq_callback);
|
||||
}
|
||||
|
||||
/* Update the IRQ state based on all possible causes */
|
||||
@ -150,7 +150,7 @@ static void update_irq_state(running_machine *machine)
|
||||
|
||||
tmp68301_IE[i] = 0; // Interrupts are edge triggerred
|
||||
|
||||
cpu_set_input_line(machine->firstcpu,level,HOLD_LINE);
|
||||
device_set_input_line(machine->firstcpu,level,HOLD_LINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
180
src/emu/memory.c
180
src/emu/memory.c
@ -2081,18 +2081,18 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
|
||||
if (readorwrite == ROW_READ)
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, *object), data.m_mask); break;
|
||||
case 16: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, *object), data.m_mask); break;
|
||||
case 32: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, *object), data.m_mask); break;
|
||||
case 64: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, *object), data.m_mask); break;
|
||||
case 8: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, *object), data.m_mask); break;
|
||||
case 16: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, *object), data.m_mask); break;
|
||||
case 32: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, *object), data.m_mask); break;
|
||||
case 64: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, *object), data.m_mask); break;
|
||||
}
|
||||
else
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, *object), data.m_mask); break;
|
||||
case 16: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, *object), data.m_mask); break;
|
||||
case 32: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, *object), data.m_mask); break;
|
||||
case 64: install_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, *object), data.m_mask); break;
|
||||
case 8: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, *object), data.m_mask); break;
|
||||
case 16: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, *object), data.m_mask); break;
|
||||
case 32: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, *object), data.m_mask); break;
|
||||
case 64: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, *object), data.m_mask); break;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2100,18 +2100,18 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
|
||||
if (readorwrite == ROW_READ)
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace64, data.m_name, data.m_mask); break;
|
||||
case 8: install_legacy_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rspace64, data.m_name, data.m_mask); break;
|
||||
}
|
||||
else
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace64, data.m_name, data.m_mask); break;
|
||||
case 8: install_legacy_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wspace64, data.m_name, data.m_mask); break;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2123,18 +2123,18 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
|
||||
if (readorwrite == ROW_READ)
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice64, data.m_name, data.m_mask); break;
|
||||
case 8: install_legacy_read_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_read_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_read_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_read_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice64, data.m_name, data.m_mask); break;
|
||||
}
|
||||
else
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice64, data.m_name, data.m_mask); break;
|
||||
case 8: install_legacy_write_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice8, data.m_name, data.m_mask); break;
|
||||
case 16: install_legacy_write_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice16, data.m_name, data.m_mask); break;
|
||||
case 32: install_legacy_write_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice32, data.m_name, data.m_mask); break;
|
||||
case 64: install_legacy_write_handler(*device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice64, data.m_name, data.m_mask); break;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2582,9 +2582,9 @@ void *address_space::install_ram(offs_t addrstart, offs_t addrend, offs_t addrma
|
||||
// delegate handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate handler, UINT64 unitmask)
|
||||
UINT8 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
VPRINTF(("address_space::install_handler(%s-%s mask=%s mirror=%s, %s, %s)\n",
|
||||
VPRINTF(("address_space::install_read_handler(%s-%s mask=%s mirror=%s, %s, %s)\n",
|
||||
core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
|
||||
core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
|
||||
handler.name(), core_i64_hex_format(unitmask, data_width() / 4)));
|
||||
@ -2595,9 +2595,9 @@ UINT8 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t a
|
||||
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT8 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_delegate handler, UINT64 unitmask)
|
||||
UINT8 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
VPRINTF(("address_space::install_handler(%s-%s mask=%s mirror=%s, %s, %s)\n",
|
||||
VPRINTF(("address_space::install_write_handler(%s-%s mask=%s mirror=%s, %s, %s)\n",
|
||||
core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
|
||||
core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
|
||||
handler.name(), core_i64_hex_format(unitmask, data_width() / 4)));
|
||||
@ -2608,10 +2608,10 @@ UINT8 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t a
|
||||
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT8 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask)
|
||||
UINT8 *address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask)
|
||||
{
|
||||
install_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
install_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2621,9 +2621,9 @@ UINT8 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t a
|
||||
// space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT8 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
VPRINTF(("address_space::install_legacy_handler(%s-%s mask=%s mirror=%s, %s, %s) [read8]\n",
|
||||
VPRINTF(("address_space::install_legacy_read_handler(%s-%s mask=%s mirror=%s, %s, %s) [read8]\n",
|
||||
core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
|
||||
core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
|
||||
rname, core_i64_hex_format(unitmask, data_width() / 4)));
|
||||
@ -2634,9 +2634,9 @@ UINT8 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, o
|
||||
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT8 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT8 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
VPRINTF(("address_space::install_legacy_handler(%s-%s mask=%s mirror=%s, %s, %s) [write8]\n",
|
||||
VPRINTF(("address_space::install_legacy_write_handler(%s-%s mask=%s mirror=%s, %s, %s) [write8]\n",
|
||||
core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
|
||||
core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
|
||||
wname, core_i64_hex_format(unitmask, data_width() / 4)));
|
||||
@ -2647,10 +2647,10 @@ UINT8 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, o
|
||||
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT8 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, write8_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT8 *address_space::install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, write8_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2659,9 +2659,9 @@ UINT8 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, o
|
||||
// write legacy device handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT8 *address_space::install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
VPRINTF(("address_space::install_legacy_handler(%s-%s mask=%s mirror=%s, %s, %s, \"%s\") [read8]\n",
|
||||
VPRINTF(("address_space::install_legacy_read_handler(%s-%s mask=%s mirror=%s, %s, %s, \"%s\") [read8]\n",
|
||||
core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
|
||||
core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
|
||||
rname, core_i64_hex_format(unitmask, data_width() / 4), device.tag()));
|
||||
@ -2672,9 +2672,9 @@ UINT8 *address_space::install_legacy_handler(device_t &device, offs_t addrstart,
|
||||
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT8 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT8 *address_space::install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
VPRINTF(("address_space::install_legacy_handler(%s-%s mask=%s mirror=%s, %s, %s, \"%s\") [write8]\n",
|
||||
VPRINTF(("address_space::install_legacy_write_handler(%s-%s mask=%s mirror=%s, %s, %s, \"%s\") [write8]\n",
|
||||
core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
|
||||
core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
|
||||
wname, core_i64_hex_format(unitmask, data_width() / 4), device.tag()));
|
||||
@ -2685,10 +2685,10 @@ UINT8 *address_space::install_legacy_handler(device_t &device, offs_t addrstart,
|
||||
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT8 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, write8_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT8 *address_space::install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, write8_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2697,7 +2697,7 @@ UINT8 *address_space::install_legacy_handler(device_t &device, offs_t addrstart,
|
||||
// delegate handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT16 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate handler, UINT64 unitmask)
|
||||
UINT16 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_delegate(handler, unitmask);
|
||||
@ -2705,7 +2705,7 @@ UINT16 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT16 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_delegate handler, UINT64 unitmask)
|
||||
UINT16 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_delegate(handler, unitmask);
|
||||
@ -2713,10 +2713,10 @@ UINT16 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT16 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask)
|
||||
UINT16 *address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask)
|
||||
{
|
||||
install_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
install_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2726,7 +2726,7 @@ UINT16 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
// space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT16 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT16 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
|
||||
@ -2734,7 +2734,7 @@ UINT16 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT16 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT16 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
|
||||
@ -2742,10 +2742,10 @@ UINT16 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT16 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, write16_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT16 *address_space::install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, write16_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2754,7 +2754,7 @@ UINT16 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
// write legacy device handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT16 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT16 *address_space::install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
|
||||
@ -2762,7 +2762,7 @@ UINT16 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT16 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT16 *address_space::install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
|
||||
@ -2770,10 +2770,10 @@ UINT16 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT16 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, write16_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT16 *address_space::install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, write16_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2782,7 +2782,7 @@ UINT16 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
// delegate handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT32 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate handler, UINT64 unitmask)
|
||||
UINT32 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_delegate(handler, unitmask);
|
||||
@ -2790,7 +2790,7 @@ UINT32 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT32 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_delegate handler, UINT64 unitmask)
|
||||
UINT32 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_delegate(handler, unitmask);
|
||||
@ -2798,10 +2798,10 @@ UINT32 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT32 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask)
|
||||
UINT32 *address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask)
|
||||
{
|
||||
install_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
install_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2811,7 +2811,7 @@ UINT32 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
// space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT32 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT32 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
|
||||
@ -2819,7 +2819,7 @@ UINT32 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT32 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT32 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
|
||||
@ -2827,10 +2827,10 @@ UINT32 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT32 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, write32_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT32 *address_space::install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, write32_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2839,7 +2839,7 @@ UINT32 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
// write legacy device handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT32 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT32 *address_space::install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
|
||||
@ -2847,7 +2847,7 @@ UINT32 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT32 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT32 *address_space::install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
|
||||
@ -2855,10 +2855,10 @@ UINT32 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT32 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, write32_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT32 *address_space::install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, write32_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2867,7 +2867,7 @@ UINT32 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
// delegate handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate handler, UINT64 unitmask)
|
||||
UINT64 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_delegate(handler, unitmask);
|
||||
@ -2875,7 +2875,7 @@ UINT64 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT64 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_delegate handler, UINT64 unitmask)
|
||||
UINT64 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_delegate handler, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_delegate(handler, unitmask);
|
||||
@ -2883,10 +2883,10 @@ UINT64 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT64 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask)
|
||||
UINT64 *address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask)
|
||||
{
|
||||
install_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
install_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, unitmask);
|
||||
return install_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2896,7 +2896,7 @@ UINT64 *address_space::install_handler(offs_t addrstart, offs_t addrend, offs_t
|
||||
// space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT64 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
|
||||
@ -2904,7 +2904,7 @@ UINT64 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT64 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT64 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
|
||||
@ -2912,10 +2912,10 @@ UINT64 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT64 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, write64_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT64 *address_space::install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, write64_space_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
@ -2924,7 +2924,7 @@ UINT64 *address_space::install_legacy_handler(offs_t addrstart, offs_t addrend,
|
||||
// write legacy device handlers for the space
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT64 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
UINT64 *address_space::install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
|
||||
@ -2932,7 +2932,7 @@ UINT64 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT64 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT64 *address_space::install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
|
||||
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
|
||||
@ -2940,10 +2940,10 @@ UINT64 *address_space::install_legacy_handler(device_t &device, offs_t addrstart
|
||||
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
|
||||
}
|
||||
|
||||
UINT64 *address_space::install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, write64_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
UINT64 *address_space::install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, write64_device_func whandler, const char *wname, UINT64 unitmask)
|
||||
{
|
||||
install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
install_legacy_read_handler(device, addrstart, addrend, addrmask, addrmirror, rhandler, rname, unitmask);
|
||||
return install_legacy_write_handler(device, addrstart, addrend, addrmask, addrmirror, whandler, wname, unitmask);
|
||||
}
|
||||
|
||||
|
||||
|
163
src/emu/memory.h
163
src/emu/memory.h
@ -426,52 +426,95 @@ public:
|
||||
bool set_direct_region(offs_t &byteaddress);
|
||||
|
||||
// static handler installation
|
||||
void unmap(offs_t addrstart, offs_t addrend, read_or_write readorwrite, bool quiet) { unmap(addrstart, addrend, 0, 0, readorwrite, quiet); }
|
||||
void unmap(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read_or_write readorwrite, bool quiet);
|
||||
void install_port(offs_t addrstart, offs_t addrend, const char *rtag, const char *wtag) { install_port(addrstart, addrend, 0, 0, rtag, wtag); }
|
||||
void install_port(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *rtag, const char *wtag);
|
||||
void install_bank(offs_t addrstart, offs_t addrend, const char *rtag, const char *wtag) { install_bank(addrstart, addrend, 0, 0, rtag, wtag); }
|
||||
void install_bank(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *rtag, const char *wtag);
|
||||
void *install_ram(offs_t addrstart, offs_t addrend, read_or_write readorwrite, void *baseptr = NULL) { return install_ram(addrstart, addrend, 0, 0, readorwrite, baseptr); }
|
||||
void *install_ram(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read_or_write readorwrite, void *baseptr = NULL);
|
||||
|
||||
// install new-style delegate handlers
|
||||
UINT8 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT8 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT8 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT16 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT16 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT16 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT32 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT32 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT32 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT64 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT64 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT64 *install_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT8 *install_read_handler(offs_t addrstart, offs_t addrend, read8_delegate rhandler, UINT64 unitmask = 0) { return install_read_handler(addrstart, addrend, 0, 0, rhandler, unitmask); }
|
||||
UINT8 *install_write_handler(offs_t addrstart, offs_t addrend, write8_delegate whandler, UINT64 unitmask = 0) { return install_write_handler(addrstart, addrend, 0, 0, whandler, unitmask); }
|
||||
UINT8 *install_readwrite_handler(offs_t addrstart, offs_t addrend, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, rhandler, whandler, unitmask); }
|
||||
UINT16 *install_read_handler(offs_t addrstart, offs_t addrend, read16_delegate rhandler, UINT64 unitmask = 0) { return install_read_handler(addrstart, addrend, 0, 0, rhandler, unitmask); }
|
||||
UINT16 *install_write_handler(offs_t addrstart, offs_t addrend, write16_delegate whandler, UINT64 unitmask = 0) { return install_write_handler(addrstart, addrend, 0, 0, whandler, unitmask); }
|
||||
UINT16 *install_readwrite_handler(offs_t addrstart, offs_t addrend, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, rhandler, whandler, unitmask); }
|
||||
UINT32 *install_read_handler(offs_t addrstart, offs_t addrend, read32_delegate rhandler, UINT64 unitmask = 0) { return install_read_handler(addrstart, addrend, 0, 0, rhandler, unitmask); }
|
||||
UINT32 *install_write_handler(offs_t addrstart, offs_t addrend, write32_delegate whandler, UINT64 unitmask = 0) { return install_write_handler(addrstart, addrend, 0, 0, whandler, unitmask); }
|
||||
UINT32 *install_readwrite_handler(offs_t addrstart, offs_t addrend, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, rhandler, whandler, unitmask); }
|
||||
UINT64 *install_read_handler(offs_t addrstart, offs_t addrend, read64_delegate rhandler, UINT64 unitmask = 0) { return install_read_handler(addrstart, addrend, 0, 0, rhandler, unitmask); }
|
||||
UINT64 *install_write_handler(offs_t addrstart, offs_t addrend, write64_delegate whandler, UINT64 unitmask = 0) { return install_write_handler(addrstart, addrend, 0, 0, whandler, unitmask); }
|
||||
UINT64 *install_readwrite_handler(offs_t addrstart, offs_t addrend, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, rhandler, whandler, unitmask); }
|
||||
|
||||
UINT8 *install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT8 *install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT8 *install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT16 *install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT16 *install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT16 *install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT32 *install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT32 *install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT32 *install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT64 *install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate rhandler, UINT64 unitmask = 0);
|
||||
UINT64 *install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_delegate whandler, UINT64 unitmask = 0);
|
||||
UINT64 *install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask = 0);
|
||||
|
||||
// install legacy address space handlers
|
||||
UINT8 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, write8_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, write16_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, write32_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, write64_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, read8_space_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT8 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, write8_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT8 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, read8_space_func rhandler, const char *rname, write8_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
UINT16 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, read16_space_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT16 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, write16_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT16 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, read16_space_func rhandler, const char *rname, write16_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
UINT32 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, read32_space_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT32 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, write32_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT32 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, read32_space_func rhandler, const char *rname, write32_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
UINT64 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, read64_space_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT64 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, write64_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT64 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, read64_space_func rhandler, const char *rname, write64_space_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
|
||||
UINT8 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, const char *rname, write8_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, const char *rname, write16_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, const char *rname, write32_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rname, write64_space_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
|
||||
// install legacy device handlers
|
||||
UINT8 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, write8_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, write16_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, write32_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, write64_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, read8_device_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(device, addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT8 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, write8_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(device, addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT8 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, read8_device_func rhandler, const char *rname, write8_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(device, addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
UINT16 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, read16_device_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(device, addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT16 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, write16_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(device, addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT16 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, read16_device_func rhandler, const char *rname, write16_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(device, addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
UINT32 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, read32_device_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(device, addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT32 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, write32_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(device, addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT32 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, read32_device_func rhandler, const char *rname, write32_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(device, addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
UINT64 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, read64_device_func rhandler, const char *rname, UINT64 unitmask = 0) { return install_legacy_read_handler(device, addrstart, addrend, 0, 0, rhandler, rname, unitmask); }
|
||||
UINT64 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, write64_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_write_handler(device, addrstart, addrend, 0, 0, whandler, wname, unitmask); }
|
||||
UINT64 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, read64_device_func rhandler, const char *rname, write64_device_func whandler, const char *wname, UINT64 unitmask = 0) { return install_legacy_readwrite_handler(device, addrstart, addrend, 0, 0, rhandler, rname, whandler, wname, unitmask); }
|
||||
|
||||
UINT8 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT8 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rname, write8_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT16 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rname, write16_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT32 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rname, write32_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_read_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_write_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
UINT64 *install_legacy_readwrite_handler(device_t &device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rname, write64_device_func whandler, const char *wname, UINT64 unitmask = 0);
|
||||
|
||||
// setup
|
||||
void prepare_map();
|
||||
@ -620,22 +663,22 @@ protected:
|
||||
|
||||
// wrappers for dynamic read handler installation
|
||||
#define memory_install_read8_handler(space, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
#define memory_install_read16_handler(space, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
#define memory_install_read32_handler(space, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
#define memory_install_read64_handler(space, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(start, end, mask, mirror, rhandler, #rhandler)
|
||||
|
||||
#define memory_install_read8_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
#define memory_install_read16_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
#define memory_install_read32_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
#define memory_install_read64_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
(space)->install_legacy_read_handler(*(device), start, end, mask, mirror, rhandler, #rhandler)
|
||||
|
||||
#define memory_install_read_port(space, start, end, mask, mirror, rtag) \
|
||||
(space)->install_port(start, end, mask, mirror, rtag, NULL)
|
||||
@ -650,22 +693,22 @@ protected:
|
||||
|
||||
// wrappers for dynamic write handler installation
|
||||
#define memory_install_write8_handler(space, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
#define memory_install_write16_handler(space, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
#define memory_install_write32_handler(space, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
#define memory_install_write64_handler(space, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(start, end, mask, mirror, whandler, #whandler)
|
||||
|
||||
#define memory_install_write8_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
#define memory_install_write16_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
#define memory_install_write32_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
#define memory_install_write64_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
(space)->install_legacy_write_handler(*(device), start, end, mask, mirror, whandler, #whandler)
|
||||
|
||||
#define memory_install_write_port(space, start, end, mask, mirror, wtag) \
|
||||
(space)->install_port(start, end, mask, mirror, NULL, wtag)
|
||||
@ -680,22 +723,22 @@ protected:
|
||||
|
||||
// wrappers for dynamic read/write handler installation
|
||||
#define memory_install_readwrite8_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
#define memory_install_readwrite16_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
#define memory_install_readwrite32_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
#define memory_install_readwrite64_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
|
||||
#define memory_install_readwrite8_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
#define memory_install_readwrite16_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
#define memory_install_readwrite32_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
#define memory_install_readwrite64_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
(space)->install_legacy_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
(space)->install_legacy_readwrite_handler(*(device), start, end, mask, mirror, rhandler, #rhandler, whandler, #whandler)
|
||||
|
||||
#define memory_install_readwrite_port(space, start, end, mask, mirror, rtag, wtag) \
|
||||
(space)->install_port(start, end, mask, mirror, rtag, wtag)
|
||||
|
@ -940,47 +940,3 @@ void device_scheduler::add_scheduling_quantum(attotime quantum, attotime duratio
|
||||
m_quantum_list.insert_after(quant, insert_after);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
// DEBUGGING
|
||||
***************************************************************************/
|
||||
|
||||
#if 0
|
||||
//-------------------------------------------------
|
||||
// timer_logtimers - log all the timers
|
||||
//-------------------------------------------------
|
||||
|
||||
static void timer_logtimers(running_machine *machine)
|
||||
{
|
||||
emu_timer *t;
|
||||
|
||||
logerror("===============\n");
|
||||
logerror("TIMER LOG START\n");
|
||||
logerror("===============\n");
|
||||
|
||||
logerror("Enqueued timers:\n");
|
||||
for (t = global->activelist; t; t = t->next)
|
||||
logerror(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s:%d[%s])\n",
|
||||
t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->file, t->line, t->func);
|
||||
|
||||
logerror("Free timers:\n");
|
||||
for (t = global->freelist; t; t = t->next)
|
||||
logerror(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s:%d[%s])\n",
|
||||
t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->file, t->line, t->func);
|
||||
|
||||
logerror("==============\n");
|
||||
logerror("TIMER LOG STOP\n");
|
||||
logerror("==============\n");
|
||||
}
|
||||
|
||||
|
||||
void timer_print_first_timer(running_machine *machine)
|
||||
{
|
||||
emu_timer *t = global->activelist;
|
||||
printf(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s)\n",
|
||||
t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->func);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -704,7 +704,7 @@ static DEVICE_START( nesapu )
|
||||
info->buffer_size+=info->samps_per_sync;
|
||||
|
||||
/* Initialize individual chips */
|
||||
(info->APU.dpcm).memory = cputag_get_address_space(device->machine, intf->cpu_tag, ADDRESS_SPACE_PROGRAM);
|
||||
(info->APU.dpcm).memory = device->machine->device(intf->cpu_tag)->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 1, rate, info, nes_psg_update_sound);
|
||||
|
||||
|
@ -696,7 +696,7 @@ static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r)
|
||||
static void SCSP_UpdateReg(scsp_state *scsp, int reg)
|
||||
{
|
||||
/* temporary hack until this is converted to a device */
|
||||
address_space *space = device_get_space(scsp->device->machine->firstcpu, AS_PROGRAM);
|
||||
address_space *space = scsp->device->machine->firstcpu->memory().space(AS_PROGRAM);
|
||||
switch(reg&0x3f)
|
||||
{
|
||||
case 0x2:
|
||||
@ -1214,7 +1214,7 @@ static void dma_scsp(address_space *space, scsp_state *scsp)
|
||||
|
||||
/*Job done,request a dma end irq*/
|
||||
if(scsp_regs[0x1e/2] & 0x10)
|
||||
cpu_set_input_line(space->machine->device("audiocpu"),dma_transfer_end,HOLD_LINE);
|
||||
device_set_input_line(space->machine->device("audiocpu"),dma_transfer_end,HOLD_LINE);
|
||||
}
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
@ -1318,7 +1318,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
|
||||
scsp->scsp_dtlg = scsp_regs[0x416/2] & 0x0ffe;
|
||||
if(scsp_dexe)
|
||||
{
|
||||
dma_scsp(cpu_get_address_space(device->machine->firstcpu, ADDRESS_SPACE_PROGRAM), scsp);
|
||||
dma_scsp(device->machine->firstcpu->memory().space(ADDRESS_SPACE_PROGRAM), scsp);
|
||||
scsp_regs[0x416/2]^=0x1000;//disable starting bit
|
||||
}
|
||||
break;
|
||||
@ -1326,7 +1326,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
|
||||
case 0x42a:
|
||||
if(stv_scu && !(stv_scu[40] & 0x40) /*&& scsp_regs[0x42c/2] & 0x20*/)/*Main CPU allow sound irq*/
|
||||
{
|
||||
cpu_set_input_line_and_vector(device->machine->firstcpu, 9, HOLD_LINE , 0x46);
|
||||
device_set_input_line_and_vector(device->machine->firstcpu, 9, HOLD_LINE , 0x46);
|
||||
logerror("SCSP: Main CPU interrupt\n");
|
||||
}
|
||||
break;
|
||||
|
@ -596,7 +596,7 @@ static WRITE64_HANDLER( vga_ega64_w ) { write64be_with_write8_handler(vga_ega_w,
|
||||
|
||||
static void vga_cpu_interface(running_machine *machine)
|
||||
{
|
||||
address_space *space = cpu_get_address_space(machine->firstcpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = machine->firstcpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
static int sequencer, gc;
|
||||
read8_space_func read_handler;
|
||||
write8_space_func write_handler;
|
||||
@ -682,12 +682,12 @@ static void vga_cpu_interface(running_machine *machine)
|
||||
sel = vga.gc.data[6] & 0x0c;
|
||||
if (sel)
|
||||
{
|
||||
if (sel == 0x04) memory_install_read8_handler(space, 0xa0000, 0xaffff, 0, 0, read_handler ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_read8_handler(space, 0xb0000, 0xb7fff, 0, 0, read_handler ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_read8_handler(space, 0xb8000, 0xbffff, 0, 0, read_handler ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) memory_install_write8_handler(space, 0xa0000, 0xaffff, 0, 0, write_handler); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_write8_handler(space, 0xb0000, 0xb7fff, 0, 0, write_handler); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_write8_handler(space, 0xb8000, 0xbffff, 0, 0, write_handler); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_read_handler(0xa0000, 0xaffff, FUNC(read_handler) ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_read_handler(0xb0000, 0xb7fff, FUNC(read_handler) ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_read_handler(0xb8000, 0xbffff, FUNC(read_handler) ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_write_handler(0xa0000, 0xaffff, FUNC(write_handler)); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_write_handler(0xb0000, 0xb7fff, FUNC(write_handler)); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_write_handler(0xb8000, 0xbffff, FUNC(write_handler)); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -701,12 +701,12 @@ static void vga_cpu_interface(running_machine *machine)
|
||||
sel = vga.gc.data[6] & 0x0c;
|
||||
if (sel)
|
||||
{
|
||||
if (sel == 0x04) memory_install_read16_handler(space, 0xa0000, 0xaffff, 0, 0, read_handler16 ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_read16_handler(space, 0xb0000, 0xb7fff, 0, 0, read_handler16 ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_read16_handler(space, 0xb8000, 0xbffff, 0, 0, read_handler16 ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) memory_install_write16_handler(space, 0xa0000, 0xaffff, 0, 0, write_handler16); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_write16_handler(space, 0xb0000, 0xb7fff, 0, 0, write_handler16); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_write16_handler(space, 0xb8000, 0xbffff, 0, 0, write_handler16); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_read_handler(0xa0000, 0xaffff, FUNC(read_handler16) ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_read_handler(0xb0000, 0xb7fff, FUNC(read_handler16) ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_read_handler(0xb8000, 0xbffff, FUNC(read_handler16) ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_write_handler(0xa0000, 0xaffff, FUNC(write_handler16)); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_write_handler(0xb0000, 0xb7fff, FUNC(write_handler16)); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_write_handler(0xb8000, 0xbffff, FUNC(write_handler16)); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -720,12 +720,12 @@ static void vga_cpu_interface(running_machine *machine)
|
||||
sel = vga.gc.data[6] & 0x0c;
|
||||
if (sel)
|
||||
{
|
||||
if (sel == 0x04) memory_install_read32_handler(space, 0xa0000, 0xaffff, 0, 0, read_handler32 ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_read32_handler(space, 0xb0000, 0xb7fff, 0, 0, read_handler32 ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_read32_handler(space, 0xb8000, 0xbffff, 0, 0, read_handler32 ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) memory_install_write32_handler(space, 0xa0000, 0xaffff, 0, 0, write_handler32); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_write32_handler(space, 0xb0000, 0xb7fff, 0, 0, write_handler32); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_write32_handler(space, 0xb8000, 0xbffff, 0, 0, write_handler32); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_read_handler(0xa0000, 0xaffff, FUNC(read_handler32) ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_read_handler(0xb0000, 0xb7fff, FUNC(read_handler32) ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_read_handler(0xb8000, 0xbffff, FUNC(read_handler32) ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_write_handler(0xa0000, 0xaffff, FUNC(write_handler32)); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_write_handler(0xb0000, 0xb7fff, FUNC(write_handler32)); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_write_handler(0xb8000, 0xbffff, FUNC(write_handler32)); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -739,12 +739,12 @@ static void vga_cpu_interface(running_machine *machine)
|
||||
sel = vga.gc.data[6] & 0x0c;
|
||||
if (sel)
|
||||
{
|
||||
if (sel == 0x04) memory_install_read64_handler(space, 0xa0000, 0xaffff, 0, 0, read_handler64 ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_read64_handler(space, 0xb0000, 0xb7fff, 0, 0, read_handler64 ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_read64_handler(space, 0xb8000, 0xbffff, 0, 0, read_handler64 ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) memory_install_write64_handler(space, 0xa0000, 0xaffff, 0, 0, write_handler64); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) memory_install_write64_handler(space, 0xb0000, 0xb7fff, 0, 0, write_handler64); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) memory_install_write64_handler(space, 0xb8000, 0xbffff, 0, 0, write_handler64); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_read_handler(0xa0000, 0xaffff, FUNC(read_handler64) ); else memory_nop_read(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_read_handler(0xb0000, 0xb7fff, FUNC(read_handler64) ); else memory_nop_read(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_read_handler(0xb8000, 0xbffff, FUNC(read_handler64) ); else memory_nop_read(space, 0xb8000, 0xbffff, 0, 0);
|
||||
if (sel == 0x04) space->install_legacy_write_handler(0xa0000, 0xaffff, FUNC(write_handler64)); else memory_nop_write(space, 0xa0000, 0xaffff, 0, 0);
|
||||
if (sel == 0x08) space->install_legacy_write_handler(0xb0000, 0xb7fff, FUNC(write_handler64)); else memory_nop_write(space, 0xb0000, 0xb7fff, 0, 0);
|
||||
if (sel == 0x0C) space->install_legacy_write_handler(0xb8000, 0xbffff, FUNC(write_handler64)); else memory_nop_write(space, 0xb8000, 0xbffff, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1266,47 +1266,47 @@ void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_in
|
||||
memset(vga.gc.data, '\0', vga.svga_intf.gc_regcount);
|
||||
|
||||
buswidth = downcast<cpu_device *>(machine->firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
|
||||
spacevga = cpu_get_address_space(machine->firstcpu,vga.vga_intf.port_addressspace);
|
||||
spacevga = machine->firstcpu->memory().space(vga.vga_intf.port_addressspace);
|
||||
switch(buswidth)
|
||||
{
|
||||
case 8:
|
||||
memory_install_read8_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_r );
|
||||
memory_install_read8_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_r );
|
||||
memory_install_read8_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_r );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port_03b0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port_03c0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port_03d0_r) );
|
||||
|
||||
memory_install_write8_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_w );
|
||||
memory_install_write8_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_w );
|
||||
memory_install_write8_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_w );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port_03b0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port_03c0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port_03d0_w) );
|
||||
break;
|
||||
|
||||
case 16:
|
||||
memory_install_read16_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port16le_03b0_r );
|
||||
memory_install_read16_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port16le_03c0_r );
|
||||
memory_install_read16_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port16le_03d0_r );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port16le_03b0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port16le_03c0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port16le_03d0_r) );
|
||||
|
||||
memory_install_write16_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port16le_03b0_w );
|
||||
memory_install_write16_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port16le_03c0_w );
|
||||
memory_install_write16_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port16le_03d0_w );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port16le_03b0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port16le_03c0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port16le_03d0_w) );
|
||||
break;
|
||||
|
||||
case 32:
|
||||
memory_install_read32_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port32le_03b0_r );
|
||||
memory_install_read32_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port32le_03c0_r );
|
||||
memory_install_read32_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port32le_03d0_r );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port32le_03b0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port32le_03c0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port32le_03d0_r) );
|
||||
|
||||
memory_install_write32_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port32le_03b0_w );
|
||||
memory_install_write32_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port32le_03c0_w );
|
||||
memory_install_write32_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port32le_03d0_w );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port32le_03b0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port32le_03c0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port32le_03d0_w) );
|
||||
break;
|
||||
|
||||
case 64:
|
||||
memory_install_read64_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_r );
|
||||
memory_install_read64_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_r );
|
||||
memory_install_read64_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_r );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port64be_03b0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port64be_03c0_r) );
|
||||
spacevga->install_legacy_read_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port64be_03d0_r) );
|
||||
|
||||
memory_install_write64_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_w );
|
||||
memory_install_write64_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_w );
|
||||
memory_install_write64_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_w );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, FUNC(vga_port64be_03b0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, FUNC(vga_port64be_03c0_w) );
|
||||
spacevga->install_legacy_write_handler(vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, FUNC(vga_port64be_03d0_w) );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2093,7 +2093,7 @@ static void stall_cpu(voodoo_state *v, int state, attotime current_time)
|
||||
if (v->pci.stall_callback)
|
||||
(*v->pci.stall_callback)(v->device, TRUE);
|
||||
else
|
||||
cpu_spinuntil_trigger(v->cpu, v->trigger);
|
||||
device_spin_until_trigger(v->cpu, v->trigger);
|
||||
|
||||
/* set a timer to clear the stall */
|
||||
v->pci.continue_timer->adjust(v->pci.op_end_time - current_time);
|
||||
@ -3717,7 +3717,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
|
||||
/* bit 31 is not used */
|
||||
|
||||
/* eat some cycles since people like polling here */
|
||||
cpu_eat_cycles(v->cpu, 1000);
|
||||
device_eat_cycles(v->cpu, 1000);
|
||||
break;
|
||||
|
||||
/* bit 2 of the initEnable register maps this to dacRead */
|
||||
@ -3730,7 +3730,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
|
||||
case vRetrace:
|
||||
|
||||
/* eat some cycles since people like polling here */
|
||||
cpu_eat_cycles(v->cpu, 10);
|
||||
device_eat_cycles(v->cpu, 10);
|
||||
result = v->screen->vpos();
|
||||
break;
|
||||
|
||||
@ -3745,7 +3745,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
|
||||
result = v->fbi.cmdfifo[0].rdptr;
|
||||
|
||||
/* eat some cycles since people like polling here */
|
||||
cpu_eat_cycles(v->cpu, 1000);
|
||||
device_eat_cycles(v->cpu, 1000);
|
||||
break;
|
||||
|
||||
case cmdFifoAMin:
|
||||
|
@ -910,7 +910,7 @@ static TIMER_CALLBACK( schaser_effect_555_cb )
|
||||
static STATE_POSTLOAD( schaser_reinit_555_time_remain )
|
||||
{
|
||||
_8080bw_state *state = machine->driver_data<_8080bw_state>();
|
||||
address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = state->maincpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
state->schaser_effect_555_time_remain = attotime::from_double(state->schaser_effect_555_time_remain_savable);
|
||||
schaser_sh_port_2_w(space, 0, state->port_2_last_extra);
|
||||
}
|
||||
@ -933,7 +933,7 @@ MACHINE_START( schaser_sh )
|
||||
MACHINE_RESET( schaser_sh )
|
||||
{
|
||||
_8080bw_state *state = machine->driver_data<_8080bw_state>();
|
||||
address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
state->schaser_effect_555_is_low = 0;
|
||||
state->schaser_effect_555_timer->adjust(attotime::never);
|
||||
|
@ -78,7 +78,7 @@ INLINE amiga_audio *get_safe_token( device_t *device )
|
||||
|
||||
static TIMER_CALLBACK( signal_irq )
|
||||
{
|
||||
amiga_custom_w(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
|
||||
amiga_custom_w(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
|
||||
}
|
||||
|
||||
|
||||
|
@ -147,7 +147,7 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
|
||||
|
||||
/* install POKEY memory handlers */
|
||||
if (pokey != NULL)
|
||||
memory_install_readwrite8_device_handler(cpu_get_address_space(jsacpu, ADDRESS_SPACE_PROGRAM), pokey, 0x2c00, 0x2c0f, 0, 0, pokey_r, pokey_w);
|
||||
memory_install_readwrite8_device_handler(jsacpu->memory().space(ADDRESS_SPACE_PROGRAM), pokey, 0x2c00, 0x2c0f, 0, 0, pokey_r, pokey_w);
|
||||
|
||||
init_save_state(machine);
|
||||
atarijsa_reset();
|
||||
|
@ -54,5 +54,5 @@ INTERRUPT_GEN( aztarac_snd_timed_irq )
|
||||
state->sound_status ^= 0x10;
|
||||
|
||||
if (state->sound_status & 0x10)
|
||||
cpu_set_input_line(device,0,HOLD_LINE);
|
||||
device_set_input_line(device,0,HOLD_LINE);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ void cage_init(running_machine *machine, offs_t speedup)
|
||||
timer[1] = machine->device<timer_device>("cage_timer1");
|
||||
|
||||
if (speedup)
|
||||
speedup_ram = memory_install_write32_handler(cpu_get_address_space(cage_cpu, ADDRESS_SPACE_PROGRAM), speedup, speedup, 0, 0, speedup_w);
|
||||
speedup_ram = memory_install_write32_handler(cage_cpu->memory().space(ADDRESS_SPACE_PROGRAM), speedup, speedup, 0, 0, speedup_w);
|
||||
|
||||
for (chan = 0; chan < DAC_BUFFER_CHANNELS; chan++)
|
||||
{
|
||||
@ -202,7 +202,7 @@ void cage_reset_w(int state)
|
||||
{
|
||||
if (state)
|
||||
cage_control_w(cage_cpu->machine, 0);
|
||||
cpu_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -231,7 +231,7 @@ static TIMER_DEVICE_CALLBACK( dma_timer_callback )
|
||||
tms32031_io_regs[DMA_SOURCE_ADDR] = param;
|
||||
|
||||
/* set the interrupt */
|
||||
cpu_set_input_line(cage_cpu, TMS3203X_DINT, ASSERT_LINE);
|
||||
device_set_input_line(cage_cpu, TMS3203X_DINT, ASSERT_LINE);
|
||||
dma_enabled = 0;
|
||||
}
|
||||
|
||||
@ -300,7 +300,7 @@ static TIMER_DEVICE_CALLBACK( cage_timer_callback )
|
||||
int which = param;
|
||||
|
||||
/* set the interrupt */
|
||||
cpu_set_input_line(cage_cpu, TMS3203X_TINT0 + which, ASSERT_LINE);
|
||||
device_set_input_line(cage_cpu, TMS3203X_TINT0 + which, ASSERT_LINE);
|
||||
cage_timer_enabled[which] = 0;
|
||||
update_timer(which);
|
||||
}
|
||||
@ -483,7 +483,7 @@ static READ32_HANDLER( cage_from_main_r )
|
||||
logerror("%06X:CAGE read command = %04X\n", cpu_get_pc(space->cpu), cage_from_main);
|
||||
cpu_to_cage_ready = 0;
|
||||
update_control_lines(space->machine);
|
||||
cpu_set_input_line(cage_cpu, TMS3203X_IRQ0, CLEAR_LINE);
|
||||
device_set_input_line(cage_cpu, TMS3203X_IRQ0, CLEAR_LINE);
|
||||
return cage_from_main;
|
||||
}
|
||||
|
||||
@ -531,7 +531,7 @@ static TIMER_CALLBACK( deferred_cage_w )
|
||||
cage_from_main = param;
|
||||
cpu_to_cage_ready = 1;
|
||||
update_control_lines(machine);
|
||||
cpu_set_input_line(cage_cpu, TMS3203X_IRQ0, ASSERT_LINE);
|
||||
device_set_input_line(cage_cpu, TMS3203X_IRQ0, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -564,7 +564,7 @@ void cage_control_w(running_machine *machine, UINT16 data)
|
||||
/* CPU is reset if both control lines are 0 */
|
||||
if (!(cage_control & 3))
|
||||
{
|
||||
cpu_set_input_line(cage_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(cage_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
|
||||
dma_enabled = 0;
|
||||
dma_timer_enabled = 0;
|
||||
@ -581,7 +581,7 @@ void cage_control_w(running_machine *machine, UINT16 data)
|
||||
cage_to_cpu_ready = 0;
|
||||
}
|
||||
else
|
||||
cpu_set_input_line(cage_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(cage_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
|
||||
/* update the control state */
|
||||
update_control_lines(machine);
|
||||
@ -597,7 +597,7 @@ void cage_control_w(running_machine *machine, UINT16 data)
|
||||
|
||||
static WRITE32_HANDLER( speedup_w )
|
||||
{
|
||||
cpu_eat_cycles(space->cpu, 100);
|
||||
device_eat_cycles(space->cpu, 100);
|
||||
COMBINE_DATA(&speedup_ram[offset]);
|
||||
}
|
||||
|
||||
|
@ -1622,7 +1622,7 @@ static WRITE8_HANDLER( qb3_sound_w )
|
||||
static MACHINE_RESET( qb3_sound )
|
||||
{
|
||||
MACHINE_RESET_CALL(demon_sound);
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, qb3_sound_w);
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, qb3_sound_w);
|
||||
|
||||
/* this patch prevents the sound ROM from eating itself when command $0A is sent */
|
||||
/* on a cube rotate */
|
||||
|
@ -796,7 +796,7 @@ static void dcs_boot(void)
|
||||
/* rev 3/4: HALT the ADSP-2181 until program is downloaded via IDMA */
|
||||
case 3:
|
||||
case 4:
|
||||
cpu_set_input_line(dcs.cpu, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
device_set_input_line(dcs.cpu, INPUT_LINE_HALT, ASSERT_LINE);
|
||||
dsio.start_on_next_write = 0;
|
||||
break;
|
||||
}
|
||||
@ -849,9 +849,9 @@ static TIMER_CALLBACK( dcs_reset )
|
||||
memset(dcs.control_regs, 0, sizeof(dcs.control_regs));
|
||||
|
||||
/* clear all interrupts */
|
||||
cpu_set_input_line(dcs.cpu, ADSP2105_IRQ0, CLEAR_LINE);
|
||||
cpu_set_input_line(dcs.cpu, ADSP2105_IRQ1, CLEAR_LINE);
|
||||
cpu_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2105_IRQ0, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2105_IRQ1, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
|
||||
|
||||
/* initialize the comm bits */
|
||||
SET_INPUT_EMPTY();
|
||||
@ -1470,7 +1470,7 @@ WRITE32_HANDLER( dsio_idma_data_w )
|
||||
if (dsio.start_on_next_write && --dsio.start_on_next_write == 0)
|
||||
{
|
||||
logerror("Starting DSIO CPU\n");
|
||||
cpu_set_input_line(dcs.cpu, INPUT_LINE_HALT, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, INPUT_LINE_HALT, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1522,12 +1522,12 @@ void dcs_reset_w(int state)
|
||||
|
||||
/* just run through the init code again */
|
||||
dcs.cpu->machine->scheduler().synchronize(FUNC(dcs_reset));
|
||||
cpu_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
}
|
||||
|
||||
/* going low resets and reactivates the CPU */
|
||||
else
|
||||
cpu_set_input_line(dcs.cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -1569,7 +1569,7 @@ static void dcs_delayed_data_w(running_machine *machine, int data)
|
||||
machine->scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
|
||||
|
||||
/* set the IRQ line on the ADSP */
|
||||
cpu_set_input_line(dcs.cpu, ADSP2105_IRQ2, ASSERT_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2105_IRQ2, ASSERT_LINE);
|
||||
|
||||
/* indicate we are no longer empty */
|
||||
if (dcs.last_input_empty && dcs.input_empty_cb)
|
||||
@ -1606,7 +1606,7 @@ static WRITE16_HANDLER( input_latch_ack_w )
|
||||
if (!dcs.last_input_empty && dcs.input_empty_cb)
|
||||
(*dcs.input_empty_cb)(space->machine, dcs.last_input_empty = 1);
|
||||
SET_INPUT_EMPTY();
|
||||
cpu_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -1760,8 +1760,8 @@ static TIMER_DEVICE_CALLBACK( internal_timer_callback )
|
||||
timer.adjust(dcs.cpu->cycles_to_attotime(target_cycles));
|
||||
|
||||
/* the IRQ line is edge triggered */
|
||||
cpu_set_input_line(dcs.cpu, ADSP2105_TIMER, ASSERT_LINE);
|
||||
cpu_set_input_line(dcs.cpu, ADSP2105_TIMER, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2105_TIMER, ASSERT_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2105_TIMER, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -1878,7 +1878,7 @@ static WRITE16_HANDLER( adsp_control_w )
|
||||
if (data & 0x0200)
|
||||
{
|
||||
logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", cpu_get_pc(space->cpu));
|
||||
cpu_set_input_line(dcs.cpu, INPUT_LINE_RESET, PULSE_LINE);
|
||||
device_set_input_line(dcs.cpu, INPUT_LINE_RESET, PULSE_LINE);
|
||||
dcs_boot();
|
||||
dcs.control_regs[SYSCONTROL_REG] = 0;
|
||||
}
|
||||
@ -1986,8 +1986,8 @@ static TIMER_DEVICE_CALLBACK( sport0_irq )
|
||||
/* so we skip the SPORT interrupt if we read with output_control within the last 5 cycles */
|
||||
if ((dcs.cpu->total_cycles() - dcs.output_control_cycles) > 5)
|
||||
{
|
||||
cpu_set_input_line(dcs.cpu, ADSP2115_SPORT0_RX, ASSERT_LINE);
|
||||
cpu_set_input_line(dcs.cpu, ADSP2115_SPORT0_RX, CLEAR_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2115_SPORT0_RX, ASSERT_LINE);
|
||||
device_set_input_line(dcs.cpu, ADSP2115_SPORT0_RX, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2073,7 +2073,7 @@ static void sound_tx_callback(adsp21xx_device &device, int port, INT32 data)
|
||||
static READ16_HANDLER( dcs_polling_r )
|
||||
{
|
||||
if (dcs.polling_count++ > 5)
|
||||
cpu_eat_cycles(space->cpu, 10000);
|
||||
device_eat_cycles(space->cpu, 10000);
|
||||
return *dcs_polling_base;
|
||||
}
|
||||
|
||||
@ -2131,7 +2131,7 @@ static TIMER_CALLBACK( s1_ack_callback2 )
|
||||
machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param);
|
||||
return;
|
||||
}
|
||||
output_latch_w(cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM), 0, 0x000a, 0xffff);
|
||||
output_latch_w(dcs.cpu->memory().space(ADDRESS_SPACE_PROGRAM), 0, 0x000a, 0xffff);
|
||||
}
|
||||
|
||||
|
||||
@ -2143,7 +2143,7 @@ static TIMER_CALLBACK( s1_ack_callback1 )
|
||||
machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param);
|
||||
return;
|
||||
}
|
||||
output_latch_w(cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM), 0, param, 0xffff);
|
||||
output_latch_w(dcs.cpu->memory().space(ADDRESS_SPACE_PROGRAM), 0, param, 0xffff);
|
||||
|
||||
/* chain to the next word we need to write back */
|
||||
machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2));
|
||||
@ -2273,7 +2273,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
|
||||
|
||||
static TIMER_CALLBACK( s2_ack_callback )
|
||||
{
|
||||
address_space *space = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = dcs.cpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
/* if the output is full, stall for a usec */
|
||||
if (IS_OUTPUT_FULL())
|
||||
|
@ -39,8 +39,8 @@ void hdsnd_init(running_machine *machine)
|
||||
static void update_68k_interrupts(running_machine *machine)
|
||||
{
|
||||
harddriv_state *state = machine->driver_data<harddriv_state>();
|
||||
cpu_set_input_line(state->soundcpu, 1, state->mainflag ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpu_set_input_line(state->soundcpu, 3, state->irq68k ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->soundcpu, 1, state->mainflag ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->soundcpu, 3, state->irq68k ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -86,8 +86,8 @@ WRITE16_HANDLER( hd68k_snd_data_w )
|
||||
WRITE16_HANDLER( hd68k_snd_reset_w )
|
||||
{
|
||||
harddriv_state *state = space->machine->driver_data<harddriv_state>();
|
||||
cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
state->mainflag = state->soundflag = 0;
|
||||
update_68k_interrupts(space->machine);
|
||||
logerror("%06X:Reset sound\n", cpu_get_previouspc(space->cpu));
|
||||
@ -195,7 +195,7 @@ WRITE16_HANDLER( hdsnd68k_latches_w )
|
||||
case 4: /* RES320 */
|
||||
logerror("%06X:RES320=%d\n", cpu_get_previouspc(space->cpu), data);
|
||||
if (state->sounddsp != NULL)
|
||||
cpu_set_input_line(state->sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
|
||||
device_set_input_line(state->sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
|
||||
break;
|
||||
|
||||
case 7: /* LED */
|
||||
@ -242,7 +242,7 @@ WRITE16_HANDLER( hdsnd68k_320ram_w )
|
||||
READ16_HANDLER( hdsnd68k_320ports_r )
|
||||
{
|
||||
harddriv_state *state = space->machine->driver_data<harddriv_state>();
|
||||
address_space *iospace = cpu_get_address_space(state->sounddsp, ADDRESS_SPACE_IO);
|
||||
address_space *iospace = state->sounddsp->memory().space(ADDRESS_SPACE_IO);
|
||||
return iospace->read_word((offset & 7) << 1);
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ READ16_HANDLER( hdsnd68k_320ports_r )
|
||||
WRITE16_HANDLER( hdsnd68k_320ports_w )
|
||||
{
|
||||
harddriv_state *state = space->machine->driver_data<harddriv_state>();
|
||||
address_space *iospace = cpu_get_address_space(state->sounddsp, ADDRESS_SPACE_IO);
|
||||
address_space *iospace = state->sounddsp->memory().space(ADDRESS_SPACE_IO);
|
||||
iospace->write_word((offset & 7) << 1, data);
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ READ16_HANDLER( hdsnddsp_get_bio )
|
||||
/* if we're not at the next BIO yet, advance us there */
|
||||
if (cycles_until_bio > 0)
|
||||
{
|
||||
cpu_adjust_icount(space->cpu, -cycles_until_bio);
|
||||
device_adjust_icount(space->cpu, -cycles_until_bio);
|
||||
state->last_bio_cycles += CYCLES_PER_BIO;
|
||||
}
|
||||
else
|
||||
|
@ -25,7 +25,7 @@ static DEVICE_START( hyprolyb_adpcm )
|
||||
{
|
||||
hyprolyb_adpcm_state *state = get_safe_token(device);
|
||||
|
||||
state->space = cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM);
|
||||
state->space = device->machine->device("audiocpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
state->msm = device->machine->device("msm");
|
||||
device->save_item(NAME(state->adpcm_ready)); // only bootlegs
|
||||
device->save_item(NAME(state->adpcm_busy));
|
||||
|
@ -262,7 +262,7 @@ void cojag_sound_init(running_machine *machine)
|
||||
}
|
||||
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
memory_install_write32_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w);
|
||||
memory_install_write32_handler(machine->device("audiocpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -538,7 +538,7 @@ static DEVICE_START( common_sh_start )
|
||||
{
|
||||
leland_sound_state *state = get_safe_token(device);
|
||||
running_machine *machine = device->machine;
|
||||
address_space *dmaspace = cputag_get_address_space(machine, "audiocpu", AS_PROGRAM);
|
||||
address_space *dmaspace = machine->device("audiocpu")->memory().space(AS_PROGRAM);
|
||||
int i;
|
||||
|
||||
/* determine which sound hardware is installed */
|
||||
@ -697,7 +697,7 @@ static IRQ_CALLBACK( int_callback )
|
||||
if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", device->machine->time().as_double(), state->i80186.intr.poll_status & 0x1f);
|
||||
|
||||
/* clear the interrupt */
|
||||
cpu_set_input_line(state->i80186.cpu, 0, CLEAR_LINE);
|
||||
device_set_input_line(state->i80186.cpu, 0, CLEAR_LINE);
|
||||
state->i80186.intr.pending = 0;
|
||||
|
||||
/* clear the request and set the in-service bit */
|
||||
@ -1511,18 +1511,18 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
|
||||
temp = (state->i80186.mem.peripheral & 0xffc0) << 4;
|
||||
if (state->i80186.mem.middle_size & 0x0040)
|
||||
{
|
||||
memory_install_readwrite16_device_handler(cpu_get_address_space(state->i80186.cpu, ADDRESS_SPACE_PROGRAM), device, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
memory_install_readwrite16_device_handler(state->i80186.cpu->memory().space(ADDRESS_SPACE_PROGRAM), device, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp &= 0xffff;
|
||||
memory_install_readwrite16_device_handler(cpu_get_address_space(state->i80186.cpu, ADDRESS_SPACE_IO), device, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
memory_install_readwrite16_device_handler(state->i80186.cpu->memory().space(ADDRESS_SPACE_IO), device, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
}
|
||||
|
||||
/* we need to do this at a time when the 80186 context is swapped in */
|
||||
/* this register is generally set once at startup and never again, so it's a good */
|
||||
/* time to set it up */
|
||||
cpu_set_irq_callback(state->i80186.cpu, int_callback);
|
||||
device_set_irq_callback(state->i80186.cpu, int_callback);
|
||||
break;
|
||||
|
||||
case 0xc0/2:
|
||||
@ -1582,12 +1582,12 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
|
||||
temp = (data & 0x0fff) << 8;
|
||||
if (data & 0x1000)
|
||||
{
|
||||
memory_install_readwrite16_device_handler(cpu_get_address_space(state->i80186.cpu, ADDRESS_SPACE_PROGRAM), device, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
memory_install_readwrite16_device_handler(state->i80186.cpu->memory().space(ADDRESS_SPACE_PROGRAM), device, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp &= 0xffff;
|
||||
memory_install_readwrite16_device_handler(cpu_get_address_space(state->i80186.cpu, ADDRESS_SPACE_IO), device, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
memory_install_readwrite16_device_handler(state->i80186.cpu->memory().space(ADDRESS_SPACE_IO), device, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
}
|
||||
/* popmessage("Sound CPU reset");*/
|
||||
break;
|
||||
|
@ -425,7 +425,7 @@ static SOUND_START( mario )
|
||||
if (audiocpu != NULL && audiocpu->type() != Z80)
|
||||
{
|
||||
state->eabank = "bank1";
|
||||
memory_install_read_bank(cpu_get_address_space(audiocpu, ADDRESS_SPACE_PROGRAM), 0x000, 0x7ff, 0, 0, "bank1");
|
||||
memory_install_read_bank(audiocpu->memory().space(ADDRESS_SPACE_PROGRAM), 0x000, 0x7ff, 0, 0, "bank1");
|
||||
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);
|
||||
}
|
||||
@ -437,7 +437,7 @@ static SOUND_START( mario )
|
||||
static SOUND_RESET( mario )
|
||||
{
|
||||
mario_state *state = machine->driver_data<mario_state>();
|
||||
address_space *space = cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = machine->device("audiocpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
#if USE_8039
|
||||
set_ea(machine, 1);
|
||||
|
@ -288,14 +288,14 @@ static INTERRUPT_GEN( ssio_14024_clock )
|
||||
|
||||
/* if the low 5 bits clocked to 0, bit 6 has changed state */
|
||||
if ((ssio_14024_count & 0x3f) == 0)
|
||||
cpu_set_input_line(device, 0, (ssio_14024_count & 0x40) ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(device, 0, (ssio_14024_count & 0x40) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static READ8_HANDLER( ssio_irq_clear )
|
||||
{
|
||||
/* a read here asynchronously resets the 14024 count, clearing /SINT */
|
||||
ssio_14024_count = 0;
|
||||
cpu_set_input_line(ssio_sound_cpu, 0, CLEAR_LINE);
|
||||
device_set_input_line(ssio_sound_cpu, 0, CLEAR_LINE);
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
@ -373,7 +373,7 @@ void ssio_reset_w(running_machine *machine, int state)
|
||||
{
|
||||
int i;
|
||||
|
||||
cpu_set_input_line(ssio_sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(ssio_sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
|
||||
/* latches also get reset */
|
||||
for (i = 0; i < 4; i++)
|
||||
@ -383,7 +383,7 @@ void ssio_reset_w(running_machine *machine, int state)
|
||||
}
|
||||
/* going low resets and reactivates the CPU */
|
||||
else
|
||||
cpu_set_input_line(ssio_sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(ssio_sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
}
|
||||
|
||||
READ8_HANDLER( ssio_input_port_r )
|
||||
@ -509,7 +509,7 @@ static WRITE_LINE_DEVICE_HANDLER( csdeluxe_irq )
|
||||
{
|
||||
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
|
||||
|
||||
cpu_set_input_line(csdeluxe_sound_cpu, 4, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(csdeluxe_sound_cpu, 4, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( csdeluxe_delayed_data_w )
|
||||
@ -558,7 +558,7 @@ READ8_HANDLER( csdeluxe_status_r )
|
||||
|
||||
void csdeluxe_reset_w(running_machine *machine, int state)
|
||||
{
|
||||
cpu_set_input_line(csdeluxe_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(csdeluxe_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -647,7 +647,7 @@ static WRITE_LINE_DEVICE_HANDLER( soundsgood_irq )
|
||||
{
|
||||
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
|
||||
|
||||
cpu_set_input_line(soundsgood_sound_cpu, 4, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(soundsgood_sound_cpu, 4, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( soundsgood_delayed_data_w )
|
||||
@ -677,7 +677,7 @@ READ8_HANDLER( soundsgood_status_r )
|
||||
void soundsgood_reset_w(running_machine *machine, int state)
|
||||
{
|
||||
//if (state) mame_printf_debug("SG Reset\n");
|
||||
cpu_set_input_line(soundsgood_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(soundsgood_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -751,7 +751,7 @@ static WRITE_LINE_DEVICE_HANDLER( turbocs_irq )
|
||||
{
|
||||
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
|
||||
|
||||
cpu_set_input_line(turbocs_sound_cpu, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(turbocs_sound_cpu, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( turbocs_delayed_data_w )
|
||||
@ -780,7 +780,7 @@ READ8_HANDLER( turbocs_status_r )
|
||||
|
||||
void turbocs_reset_w(running_machine *machine, int state)
|
||||
{
|
||||
cpu_set_input_line(turbocs_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(turbocs_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -888,7 +888,7 @@ static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
|
||||
device_t *pia1 = device->machine->device("sntpia1");
|
||||
int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1);
|
||||
|
||||
cpu_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( squawkntalk_delayed_data_w )
|
||||
@ -908,7 +908,7 @@ WRITE8_HANDLER( squawkntalk_data_w )
|
||||
|
||||
void squawkntalk_reset_w(running_machine *machine, int state)
|
||||
{
|
||||
cpu_set_input_line(squawkntalk_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(squawkntalk_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@ static WRITE8_HANDLER( namco_52xx_O_w )
|
||||
static TIMER_CALLBACK( namco_52xx_irq_clear )
|
||||
{
|
||||
namco_52xx_state *state = get_safe_token((device_t *)ptr);
|
||||
cpu_set_input_line(state->cpu, 0, CLEAR_LINE);
|
||||
device_set_input_line(state->cpu, 0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_DEVICE_HANDLER( namco_52xx_write )
|
||||
@ -144,7 +144,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write )
|
||||
|
||||
device->machine->scheduler().synchronize(FUNC(namco_52xx_latch_callback), data, (void *)device);
|
||||
|
||||
cpu_set_input_line(state->cpu, 0, ASSERT_LINE);
|
||||
device_set_input_line(state->cpu, 0, ASSERT_LINE);
|
||||
|
||||
// The execution time of one instruction is ~4us, so we must make sure to
|
||||
// give the cpu time to poll the /IRQ input before we clear it.
|
||||
|
@ -113,7 +113,7 @@ static WRITE8_HANDLER( namco_54xx_R1_w )
|
||||
static TIMER_CALLBACK( namco_54xx_irq_clear )
|
||||
{
|
||||
namco_54xx_state *state = get_safe_token((device_t *)ptr);
|
||||
cpu_set_input_line(state->cpu, 0, CLEAR_LINE);
|
||||
device_set_input_line(state->cpu, 0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_DEVICE_HANDLER( namco_54xx_write )
|
||||
@ -122,7 +122,7 @@ WRITE8_DEVICE_HANDLER( namco_54xx_write )
|
||||
|
||||
device->machine->scheduler().synchronize(FUNC(namco_54xx_latch_callback), data, (void *)device);
|
||||
|
||||
cpu_set_input_line(state->cpu, 0, ASSERT_LINE);
|
||||
device_set_input_line(state->cpu, 0, ASSERT_LINE);
|
||||
|
||||
// The execution time of one instruction is ~4us, so we must make sure to
|
||||
// give the cpu time to poll the /IRQ input before we clear it.
|
||||
|
@ -39,7 +39,7 @@ static READ16_HANDLER( speedup_r )
|
||||
{
|
||||
if ((cpu_get_pc(space->cpu) == 0xc12d) && (!(su_82 & 0xff00)))
|
||||
{
|
||||
cpu_spinuntil_int(space->cpu);
|
||||
device_spin_until_interrupt(space->cpu);
|
||||
}
|
||||
|
||||
return su_82;
|
||||
@ -90,7 +90,7 @@ void namcoc7x_on_driver_init(running_machine *machine)
|
||||
// install speedup cheat
|
||||
for (cpu = machine->device("maincpu"); cpu != NULL; cpu = cpu->typenext())
|
||||
if (cpu->type() == M37702)
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w);
|
||||
memory_install_readwrite16_handler(cpu->memory().space(ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w);
|
||||
}
|
||||
|
||||
void namcoc7x_set_host_ram(UINT32 *hostram)
|
||||
@ -189,8 +189,8 @@ ADDRESS_MAP_END
|
||||
INTERRUPT_GEN( namcoc7x_interrupt )
|
||||
{
|
||||
if (cpu_getiloops(device) == 0)
|
||||
cpu_set_input_line(device, M37710_LINE_IRQ0, HOLD_LINE);
|
||||
device_set_input_line(device, M37710_LINE_IRQ0, HOLD_LINE);
|
||||
else
|
||||
cpu_set_input_line(device, M37710_LINE_IRQ2, HOLD_LINE);
|
||||
device_set_input_line(device, M37710_LINE_IRQ2, HOLD_LINE);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ static STREAM_UPDATE( engine_sound_update )
|
||||
}
|
||||
|
||||
/* determine the effective clock rate */
|
||||
clock = (cputag_get_clock(device->machine, "maincpu") / 16) * ((state->sample_msb + 1) * 64 + state->sample_lsb + 1) / (64*64);
|
||||
clock = (device->machine->device("maincpu")->unscaled_clock() / 16) * ((state->sample_msb + 1) * 64 + state->sample_lsb + 1) / (64*64);
|
||||
step = (clock << 12) / OUTPUT_RATE;
|
||||
|
||||
/* determine the volume */
|
||||
|
@ -125,7 +125,7 @@ WRITE8_HANDLER( hotshock_sh_irqtrigger_w )
|
||||
READ8_DEVICE_HANDLER( hotshock_soundlatch_r )
|
||||
{
|
||||
cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
|
||||
return soundlatch_r(cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM),0);
|
||||
return soundlatch_r(device->machine->device("audiocpu")->memory().space(ADDRESS_SPACE_PROGRAM),0);
|
||||
}
|
||||
|
||||
static void filter_w(device_t *device, int data)
|
||||
@ -161,7 +161,7 @@ WRITE8_HANDLER( frogger_filter_w )
|
||||
|
||||
void scramble_sh_init(running_machine *machine)
|
||||
{
|
||||
cpu_set_irq_callback(machine->device("audiocpu"), scramble_sh_irq_callback);
|
||||
device_set_irq_callback(machine->device("audiocpu"), scramble_sh_irq_callback);
|
||||
|
||||
/* PR is always 0, D is always 1 */
|
||||
ttl7474_d_w(machine->device("konami_7474"), 1);
|
||||
|
@ -311,7 +311,7 @@ static TIMER_DEVICE_CALLBACK( increment_t1_clock )
|
||||
void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask)
|
||||
{
|
||||
/* halt the USB CPU at reset time */
|
||||
cpu_set_input_line(usb.cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(usb.cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
|
||||
/* start the clock timer */
|
||||
usb.t1_clock_mask = t1_clock_mask;
|
||||
@ -329,7 +329,7 @@ READ8_HANDLER( sega_usb_status_r )
|
||||
{
|
||||
LOG(("%04X:usb_data_r = %02X\n", cpu_get_pc(space->cpu), (usb.out_latch & 0x81) | (usb.in_latch & 0x7e)));
|
||||
|
||||
cpu_adjust_icount(space->cpu, -200);
|
||||
device_adjust_icount(space->cpu, -200);
|
||||
|
||||
/* only bits 0 and 7 are controlled by the I8035; the remaining */
|
||||
/* bits 1-6 reflect the current input latch values */
|
||||
@ -342,7 +342,7 @@ static TIMER_CALLBACK( delayed_usb_data_w )
|
||||
int data = param;
|
||||
|
||||
/* look for rising/falling edges of bit 7 to control the RESET line */
|
||||
cpu_set_input_line(usb.cpu, INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(usb.cpu, INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* if the CLEAR line is set, the low 7 bits of the input are ignored */
|
||||
if ((usb.last_p2_value & 0x40) == 0)
|
||||
|
@ -103,7 +103,7 @@ static UINT8 decrypt_opcode(int a,int src)
|
||||
|
||||
void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length)
|
||||
{
|
||||
address_space *space = cputag_get_address_space(machine, cpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = machine->device(cpu)->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
|
||||
UINT8 *rom = machine->region(cpu)->base();
|
||||
int i;
|
||||
@ -291,9 +291,9 @@ static void update_irq_lines(running_machine *machine, int param)
|
||||
}
|
||||
|
||||
if ((irq1 & irq2) == 0xff) /* no IRQs pending */
|
||||
cpu_set_input_line(sound_cpu,0,CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu,0,CLEAR_LINE);
|
||||
else /* IRQ pending */
|
||||
cpu_set_input_line_and_vector(sound_cpu,0,ASSERT_LINE,irq1 & irq2);
|
||||
device_set_input_line_and_vector(sound_cpu,0,ASSERT_LINE,irq1 & irq2);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( seibu_irq_clear_w )
|
||||
|
@ -205,9 +205,9 @@ static TIMER_CALLBACK( setirq_callback )
|
||||
return;
|
||||
|
||||
if (irqstate == 0) /* no IRQs pending */
|
||||
cpu_set_input_line(cpu,0,CLEAR_LINE);
|
||||
device_set_input_line(cpu,0,CLEAR_LINE);
|
||||
else /* IRQ pending */
|
||||
cpu_set_input_line(cpu,0,ASSERT_LINE);
|
||||
device_set_input_line(cpu,0,ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ static TIMER_DEVICE_CALLBACK( taito_en_timer_callback )
|
||||
/* Only cause IRQ if the mask is set to allow it */
|
||||
if (m68681_imr & 0x08)
|
||||
{
|
||||
cpu_set_input_line_vector(timer.machine->device("audiocpu"), 6, vector_reg);
|
||||
device_set_input_line_vector(timer.machine->device("audiocpu"), 6, vector_reg);
|
||||
cputag_set_input_line(timer.machine, "audiocpu", 6, ASSERT_LINE);
|
||||
imr_status |= 0x08;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ static void interrupt_controller( device_t *device )
|
||||
|
||||
if (tc0140syt->nmi_req && tc0140syt->nmi_enabled)
|
||||
{
|
||||
cpu_set_input_line(tc0140syt->slavecpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(tc0140syt->slavecpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
tc0140syt->nmi_req = 0;
|
||||
}
|
||||
}
|
||||
@ -123,11 +123,11 @@ WRITE8_DEVICE_HANDLER( tc0140syt_comm_w )
|
||||
//#endif
|
||||
/* this does a hi-lo transition to reset the sound cpu */
|
||||
if (data)
|
||||
cpu_set_input_line(tc0140syt->slavecpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(tc0140syt->slavecpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
else
|
||||
{
|
||||
cpu_set_input_line(tc0140syt->slavecpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
cpu_spin(tc0140syt->mastercpu); /* otherwise no sound in driftout */
|
||||
device_set_input_line(tc0140syt->slavecpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_spin(tc0140syt->mastercpu); /* otherwise no sound in driftout */
|
||||
}
|
||||
break;
|
||||
|
||||
@ -200,7 +200,7 @@ WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w )
|
||||
tc0140syt->masterdata[tc0140syt->submode ++] = data;
|
||||
tc0140syt->status |= TC0140SYT_PORT01_FULL_MASTER;
|
||||
//logerror("taitosnd: Slave cpu sends 0/1 : %01x%01x\n" , tc0140syt->masterdata[1] , tc0140syt->masterdata[0]);
|
||||
cpu_spin(tc0140syt->slavecpu); /* writing should take longer than emulated, so spin */
|
||||
device_spin(tc0140syt->slavecpu); /* writing should take longer than emulated, so spin */
|
||||
break;
|
||||
|
||||
case 0x02: // mode #2
|
||||
@ -212,7 +212,7 @@ WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w )
|
||||
tc0140syt->masterdata[tc0140syt->submode ++] = data;
|
||||
tc0140syt->status |= TC0140SYT_PORT23_FULL_MASTER;
|
||||
//logerror("taitosnd: Slave cpu sends 2/3 : %01x%01x\n" , tc0140syt->masterdata[3] , tc0140syt->masterdata[2]);
|
||||
cpu_spin(tc0140syt->slavecpu); /* writing should take longer than emulated, so spin */
|
||||
device_spin(tc0140syt->slavecpu); /* writing should take longer than emulated, so spin */
|
||||
break;
|
||||
|
||||
case 0x04: // port status
|
||||
|
@ -151,7 +151,7 @@ WRITE8_HANDLER( timeplt_sh_irqtrigger_w )
|
||||
if (state->last_irq_state == 0 && data)
|
||||
{
|
||||
/* setting bit 0 low then high triggers IRQ on the sound CPU */
|
||||
cpu_set_input_line_and_vector(state->soundcpu, 0, HOLD_LINE, 0xff);
|
||||
device_set_input_line_and_vector(state->soundcpu, 0, HOLD_LINE, 0xff);
|
||||
}
|
||||
|
||||
state->last_irq_state = data;
|
||||
|
@ -151,7 +151,7 @@ WRITE8_HANDLER( konami_sh_irqtrigger_w )
|
||||
if (state->last_irq == 0 && data)
|
||||
{
|
||||
/* setting bit 0 low then high triggers IRQ on the sound CPU */
|
||||
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
|
||||
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
|
||||
}
|
||||
|
||||
state->last_irq = data;
|
||||
|
@ -387,15 +387,15 @@ static void init_audio_state(running_machine *machine)
|
||||
williams_sound_int_state = 0;
|
||||
if (sound_cpu != NULL)
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
|
||||
cpu_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
cpu_set_input_line(sound_cpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
}
|
||||
if (soundalt_cpu != NULL)
|
||||
{
|
||||
cpu_set_input_line(soundalt_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
|
||||
cpu_set_input_line(soundalt_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
cpu_set_input_line(soundalt_cpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
device_set_input_line(soundalt_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
|
||||
device_set_input_line(soundalt_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
device_set_input_line(soundalt_cpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -413,13 +413,13 @@ static void cvsd_ym2151_irq(device_t *device, int state)
|
||||
|
||||
static WRITE_LINE_DEVICE_HANDLER( cvsd_irqa )
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb )
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -430,7 +430,7 @@ static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb )
|
||||
|
||||
static void adpcm_ym2151_irq(device_t *device, int state)
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -486,18 +486,18 @@ void williams_cvsd_data_w(running_machine *machine, int data)
|
||||
|
||||
void williams_cvsd_reset_w(int state)
|
||||
{
|
||||
address_space *space = cpu_get_address_space(sound_cpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = sound_cpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
/* going high halts the CPU */
|
||||
if (state)
|
||||
{
|
||||
cvsd_bank_select_w(space, 0, 0);
|
||||
init_audio_state(space->machine);
|
||||
cpu_set_input_line(space->cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(space->cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
}
|
||||
/* going low resets and reactivates the CPU */
|
||||
else
|
||||
cpu_set_input_line(space->cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(space->cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -520,7 +520,7 @@ static WRITE8_HANDLER( narc_slave_bank_select_w )
|
||||
|
||||
static READ8_HANDLER( narc_command_r )
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
williams_sound_int_state = 0;
|
||||
return soundlatch_r(space, 0);
|
||||
}
|
||||
@ -529,13 +529,13 @@ static READ8_HANDLER( narc_command_r )
|
||||
static WRITE8_HANDLER( narc_command2_w )
|
||||
{
|
||||
soundlatch2_w(space, 0, data & 0xff);
|
||||
cpu_set_input_line(soundalt_cpu, M6809_FIRQ_LINE, ASSERT_LINE);
|
||||
device_set_input_line(soundalt_cpu, M6809_FIRQ_LINE, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
static READ8_HANDLER( narc_command2_r )
|
||||
{
|
||||
cpu_set_input_line(soundalt_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
|
||||
device_set_input_line(soundalt_cpu, M6809_FIRQ_LINE, CLEAR_LINE);
|
||||
return soundlatch2_r(space, 0);
|
||||
}
|
||||
|
||||
@ -581,13 +581,13 @@ static WRITE8_HANDLER( narc_slave_sync_w )
|
||||
|
||||
void williams_narc_data_w(int data)
|
||||
{
|
||||
address_space *space = cpu_get_address_space(sound_cpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = sound_cpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
soundlatch_w(space, 0, data & 0xff);
|
||||
cpu_set_input_line(sound_cpu, INPUT_LINE_NMI, (data & 0x100) ? CLEAR_LINE : ASSERT_LINE);
|
||||
device_set_input_line(sound_cpu, INPUT_LINE_NMI, (data & 0x100) ? CLEAR_LINE : ASSERT_LINE);
|
||||
if (!(data & 0x200))
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
|
||||
williams_sound_int_state = 1;
|
||||
}
|
||||
}
|
||||
@ -598,18 +598,18 @@ void williams_narc_reset_w(int state)
|
||||
/* going high halts the CPU */
|
||||
if (state)
|
||||
{
|
||||
address_space *space = cpu_get_address_space(sound_cpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = sound_cpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
narc_master_bank_select_w(space, 0, 0);
|
||||
narc_slave_bank_select_w(space, 0, 0);
|
||||
init_audio_state(space->machine);
|
||||
cpu_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
cpu_set_input_line(soundalt_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(soundalt_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
}
|
||||
/* going low resets and reactivates the CPU */
|
||||
else
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
cpu_set_input_line(soundalt_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(soundalt_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -645,7 +645,7 @@ static TIMER_CALLBACK( clear_irq_state )
|
||||
|
||||
static READ8_HANDLER( adpcm_command_r )
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_IRQ_LINE, CLEAR_LINE);
|
||||
|
||||
/* don't clear the external IRQ state for a short while; this allows the
|
||||
self-tests to pass */
|
||||
@ -668,11 +668,11 @@ static WRITE8_HANDLER( adpcm_talkback_w )
|
||||
|
||||
void williams_adpcm_data_w(int data)
|
||||
{
|
||||
address_space *space = cpu_get_address_space(sound_cpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = sound_cpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
soundlatch_w(space, 0, data & 0xff);
|
||||
if (!(data & 0x200))
|
||||
{
|
||||
cpu_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
|
||||
device_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
|
||||
williams_sound_int_state = 1;
|
||||
space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
|
||||
}
|
||||
@ -684,14 +684,14 @@ void williams_adpcm_reset_w(int state)
|
||||
/* going high halts the CPU */
|
||||
if (state)
|
||||
{
|
||||
address_space *space = cpu_get_address_space(sound_cpu, ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = sound_cpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
adpcm_bank_select_w(space, 0, 0);
|
||||
init_audio_state(space->machine);
|
||||
cpu_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
|
||||
}
|
||||
/* going low resets and reactivates the CPU */
|
||||
else
|
||||
cpu_set_input_line(sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
device_set_input_line(sound_cpu, INPUT_LINE_RESET, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -603,7 +603,7 @@ static DRIVER_INIT( 1943b )
|
||||
DRIVER_INIT_CALL( 1943 );
|
||||
//it expects 0x00 to be returned from the protection reads because the protection has been patched out.
|
||||
//AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r)
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc007, 0xc007, 0, 0, _1943b_c007_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xc007, 0xc007, 0, 0, _1943b_c007_r);
|
||||
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ static WRITE8_HANDLER( irqack_w )
|
||||
cpu_interrupt_enable(state->maincpu, bit);
|
||||
|
||||
if (!bit)
|
||||
cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
|
||||
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( timer_pulse_w )
|
||||
|
@ -408,14 +408,14 @@ GFXDECODE_END
|
||||
|
||||
static INTERRUPT_GEN( drill_interrupt )
|
||||
{
|
||||
cpu_set_input_line(device, 4, HOLD_LINE);
|
||||
device_set_input_line(device, 4, HOLD_LINE);
|
||||
}
|
||||
|
||||
/* WRONG,it does something with 60000c & 700002,likely to be called when the player throws the ball.*/
|
||||
static void irqhandler(device_t *device, int irq)
|
||||
{
|
||||
// _2mindril_state *state = machine->driver_data<_2mindril_state>();
|
||||
// cpu_set_input_line(state->maincpu, 5, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
// device_set_input_line(state->maincpu, 5, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2610_interface ym2610_config =
|
||||
|
@ -229,7 +229,7 @@ static TIMER_CALLBACK( nmi_callback )
|
||||
{
|
||||
fortyl_state *state = machine->driver_data<fortyl_state>();
|
||||
if (state->sound_nmi_enable)
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
else
|
||||
state->pending_nmi = 1;
|
||||
}
|
||||
@ -252,7 +252,7 @@ static WRITE8_HANDLER( nmi_enable_w )
|
||||
state->sound_nmi_enable = 1;
|
||||
if (state->pending_nmi)
|
||||
{
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
state->pending_nmi = 0;
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ static WRITE8_HANDLER( k88games_5f84_w )
|
||||
static WRITE8_HANDLER( k88games_sh_irqtrigger_w )
|
||||
{
|
||||
_88games_state *state = space->machine->driver_data<_88games_state>();
|
||||
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
|
||||
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ static VIDEO_START( acefruit )
|
||||
static INTERRUPT_GEN( acefruit_vblank )
|
||||
{
|
||||
acefruit_state *state = device->machine->driver_data<acefruit_state>();
|
||||
cpu_set_input_line(device, 0, HOLD_LINE );
|
||||
device_set_input_line(device, 0, HOLD_LINE );
|
||||
state->refresh_timer->adjust( attotime::zero );
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ static WRITE8_HANDLER( actfancr_sound_w )
|
||||
{
|
||||
actfancr_state *state = space->machine->driver_data<actfancr_state>();
|
||||
soundlatch_w(space, 0, data & 0xff);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
@ -266,7 +266,7 @@ GFXDECODE_END
|
||||
static void sound_irq(device_t *device, int linestate)
|
||||
{
|
||||
actfancr_state *state = device->machine->driver_data<actfancr_state>();
|
||||
cpu_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
|
||||
device_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
|
||||
}
|
||||
|
||||
static const ym3812_interface ym3812_config =
|
||||
@ -589,7 +589,7 @@ static READ8_HANDLER( cycle_r )
|
||||
|
||||
if (pc == 0xe29a && ret == 0)
|
||||
{
|
||||
cpu_spinuntil_int(space->cpu);
|
||||
device_spin_until_interrupt(space->cpu);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -607,7 +607,7 @@ static READ8_HANDLER( cyclej_r )
|
||||
|
||||
if (pc == 0xe2b1 && ret == 0)
|
||||
{
|
||||
cpu_spinuntil_int(space->cpu);
|
||||
device_spin_until_interrupt(space->cpu);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -616,12 +616,12 @@ static READ8_HANDLER( cyclej_r )
|
||||
|
||||
static DRIVER_INIT( actfancr )
|
||||
{
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cycle_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cycle_r);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( actfancrj )
|
||||
{
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -179,7 +179,7 @@ public:
|
||||
static void duart_irq_handler( device_t *device, UINT8 vector )
|
||||
{
|
||||
adp_state *state = device->machine->driver_data<adp_state>();
|
||||
cpu_set_input_line_and_vector(state->maincpu, 4, HOLD_LINE, vector);
|
||||
device_set_input_line_and_vector(state->maincpu, 4, HOLD_LINE, vector);
|
||||
};
|
||||
|
||||
static void duart_tx( device_t *device, int channel, UINT8 data )
|
||||
@ -614,7 +614,7 @@ INPUT_PORTS_END
|
||||
/*
|
||||
static INTERRUPT_GEN( adp_int )
|
||||
{
|
||||
cpu_set_input_line(device, 1, HOLD_LINE); // ??? All irqs have the same vector, and the mask used is 0 or 7
|
||||
device_set_input_line(device, 1, HOLD_LINE); // ??? All irqs have the same vector, and the mask used is 0 or 7
|
||||
}
|
||||
*/
|
||||
static const ay8910_interface ay8910_config =
|
||||
|
@ -45,7 +45,7 @@ static INTERRUPT_GEN( aeroboto_interrupt )
|
||||
aeroboto_state *state = device->machine->driver_data<aeroboto_state>();
|
||||
|
||||
if (!state->disable_irq)
|
||||
cpu_set_input_line(device, 0, ASSERT_LINE);
|
||||
device_set_input_line(device, 0, ASSERT_LINE);
|
||||
else
|
||||
state->disable_irq--;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ static WRITE16_HANDLER( sound_command_w )
|
||||
{
|
||||
state->pending_command = 1;
|
||||
soundlatch_w(space, offset, data & 0xff);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ static WRITE16_HANDLER( turbofrc_sound_command_w )
|
||||
{
|
||||
state->pending_command = 1;
|
||||
soundlatch_w(space, offset, (data >> 8) & 0xff);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ static WRITE16_HANDLER( aerfboot_soundlatch_w )
|
||||
if(ACCESSING_BITS_8_15)
|
||||
{
|
||||
soundlatch_w(space, 0, (data >> 8) & 0xff);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1283,7 +1283,7 @@ GFXDECODE_END
|
||||
static void irqhandler( device_t *device, int irq )
|
||||
{
|
||||
aerofgt_state *state = device->machine->driver_data<aerofgt_state>();
|
||||
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2610_interface ym2610_config =
|
||||
|
@ -264,7 +264,7 @@ static READ8_HANDLER( devram_r )
|
||||
static WRITE8_HANDLER( master_nmi_trigger_w )
|
||||
{
|
||||
airbustr_state *state = space->machine->driver_data<airbustr_state>();
|
||||
cpu_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( master_bankswitch_w )
|
||||
@ -316,7 +316,7 @@ static WRITE8_HANDLER( soundcommand_w )
|
||||
airbustr_state *state = space->machine->driver_data<airbustr_state>();
|
||||
soundlatch_w(space, 0, data);
|
||||
state->soundlatch_status = 1; // soundlatch has been written
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( soundcommand2_w )
|
||||
@ -561,14 +561,14 @@ static INTERRUPT_GEN( master_interrupt )
|
||||
{
|
||||
airbustr_state *state = device->machine->driver_data<airbustr_state>();
|
||||
state->master_addr ^= 0x02;
|
||||
cpu_set_input_line_and_vector(device, 0, HOLD_LINE, state->master_addr);
|
||||
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->master_addr);
|
||||
}
|
||||
|
||||
static INTERRUPT_GEN( slave_interrupt )
|
||||
{
|
||||
airbustr_state *state = device->machine->driver_data<airbustr_state>();
|
||||
state->slave_addr ^= 0x02;
|
||||
cpu_set_input_line_and_vector(device, 0, HOLD_LINE, state->slave_addr);
|
||||
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->slave_addr);
|
||||
}
|
||||
|
||||
/* Machine Initialization */
|
||||
@ -798,7 +798,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( airbustr )
|
||||
{
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_PROGRAM), 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here
|
||||
memory_install_read8_handler(machine->device("master")->memory().space(ADDRESS_SPACE_PROGRAM), 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here
|
||||
}
|
||||
|
||||
|
||||
|
@ -221,7 +221,7 @@ static CUSTOM_INPUT( lightgun_holster_r )
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( alg_cia_0_porta_w )
|
||||
{
|
||||
address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = device->machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
/* switch banks as appropriate */
|
||||
memory_set_bank(device->machine, "bank1", data & 1);
|
||||
|
@ -24,7 +24,7 @@ static INTERRUPT_GEN( aliens_interrupt )
|
||||
aliens_state *state = device->machine->driver_data<aliens_state>();
|
||||
|
||||
if (k051960_is_irq_enabled(state->k051960))
|
||||
cpu_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
|
||||
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
|
||||
}
|
||||
|
||||
static READ8_HANDLER( bankedram_r )
|
||||
@ -76,7 +76,7 @@ static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
|
||||
aliens_state *state = space->machine->driver_data<aliens_state>();
|
||||
|
||||
soundlatch_w(space, offset, data);
|
||||
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
|
||||
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
|
||||
}
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
|
||||
|
@ -320,7 +320,7 @@ static WRITE16_HANDLER( paddlema_soundlatch_w )
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
soundlatch_w(space, 0, data);
|
||||
cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
|
||||
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ static WRITE16_HANDLER( tnextspc_soundlatch_w )
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
soundlatch_w(space, 0, data);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
//ZT
|
||||
@ -1842,7 +1842,7 @@ static const ym2203_interface ym2203_config =
|
||||
static void YM3812_irq( device_t *device, int param )
|
||||
{
|
||||
alpha68k_state *state = device->machine->driver_data<alpha68k_state>();
|
||||
cpu_set_input_line(state->audiocpu, 0, (param) ? HOLD_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->audiocpu, 0, (param) ? HOLD_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym3812_interface ym3812_config =
|
||||
@ -1853,9 +1853,9 @@ static const ym3812_interface ym3812_config =
|
||||
static INTERRUPT_GEN( alpha68k_interrupt )
|
||||
{
|
||||
if (cpu_getiloops(device) == 0)
|
||||
cpu_set_input_line(device, 1, HOLD_LINE);
|
||||
device_set_input_line(device, 1, HOLD_LINE);
|
||||
else
|
||||
cpu_set_input_line(device, 2, HOLD_LINE);
|
||||
device_set_input_line(device, 2, HOLD_LINE);
|
||||
}
|
||||
//ZT
|
||||
|
||||
@ -3108,7 +3108,7 @@ static DRIVER_INIT( kyros )
|
||||
static DRIVER_INIT( jongbou )
|
||||
{
|
||||
alpha68k_state *state = machine->driver_data<alpha68k_state>();
|
||||
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r);
|
||||
memory_install_read16_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r);
|
||||
state->invert_controls = 0;
|
||||
state->microcontroller_id = 0x00ff;
|
||||
state->coin_id = 0x23 | (0x24 << 8);
|
||||
|
@ -71,7 +71,7 @@ static WRITE8_HANDLER( amspdwy_sound_w )
|
||||
{
|
||||
amspdwy_state *state = space->machine->driver_data<amspdwy_state>();
|
||||
soundlatch_w(space, 0, data);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( amspdwy_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
@ -242,7 +242,7 @@ GFXDECODE_END
|
||||
static void irq_handler( device_t *device, int irq )
|
||||
{
|
||||
amspdwy_state *state = device->machine->driver_data<amspdwy_state>();
|
||||
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface amspdwy_ym2151_interface =
|
||||
|
@ -515,7 +515,7 @@ static READ8_HANDLER( angelkds_sub_sound_r )
|
||||
static void irqhandler( device_t *device, int irq )
|
||||
{
|
||||
angelkds_state *state = device->machine->driver_data<angelkds_state>();
|
||||
cpu_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2203_interface ym2203_config =
|
||||
|
@ -598,7 +598,7 @@ static DRIVER_INIT(robowres)
|
||||
|
||||
static DRIVER_INIT(robowresb)
|
||||
{
|
||||
address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x1c000);
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ static WRITE16_HANDLER( aquarium_sound_w )
|
||||
aquarium_state *state = space->machine->driver_data<aquarium_state>();
|
||||
|
||||
soundlatch_w(space, 1, data & 0xff);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE );
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE );
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( aquarium_z80_bank_w )
|
||||
@ -331,7 +331,7 @@ GFXDECODE_END
|
||||
static void irq_handler( device_t *device, int irq )
|
||||
{
|
||||
aquarium_state *state = device->machine->driver_data<aquarium_state>();
|
||||
cpu_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
|
@ -105,11 +105,11 @@ static WRITE8_DEVICE_HANDLER( arcadia_cia_0_porta_w )
|
||||
/* swap the write handlers between ROM and bank 1 based on the bit */
|
||||
if ((data & 1) == 0)
|
||||
/* overlay disabled, map RAM on 0x000000 */
|
||||
memory_install_write_bank(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, "bank1");
|
||||
memory_install_write_bank(device->machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, "bank1");
|
||||
|
||||
else
|
||||
/* overlay enabled, map Amiga system ROM on 0x000000 */
|
||||
memory_unmap_write(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0);
|
||||
memory_unmap_write(device->machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0);
|
||||
|
||||
/* bit 2 = Power Led on Amiga */
|
||||
set_led_status(device->machine, 0, (data & 2) ? 0 : 1);
|
||||
|
@ -135,9 +135,9 @@ Known issues :
|
||||
static INTERRUPT_GEN( argus_interrupt )
|
||||
{
|
||||
if (cpu_getiloops(device) == 0)
|
||||
cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7); /* RST 10h */
|
||||
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7); /* RST 10h */
|
||||
else
|
||||
cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0xcf); /* RST 08h */
|
||||
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xcf); /* RST 08h */
|
||||
}
|
||||
|
||||
/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
|
||||
|
@ -1446,10 +1446,10 @@ ROM_END
|
||||
|
||||
static void arkanoid_bootleg_init( running_machine *machine )
|
||||
{
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf000, 0xf000, 0, 0, arkanoid_bootleg_f000_r );
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r );
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w );
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r );
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xf000, 0xf000, 0, 0, arkanoid_bootleg_f000_r );
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r );
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w );
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r );
|
||||
}
|
||||
|
||||
static DRIVER_INIT( arkangc )
|
||||
@ -1541,7 +1541,7 @@ static DRIVER_INIT( tetrsark )
|
||||
ROM[x] = ROM[x] ^ 0x94;
|
||||
}
|
||||
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd008, 0xd008, 0, 0, tetrsark_d008_w );
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xd008, 0xd008, 0, 0, tetrsark_d008_w );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1172,7 +1172,7 @@ static DRIVER_INIT( ultennis )
|
||||
state->protection_handler = ultennis_protection;
|
||||
|
||||
/* additional (protection?) hack */
|
||||
memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x300000, 0x300001, 0, 0, ultennis_hack_r);
|
||||
memory_install_read16_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x300000, 0x300001, 0, 0, ultennis_hack_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -277,7 +277,7 @@ GFXDECODE_END
|
||||
static void ym2203_irq_handler( device_t *device, int irq )
|
||||
{
|
||||
ashnojoe_state *state = device->machine->driver_data<ashnojoe_state>();
|
||||
cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( ym2203_write_a )
|
||||
@ -317,7 +317,7 @@ static void ashnojoe_vclk_cb( device_t *device )
|
||||
else
|
||||
{
|
||||
msm5205_data_w(device, state->adpcm_byte & 0xf);
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
state->msm5205_vclk_toggle ^= 1;
|
||||
|
@ -63,7 +63,7 @@ static INTERRUPT_GEN( asterix_interrupt )
|
||||
if (!k056832_is_irq_enabled(state->k056832, 0))
|
||||
return;
|
||||
|
||||
cpu_set_input_line(device, 5, HOLD_LINE); /* ??? All irqs have the same vector, and the mask used is 0 or 7 */
|
||||
device_set_input_line(device, 5, HOLD_LINE); /* ??? All irqs have the same vector, and the mask used is 0 or 7 */
|
||||
}
|
||||
|
||||
static READ8_DEVICE_HANDLER( asterix_sound_r )
|
||||
@ -74,21 +74,21 @@ static READ8_DEVICE_HANDLER( asterix_sound_r )
|
||||
static TIMER_CALLBACK( nmi_callback )
|
||||
{
|
||||
asterix_state *state = machine->driver_data<asterix_state>();
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( sound_arm_nmi_w )
|
||||
{
|
||||
asterix_state *state = space->machine->driver_data<asterix_state>();
|
||||
|
||||
cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
space->machine->scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback));
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( sound_irq_w )
|
||||
{
|
||||
asterix_state *state = space->machine->driver_data<asterix_state>();
|
||||
cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
|
||||
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
|
||||
}
|
||||
|
||||
// Check the routine at 7f30 in the ead version.
|
||||
|
@ -921,14 +921,14 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( asteroidb )
|
||||
{
|
||||
memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2000, 0x2000, 0, 0, "IN0");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2003, 0x2003, 0, 0, "HS");
|
||||
memory_install_read_port(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x2000, 0x2000, 0, 0, "IN0");
|
||||
memory_install_read_port(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x2003, 0x2003, 0, 0, "HS");
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( asterock )
|
||||
{
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2000, 0x2007, 0, 0, asterock_IN0_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x2000, 0x2007, 0, 0, asterock_IN0_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,7 +206,7 @@ static SCREEN_UPDATE( spaceint )
|
||||
static TIMER_CALLBACK( kamikaze_int_off )
|
||||
{
|
||||
astinvad_state *state = machine->driver_data<astinvad_state>();
|
||||
cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
|
||||
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ static TIMER_CALLBACK( kamizake_int_gen )
|
||||
{
|
||||
astinvad_state *state = machine->driver_data<astinvad_state>();
|
||||
/* interrupts are asserted on every state change of the 128V line */
|
||||
cpu_set_input_line(state->maincpu, 0, ASSERT_LINE);
|
||||
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
|
||||
param ^= 128;
|
||||
state->int_timer->adjust(machine->primary_screen->time_until_pos(param), param);
|
||||
|
||||
@ -277,7 +277,7 @@ static INPUT_CHANGED( spaceint_coin_inserted )
|
||||
{
|
||||
astinvad_state *state = field->port->machine->driver_data<astinvad_state>();
|
||||
/* coin insertion causes an NMI */
|
||||
cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -425,7 +425,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
|
||||
int bank = (data >> 5) & 3;
|
||||
|
||||
/* this is accessed from I/O space but modifies program space, so we normalize here */
|
||||
space = cpu_get_address_space(space->cpu, ADDRESS_SPACE_PROGRAM);
|
||||
space = space->cpu->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
/* remember the banking bits for save state support */
|
||||
profpac_bank = data;
|
||||
@ -458,7 +458,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
|
||||
|
||||
static STATE_POSTLOAD( profbank_banksw_restore )
|
||||
{
|
||||
address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
|
||||
address_space *space = machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO);
|
||||
|
||||
profpac_banksw_w(space, 0, profpac_bank);
|
||||
}
|
||||
@ -1729,54 +1729,54 @@ ROM_END
|
||||
static DRIVER_INIT( seawolf2 )
|
||||
{
|
||||
astrocade_video_config = 0x00;
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w);
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w);
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w);
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w);
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w);
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( ebases )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT;
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x20, 0x20, 0, 0xff07, ebases_coin_w);
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w);
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x20, 0x20, 0, 0xff07, ebases_coin_w);
|
||||
memory_install_write8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( spacezap )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW;
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( wow )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, wow_io_r);
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x17, 0x17, 0xffff, 0xff00, wow_speech_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, wow_io_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x17, 0x17, 0xffff, 0xff00, wow_speech_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( gorf )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r);
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r);
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( robby )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT;
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, robby_io_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, robby_io_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( profpac )
|
||||
{
|
||||
address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
|
||||
address_space *iospace = machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO);
|
||||
|
||||
astrocade_video_config = AC_SOUND_PRESENT;
|
||||
memory_install_read8_handler(iospace, 0x14, 0x14, 0x0fff, 0xff00, profpac_io_1_r);
|
||||
@ -1790,7 +1790,7 @@ static DRIVER_INIT( profpac )
|
||||
|
||||
static DRIVER_INIT( demndrgn )
|
||||
{
|
||||
address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
|
||||
address_space *iospace = machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO);
|
||||
|
||||
astrocade_video_config = 0x00;
|
||||
memory_install_read8_handler(iospace, 0x14, 0x14, 0x1fff, 0xff00, demndrgn_io_r);
|
||||
@ -1806,7 +1806,7 @@ static DRIVER_INIT( demndrgn )
|
||||
|
||||
static DRIVER_INIT( tenpindx )
|
||||
{
|
||||
address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
|
||||
address_space *iospace = machine->device("maincpu")->memory().space(ADDRESS_SPACE_IO);
|
||||
|
||||
astrocade_video_config = 0x00;
|
||||
memory_install_read_port(iospace, 0x60, 0x60, 0x0000, 0xff00, "P60");
|
||||
|
@ -503,8 +503,8 @@ static INTERRUPT_GEN( skilldrp_irq )
|
||||
{
|
||||
switch (cpu_getiloops(device))
|
||||
{
|
||||
case 0: cpu_set_input_line(device, 4, HOLD_LINE); break; // sprites, sound, i/o
|
||||
case 1: cpu_set_input_line(device, 2, HOLD_LINE); break; // palette
|
||||
case 0: device_set_input_line(device, 4, HOLD_LINE); break; // sprites, sound, i/o
|
||||
case 1: device_set_input_line(device, 2, HOLD_LINE); break; // palette
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
static READ8_HANDLER( irq_clear_r )
|
||||
{
|
||||
astrof_state *state = space->machine->driver_data<astrof_state>();
|
||||
cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
|
||||
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -91,7 +91,7 @@ static READ8_HANDLER( irq_clear_r )
|
||||
static TIMER_DEVICE_CALLBACK( irq_callback )
|
||||
{
|
||||
astrof_state *state = timer.machine->driver_data<astrof_state>();
|
||||
cpu_set_input_line(state->maincpu, 0, ASSERT_LINE);
|
||||
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ static INPUT_CHANGED( coin_inserted )
|
||||
astrof_state *state = field->port->machine->driver_data<astrof_state>();
|
||||
|
||||
/* coin insertion causes an NMI */
|
||||
cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
|
||||
coin_counter_w(field->port->machine, 0, newval);
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ static INPUT_CHANGED( service_coin_inserted )
|
||||
astrof_state *state = field->port->machine->driver_data<astrof_state>();
|
||||
|
||||
/* service coin insertion causes an NMI */
|
||||
cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
|
||||
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -1308,8 +1308,8 @@ static DRIVER_INIT( abattle )
|
||||
rom[i] = prom[rom[i]];
|
||||
|
||||
/* set up protection handlers */
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
}
|
||||
|
||||
|
||||
@ -1322,8 +1322,8 @@ static DRIVER_INIT( afire )
|
||||
rom[i] = ~rom[i];
|
||||
|
||||
/* set up protection handlers */
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, afire_coin_prot_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, afire_coin_prot_r);
|
||||
}
|
||||
|
||||
|
||||
@ -1336,8 +1336,8 @@ static DRIVER_INIT( sstarbtl )
|
||||
rom[i] = ~rom[i];
|
||||
|
||||
/* set up protection handlers */
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -233,13 +233,13 @@ DIP locations verified for:
|
||||
static TIMER_CALLBACK( cadash_interrupt5 )
|
||||
{
|
||||
asuka_state *state = machine->driver_data<asuka_state>();
|
||||
cpu_set_input_line(state->maincpu, 5, HOLD_LINE);
|
||||
device_set_input_line(state->maincpu, 5, HOLD_LINE);
|
||||
}
|
||||
|
||||
static INTERRUPT_GEN( cadash_interrupt )
|
||||
{
|
||||
device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(cadash_interrupt5));
|
||||
cpu_set_input_line(device, 4, HOLD_LINE); /* interrupt vector 4 */
|
||||
device_set_input_line(device, 4, HOLD_LINE); /* interrupt vector 4 */
|
||||
}
|
||||
|
||||
|
||||
|
@ -192,7 +192,7 @@ static void pitfightb_cheap_slapstic_init(running_machine *machine)
|
||||
atarig1_state *state = machine->driver_data<atarig1_state>();
|
||||
|
||||
/* install a read handler */
|
||||
state->bslapstic_base = memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x038000, 0x03ffff, 0, 0, pitfightb_cheap_slapstic_r);
|
||||
state->bslapstic_base = memory_install_read16_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0x038000, 0x03ffff, 0, 0, pitfightb_cheap_slapstic_r);
|
||||
|
||||
/* allocate memory for a copy of bank 0 */
|
||||
state->bslapstic_bank0 = auto_alloc_array(machine, UINT8, 0x2000);
|
||||
|
@ -81,7 +81,7 @@ static MACHINE_RESET( atarigt )
|
||||
|
||||
static void cage_irq_callback(running_machine *machine, int reason)
|
||||
{
|
||||
address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
if (reason)
|
||||
atarigen_sound_int_gen(machine->device("maincpu"));
|
||||
@ -1282,7 +1282,7 @@ static DRIVER_INIT( tmek )
|
||||
state->protection_w = tmek_protection_w;
|
||||
|
||||
/* temp hack */
|
||||
memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd72000, 0xd75fff, 0, 0, tmek_pf_w);
|
||||
memory_install_write32_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xd72000, 0xd75fff, 0, 0, tmek_pf_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2246,7 +2246,7 @@ static DRIVER_INIT( rrreveng )
|
||||
|
||||
state->playfield_base = 0x000;
|
||||
|
||||
memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r);
|
||||
memory_install_read32_handler(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -346,7 +346,7 @@ static WRITE16_HANDLER( bankselect_w )
|
||||
|
||||
static STATE_POSTLOAD( bankselect_postload )
|
||||
{
|
||||
address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *space = machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
atarisy2_state *state = machine->driver_data<atarisy2_state>();
|
||||
|
||||
bankselect_w(space, 0, state->bankselect[0], 0xffff);
|
||||
|
@ -962,7 +962,7 @@ next_line:
|
||||
static DRIVER_INIT( laststar )
|
||||
{
|
||||
atarisy4_state *state = machine->driver_data<atarisy4_state>();
|
||||
address_space *main = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
address_space *main = machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
/* Allocate 16kB of shared RAM */
|
||||
state->shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
|
||||
@ -974,7 +974,7 @@ static DRIVER_INIT( laststar )
|
||||
/* Set up the DSP */
|
||||
memory_set_bankptr(machine, "dsp0_bank0", state->shared_ram[0]);
|
||||
memory_set_bankptr(machine, "dsp0_bank1", &state->shared_ram[0][0x800]);
|
||||
load_ldafile(cputag_get_address_space(machine, "dsp0", ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
|
||||
load_ldafile(machine->device("dsp0")->memory().space(ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
|
||||
}
|
||||
|
||||
static DRIVER_INIT( airrace )
|
||||
@ -985,17 +985,17 @@ static DRIVER_INIT( airrace )
|
||||
state->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), machine->region("code")->base());
|
||||
load_hexfile(machine->device("maincpu")->memory().space(ADDRESS_SPACE_PROGRAM), machine->region("code")->base());
|
||||
|
||||
/* Set up the first DSP */
|
||||
memory_set_bankptr(machine, "dsp0_bank0", state->shared_ram[0]);
|
||||
memory_set_bankptr(machine, "dsp0_bank1", &state->shared_ram[0][0x800]);
|
||||
load_ldafile(cputag_get_address_space(machine, "dsp0", ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
|
||||
load_ldafile(machine->device("dsp0")->memory().space(ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
|
||||
|
||||
/* Set up the second DSP */
|
||||
memory_set_bankptr(machine, "dsp1_bank0", state->shared_ram[1]);
|
||||
memory_set_bankptr(machine, "dsp1_bank1", &state->shared_ram[1][0x800]);
|
||||
load_ldafile(cputag_get_address_space(machine, "dsp1", ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
|
||||
load_ldafile(machine->device("dsp1")->memory().space(ADDRESS_SPACE_PROGRAM), machine->region("dsp")->base());
|
||||
}
|
||||
|
||||
static MACHINE_RESET( atarisy4 )
|
||||
|
@ -711,7 +711,7 @@ static DRIVER_INIT( ataxx )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
memory_install_read8_handler(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
}
|
||||
|
||||
|
||||
@ -721,7 +721,7 @@ static DRIVER_INIT( ataxxj )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
memory_install_read8_handler(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
}
|
||||
|
||||
|
||||
@ -731,9 +731,9 @@ static DRIVER_INIT( wsf )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1_P2");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P3_P4");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "BUTTONS");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1_P2");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P3_P4");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "BUTTONS");
|
||||
}
|
||||
|
||||
|
||||
@ -743,14 +743,14 @@ static DRIVER_INIT( indyheat )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x00, 0x02, 0, 0, indyheat_wheel_r);
|
||||
memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_r);
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P2");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3");
|
||||
memory_install_read8_handler(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x00, 0x02, 0, 0, indyheat_wheel_r);
|
||||
memory_install_read8_handler(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_r);
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P2");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3");
|
||||
|
||||
/* set up additional output ports */
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_w);
|
||||
memory_install_write8_handler(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_w);
|
||||
}
|
||||
|
||||
|
||||
@ -760,9 +760,9 @@ static DRIVER_INIT( brutforc )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3");
|
||||
}
|
||||
|
||||
|
||||
@ -772,12 +772,12 @@ static DRIVER_INIT( asylum )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* asylum appears to have some extra RAM for the slave CPU */
|
||||
memory_install_ram(cputag_get_address_space(machine, "slave", ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, NULL);
|
||||
memory_install_ram(machine->device("slave")->memory().space(ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, NULL);
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1");
|
||||
memory_install_read_port(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1");
|
||||
memory_install_read_port(machine->device("master")->memory().space(ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3");
|
||||
}
|
||||
|
||||
|
||||
|
@ -236,7 +236,7 @@ INPUT_PORTS_END
|
||||
|
||||
static INTERRUPT_GEN( avalnche_interrupt )
|
||||
{
|
||||
cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
|
||||
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static MACHINE_START( avalnche )
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user