mirror of
https://github.com/holub/mame
synced 2025-07-07 10:58:41 +03:00
Cleanups and version bump.
This commit is contained in:
parent
f935e05a10
commit
861db1eb49
@ -671,7 +671,7 @@ int cli_info_listdevices(core_options *options, const char *gamename)
|
|||||||
for (devconfig = config->devicelist.first(); devconfig != NULL; devconfig = devconfig->next())
|
for (devconfig = config->devicelist.first(); devconfig != NULL; devconfig = devconfig->next())
|
||||||
{
|
{
|
||||||
printf(" %s ('%s')", devconfig->name(), devconfig->tag());
|
printf(" %s ('%s')", devconfig->name(), devconfig->tag());
|
||||||
|
|
||||||
UINT32 clock = devconfig->clock();
|
UINT32 clock = devconfig->clock();
|
||||||
if (clock >= 1000000000)
|
if (clock >= 1000000000)
|
||||||
printf(" @ %d.%02d GHz\n", clock / 1000000000, (clock / 10000000) % 100);
|
printf(" @ %d.%02d GHz\n", clock / 1000000000, (clock / 10000000) % 100);
|
||||||
@ -813,8 +813,8 @@ static int info_listmedia(core_options *options, const char *gamename)
|
|||||||
{
|
{
|
||||||
src = downcast<const legacy_image_device_config_base *>(dev)->file_extensions();
|
src = downcast<const legacy_image_device_config_base *>(dev)->file_extensions();
|
||||||
name = downcast<const legacy_image_device_config_base *>(dev)->instance_name();
|
name = downcast<const legacy_image_device_config_base *>(dev)->instance_name();
|
||||||
shortname = downcast<const legacy_image_device_config_base *>(dev)->brief_instance_name();
|
shortname = downcast<const legacy_image_device_config_base *>(dev)->brief_instance_name();
|
||||||
|
|
||||||
sprintf(paren_shortname, "(%s)", shortname);
|
sprintf(paren_shortname, "(%s)", shortname);
|
||||||
|
|
||||||
printf("%-13s%-12s%-8s ", driver_name, name, paren_shortname);
|
printf("%-13s%-12s%-8s ", driver_name, name, paren_shortname);
|
||||||
@ -829,7 +829,7 @@ static int info_listmedia(core_options *options, const char *gamename)
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
if (!devcount)
|
if (!devcount)
|
||||||
printf("%-13s(none)\n",driver_name);
|
printf("%-13s(none)\n",driver_name);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
|
@ -1090,8 +1090,8 @@ CPU_GET_INFO( cdp1802 )
|
|||||||
case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cdp1802); break;
|
case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cdp1802); break;
|
||||||
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cdp1802); break;
|
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cdp1802); break;
|
||||||
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cdp1802); break;
|
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cdp1802); break;
|
||||||
case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(cdp1802); break;
|
case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(cdp1802); break;
|
||||||
case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(cdp1802); break;
|
case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(cdp1802); break;
|
||||||
case CPUINFO_FCT_EXPORT_STRING: info->export_string = CPU_EXPORT_STRING_NAME(cdp1802); break;
|
case CPUINFO_FCT_EXPORT_STRING: info->export_string = CPU_EXPORT_STRING_NAME(cdp1802); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as pointers --- */
|
/* --- the following bits of info are returned as pointers --- */
|
||||||
|
@ -92,7 +92,7 @@ struct _cop400_state
|
|||||||
const address_space *program;
|
const address_space *program;
|
||||||
const address_space *data;
|
const address_space *data;
|
||||||
const address_space *io;
|
const address_space *io;
|
||||||
|
|
||||||
UINT8 featuremask;
|
UINT8 featuremask;
|
||||||
|
|
||||||
/* registers */
|
/* registers */
|
||||||
@ -1409,9 +1409,9 @@ static CPU_GET_INFO( cop400 )
|
|||||||
case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cop400); break;
|
case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(cop400); break;
|
||||||
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop400); break;
|
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(cop400); break;
|
||||||
case CPUINFO_FCT_DISASSEMBLE: /* set per-core */ break;
|
case CPUINFO_FCT_DISASSEMBLE: /* set per-core */ break;
|
||||||
// case CPUINFO_FCT_VALIDITY_CHECK: /* set per-core */ break;
|
// case CPUINFO_FCT_VALIDITY_CHECK: /* set per-core */ break;
|
||||||
case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(cop400); break;
|
case CPUINFO_FCT_IMPORT_STATE: info->import_state = CPU_IMPORT_STATE_NAME(cop400); break;
|
||||||
case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(cop400); break;
|
case CPUINFO_FCT_EXPORT_STATE: info->export_state = CPU_EXPORT_STATE_NAME(cop400); break;
|
||||||
case CPUINFO_FCT_EXPORT_STRING: info->export_string = CPU_EXPORT_STRING_NAME(cop400); break;
|
case CPUINFO_FCT_EXPORT_STRING: info->export_string = CPU_EXPORT_STRING_NAME(cop400); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as pointers --- */
|
/* --- the following bits of info are returned as pointers --- */
|
||||||
@ -1443,7 +1443,7 @@ CPU_GET_INFO( cop410 )
|
|||||||
/* --- the following bits of info are returned as pointers to functions --- */
|
/* --- the following bits of info are returned as pointers to functions --- */
|
||||||
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop410); break;
|
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop410); break;
|
||||||
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop410); break;
|
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop410); break;
|
||||||
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop410); break;
|
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop410); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as pointers --- */
|
/* --- the following bits of info are returned as pointers --- */
|
||||||
case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_512b); break;
|
case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_512b); break;
|
||||||
@ -1501,7 +1501,7 @@ CPU_GET_INFO( cop420 )
|
|||||||
/* --- the following bits of info are returned as pointers to functions --- */
|
/* --- the following bits of info are returned as pointers to functions --- */
|
||||||
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop420); break;
|
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop420); break;
|
||||||
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop420); break;
|
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop420); break;
|
||||||
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop420); break;
|
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop420); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as pointers --- */
|
/* --- the following bits of info are returned as pointers --- */
|
||||||
case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_1kb); break;
|
case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_1kb); break;
|
||||||
@ -1528,7 +1528,7 @@ CPU_GET_INFO( cop421 )
|
|||||||
{
|
{
|
||||||
/* --- the following bits of info are returned as pointers to data or functions --- */
|
/* --- the following bits of info are returned as pointers to data or functions --- */
|
||||||
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop421); break;
|
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop421); break;
|
||||||
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop421); break;
|
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop421); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as NULL-terminated strings --- */
|
/* --- the following bits of info are returned as NULL-terminated strings --- */
|
||||||
case DEVINFO_STR_NAME: strcpy(info->s, "COP421"); break;
|
case DEVINFO_STR_NAME: strcpy(info->s, "COP421"); break;
|
||||||
@ -1582,7 +1582,7 @@ CPU_GET_INFO( cop444 )
|
|||||||
/* --- the following bits of info are returned as pointers to functions --- */
|
/* --- the following bits of info are returned as pointers to functions --- */
|
||||||
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop444); break;
|
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(cop444); break;
|
||||||
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop444); break;
|
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(cop444); break;
|
||||||
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop444); break;
|
// case CPUINFO_FCT_VALIDITY_CHECK: info->validity_check = CPU_VALIDITY_CHECK_NAME(cop444); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as pointers --- */
|
/* --- the following bits of info are returned as pointers --- */
|
||||||
case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_2kb); break;
|
case DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map8 = ADDRESS_MAP_NAME(program_2kb); break;
|
||||||
|
@ -450,7 +450,7 @@ static CPU_INIT( i4004 )
|
|||||||
state->state_add(STATE_GENPC, "GENPC", cpustate->PC.w.l).mask(0x0fff).noshow();
|
state->state_add(STATE_GENPC, "GENPC", cpustate->PC.w.l).mask(0x0fff).noshow();
|
||||||
state->state_add(STATE_GENFLAGS, "GENFLAGS", cpustate->flags).mask(0x0f).callimport().callexport().noshow().formatstr("%4s");
|
state->state_add(STATE_GENFLAGS, "GENFLAGS", cpustate->flags).mask(0x0f).callimport().callexport().noshow().formatstr("%4s");
|
||||||
state->state_add(I4004_A, "A", cpustate->A).mask(0x0f);
|
state->state_add(I4004_A, "A", cpustate->A).mask(0x0f);
|
||||||
|
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
for (int regnum = 0; regnum < 8; regnum++)
|
for (int regnum = 0; regnum < 8; regnum++)
|
||||||
state->state_add(I4004_R01 + regnum, tempstr.format("R%X%X", regnum*2, regnum*2+1), cpustate->R[regnum]);
|
state->state_add(I4004_R01 + regnum, tempstr.format("R%X%X", regnum*2, regnum*2+1), cpustate->R[regnum]);
|
||||||
|
@ -535,7 +535,7 @@ static CPU_INIT( i8008 )
|
|||||||
state->state_add(I8008_E, "E", cpustate->E);
|
state->state_add(I8008_E, "E", cpustate->E);
|
||||||
state->state_add(I8008_H, "H", cpustate->H);
|
state->state_add(I8008_H, "H", cpustate->H);
|
||||||
state->state_add(I8008_L, "L", cpustate->L);
|
state->state_add(I8008_L, "L", cpustate->L);
|
||||||
|
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
for (int addrnum = 0; addrnum < 8; addrnum++)
|
for (int addrnum = 0; addrnum < 8; addrnum++)
|
||||||
state->state_add(I8008_ADDR1 + addrnum, tempstr.format("ADDR%d", addrnum + 1), cpustate->ADDR[addrnum].w.l).mask(0xfff);
|
state->state_add(I8008_ADDR1 + addrnum, tempstr.format("ADDR%d", addrnum + 1), cpustate->ADDR[addrnum].w.l).mask(0xfff);
|
||||||
|
@ -466,7 +466,7 @@ static CPU_EXPORT_STRING( i8086 )
|
|||||||
case I8086_GENSP:
|
case I8086_GENSP:
|
||||||
string.printf("%04X:%04X", cpustate->sregs[SS] & 0xffff, cpustate->regs.w[SP] & 0xffff);
|
string.printf("%04X:%04X", cpustate->sregs[SS] & 0xffff, cpustate->regs.w[SP] & 0xffff);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_GENFLAGS:
|
case STATE_GENFLAGS:
|
||||||
cpustate->flags = CompressFlags();
|
cpustate->flags = CompressFlags();
|
||||||
string.printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
|
string.printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
|
||||||
|
@ -853,7 +853,7 @@ static CPU_EXPORT_STRING( m68k )
|
|||||||
case M68K_FP7:
|
case M68K_FP7:
|
||||||
string.printf("%f", fx80_to_double(REG_FP[7]));
|
string.printf("%f", fx80_to_double(REG_FP[7]));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_GENFLAGS:
|
case STATE_GENFLAGS:
|
||||||
sr = m68ki_get_sr(m68k);
|
sr = m68ki_get_sr(m68k);
|
||||||
string.printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
|
string.printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
|
||||||
@ -1309,7 +1309,7 @@ static CPU_INIT( m68000 )
|
|||||||
m68k->cyc_shift = 1;
|
m68k->cyc_shift = 1;
|
||||||
m68k->cyc_reset = 132;
|
m68k->cyc_reset = 132;
|
||||||
m68k->has_pmmu = 0;
|
m68k->has_pmmu = 0;
|
||||||
|
|
||||||
define_state(device);
|
define_state(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ static void mcs48_init(legacy_cpu_device *device, device_irq_callback irqcallbac
|
|||||||
state->state_add(MCS48_TPRE, "TPRE", cpustate->prescaler).mask(0x1f);
|
state->state_add(MCS48_TPRE, "TPRE", cpustate->prescaler).mask(0x1f);
|
||||||
state->state_add(MCS48_P1, "P1", cpustate->p1);
|
state->state_add(MCS48_P1, "P1", cpustate->p1);
|
||||||
state->state_add(MCS48_P2, "P2", cpustate->p2);
|
state->state_add(MCS48_P2, "P2", cpustate->p2);
|
||||||
|
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
for (int regnum = 0; regnum < 8; regnum++)
|
for (int regnum = 0; regnum < 8; regnum++)
|
||||||
state->state_add(MCS48_R0 + regnum, tempstr.format("R%d", regnum), cpustate->rtemp).callimport().callexport();
|
state->state_add(MCS48_R0 + regnum, tempstr.format("R%d", regnum), cpustate->rtemp).callimport().callexport();
|
||||||
|
@ -387,7 +387,7 @@ static void sm8500_set_irq_line( sm8500_state *cpustate, int irqline, int state
|
|||||||
UINT8 *sm8500_get_internal_ram(legacy_cpu_device *device)
|
UINT8 *sm8500_get_internal_ram(legacy_cpu_device *device)
|
||||||
{
|
{
|
||||||
sm8500_state *cpustate = get_safe_token(device);
|
sm8500_state *cpustate = get_safe_token(device);
|
||||||
return cpustate->internal_ram;
|
return cpustate->internal_ram;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CPU_SET_INFO( sm8500 )
|
static CPU_SET_INFO( sm8500 )
|
||||||
@ -520,7 +520,7 @@ CPU_GET_INFO( sm8500 )
|
|||||||
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sm8500); break;
|
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sm8500); break;
|
||||||
case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(sm8500); break;
|
case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(sm8500); break;
|
||||||
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sm8500); break;
|
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sm8500); break;
|
||||||
case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break;
|
case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break;
|
||||||
|
|
||||||
case DEVINFO_STR_NAME: strcpy( info->s, "sm8500" ); break;
|
case DEVINFO_STR_NAME: strcpy( info->s, "sm8500" ); break;
|
||||||
case DEVINFO_STR_FAMILY: strcpy( info->s, "Sharp SM8500" ); break;
|
case DEVINFO_STR_FAMILY: strcpy( info->s, "Sharp SM8500" ); break;
|
||||||
|
@ -796,7 +796,7 @@ static void set_irq_line(z180_state *cpustate, int irqline, int state);
|
|||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
CPU PREFIXES
|
CPU PREFIXES
|
||||||
|
|
||||||
order is important here - see z180tbl.h
|
order is important here - see z180tbl.h
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
@ -1981,9 +1981,9 @@ static CPU_INIT( z180 )
|
|||||||
state->state_add(Z180_IFF1, "IFF1", cpustate->IFF1).mask(0x1);
|
state->state_add(Z180_IFF1, "IFF1", cpustate->IFF1).mask(0x1);
|
||||||
state->state_add(Z180_IFF2, "IFF2", cpustate->IFF2).mask(0x1);
|
state->state_add(Z180_IFF2, "IFF2", cpustate->IFF2).mask(0x1);
|
||||||
state->state_add(Z180_HALT, "HALT", cpustate->HALT).mask(0x1);
|
state->state_add(Z180_HALT, "HALT", cpustate->HALT).mask(0x1);
|
||||||
|
|
||||||
state->state_add(Z180_IOLINES, "IOLINES", cpustate->ioltemp).mask(0xffffff).callimport();
|
state->state_add(Z180_IOLINES, "IOLINES", cpustate->ioltemp).mask(0xffffff).callimport();
|
||||||
|
|
||||||
state->state_add(Z180_CNTLA0, "CNTLA0", cpustate->IO_CNTLA0);
|
state->state_add(Z180_CNTLA0, "CNTLA0", cpustate->IO_CNTLA0);
|
||||||
state->state_add(Z180_CNTLA1, "CNTLA1", cpustate->IO_CNTLA1);
|
state->state_add(Z180_CNTLA1, "CNTLA1", cpustate->IO_CNTLA1);
|
||||||
state->state_add(Z180_CNTLB0, "CNTLB0", cpustate->IO_CNTLB0);
|
state->state_add(Z180_CNTLB0, "CNTLB0", cpustate->IO_CNTLB0);
|
||||||
|
@ -654,7 +654,7 @@ static CPU_INIT( z8 )
|
|||||||
state->state_add(Z8_T0, "T0", cpustate->t0);
|
state->state_add(Z8_T0, "T0", cpustate->t0);
|
||||||
state->state_add(Z8_T1, "T1", cpustate->t1);
|
state->state_add(Z8_T1, "T1", cpustate->t1);
|
||||||
state->state_add(STATE_GENFLAGS, "GENFLAGS", cpustate->r[Z8_REGISTER_FLAGS]).noshow().formatstr("%6s");
|
state->state_add(STATE_GENFLAGS, "GENFLAGS", cpustate->r[Z8_REGISTER_FLAGS]).noshow().formatstr("%6s");
|
||||||
|
|
||||||
astring tempstr;
|
astring tempstr;
|
||||||
for (int regnum = 0; regnum < 16; regnum++)
|
for (int regnum = 0; regnum < 16; regnum++)
|
||||||
state->state_add(Z8_R0 + regnum, tempstr.format("R%d", regnum), cpustate->fake_r[regnum]).callimport().callexport();
|
state->state_add(Z8_R0 + regnum, tempstr.format("R%d", regnum), cpustate->fake_r[regnum]).callimport().callexport();
|
||||||
|
@ -88,7 +88,7 @@ void z80_daisy_chain::init(device_t *cpudevice, const z80_daisy_config *daisy)
|
|||||||
device_t *target = cpudevice->siblingdevice(daisy->devname);
|
device_t *target = cpudevice->siblingdevice(daisy->devname);
|
||||||
if (target == NULL)
|
if (target == NULL)
|
||||||
fatalerror("Unable to locate device '%s'", daisy->devname);
|
fatalerror("Unable to locate device '%s'", daisy->devname);
|
||||||
|
|
||||||
// make sure it has an interface
|
// make sure it has an interface
|
||||||
device_z80daisy_interface *intf;
|
device_z80daisy_interface *intf;
|
||||||
if (!target->interface(intf))
|
if (!target->interface(intf))
|
||||||
|
@ -90,7 +90,7 @@ protected:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
daisy_entry(device_t *device);
|
daisy_entry(device_t *device);
|
||||||
|
|
||||||
daisy_entry * m_next; // next device
|
daisy_entry * m_next; // next device
|
||||||
device_t * m_device; // associated device
|
device_t * m_device; // associated device
|
||||||
device_z80daisy_interface * m_interface; // associated device's daisy interface
|
device_z80daisy_interface * m_interface; // associated device's daisy interface
|
||||||
|
@ -1595,7 +1595,7 @@ static offs_t disasm_view_find_pc_backwards(const address_space *space, offs_t t
|
|||||||
{
|
{
|
||||||
cpu_device *cpudevice = downcast<cpu_device *>(space->cpu);
|
cpu_device *cpudevice = downcast<cpu_device *>(space->cpu);
|
||||||
assert(cpudevice != NULL);
|
assert(cpudevice != NULL);
|
||||||
|
|
||||||
int minlen = memory_byte_to_address(space, cpudevice->min_opcode_bytes());
|
int minlen = memory_byte_to_address(space, cpudevice->min_opcode_bytes());
|
||||||
int maxlen = memory_byte_to_address(space, cpudevice->max_opcode_bytes());
|
int maxlen = memory_byte_to_address(space, cpudevice->max_opcode_bytes());
|
||||||
offs_t targetpcbyte = memory_address_to_byte(space, targetpc) & space->logbytemask;
|
offs_t targetpcbyte = memory_address_to_byte(space, targetpc) & space->logbytemask;
|
||||||
|
@ -121,14 +121,14 @@ bool legacy_cpu_device_config::device_process_token(UINT32 entrytype, const mach
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// everything else goes to our parent
|
// everything else goes to our parent
|
||||||
return device_config::device_process_token(entrytype, tokens);
|
return device_config::device_process_token(entrytype, tokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_clocks_to_cycles - convert the raw
|
// execute_clocks_to_cycles - convert the raw
|
||||||
// clock into cycles per second
|
// clock into cycles per second
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -136,16 +136,16 @@ UINT32 legacy_cpu_device_config::execute_clocks_to_cycles(UINT32 clocks) const
|
|||||||
{
|
{
|
||||||
UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
|
UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
|
||||||
UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
|
UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
|
||||||
|
|
||||||
if (multiplier == 0) multiplier = 1;
|
if (multiplier == 0) multiplier = 1;
|
||||||
if (divider == 0) divider = 1;
|
if (divider == 0) divider = 1;
|
||||||
|
|
||||||
return (clocks * multiplier + divider - 1) / divider;
|
return (clocks * multiplier + divider - 1) / divider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_cycles_to_clocks - convert a cycle
|
// execute_cycles_to_clocks - convert a cycle
|
||||||
// count back to raw clocks
|
// count back to raw clocks
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -153,10 +153,10 @@ UINT32 legacy_cpu_device_config::execute_cycles_to_clocks(UINT32 cycles) const
|
|||||||
{
|
{
|
||||||
UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
|
UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
|
||||||
UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
|
UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
|
||||||
|
|
||||||
if (multiplier == 0) multiplier = 1;
|
if (multiplier == 0) multiplier = 1;
|
||||||
if (divider == 0) divider = 1;
|
if (divider == 0) divider = 1;
|
||||||
|
|
||||||
return (cycles * divider + multiplier - 1) / multiplier;
|
return (cycles * divider + multiplier - 1) / multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ void legacy_cpu_device::device_start()
|
|||||||
int colon = tempstr.chr(0, ':');
|
int colon = tempstr.chr(0, ':');
|
||||||
int length = tempstr.len() - colon - 1;
|
int length = tempstr.len() - colon - 1;
|
||||||
tempstr.substr(0, colon);
|
tempstr.substr(0, colon);
|
||||||
|
|
||||||
astring formatstr;
|
astring formatstr;
|
||||||
formatstr.printf("%%%ds", length);
|
formatstr.printf("%%%ds", length);
|
||||||
device_state_entry &entry = state_add(index, tempstr, m_state_io).callimport().callexport().formatstr(formatstr);
|
device_state_entry &entry = state_add(index, tempstr, m_state_io).callimport().callexport().formatstr(formatstr);
|
||||||
@ -325,7 +325,7 @@ void legacy_cpu_device::device_start()
|
|||||||
}
|
}
|
||||||
state_add(STATE_GENPC, "curpc", m_state_io).callimport().callexport().formatstr("%8s").noshow();
|
state_add(STATE_GENPC, "curpc", m_state_io).callimport().callexport().formatstr("%8s").noshow();
|
||||||
state_add(STATE_GENPCBASE, "curpcbase", m_state_io).callimport().callexport().formatstr("%8s").noshow();
|
state_add(STATE_GENPCBASE, "curpcbase", m_state_io).callimport().callexport().formatstr("%8s").noshow();
|
||||||
|
|
||||||
const char *string = get_legacy_runtime_string(CPUINFO_STR_FLAGS);
|
const char *string = get_legacy_runtime_string(CPUINFO_STR_FLAGS);
|
||||||
if (string != NULL && string[0] != 0)
|
if (string != NULL && string[0] != 0)
|
||||||
{
|
{
|
||||||
@ -377,7 +377,7 @@ void legacy_cpu_device::execute_burn(INT32 cycles)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_translate - perform address translation
|
// memory_translate - perform address translation
|
||||||
// on the provided address
|
// on the provided address
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -390,7 +390,7 @@ bool legacy_cpu_device::memory_translate(int spacenum, int intention, offs_t &ad
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_read - read device memory, allowing for
|
// memory_read - read device memory, allowing for
|
||||||
// device specific overrides
|
// device specific overrides
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ bool legacy_cpu_device::memory_read(int spacenum, offs_t offset, int size, UINT6
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_write - write device memory, allowing
|
// memory_write - write device memory, allowing
|
||||||
// for device specific overrides
|
// for device specific overrides
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ bool legacy_cpu_device::memory_write(int spacenum, offs_t offset, int size, UINT
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_read - read device opcode memory,
|
// memory_read - read device opcode memory,
|
||||||
// allowing for device specific overrides
|
// allowing for device specific overrides
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ bool legacy_cpu_device::memory_readop(offs_t offset, int size, UINT64 &value)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// debug_setup - set up any device-specific
|
// debug_setup - set up any device-specific
|
||||||
// debugging commands or state
|
// debugging commands or state
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
@ -281,12 +281,12 @@ enum
|
|||||||
#define cpu_adjust_icount device_adjust_icount
|
#define cpu_adjust_icount device_adjust_icount
|
||||||
#define cpu_abort_timeslice device_abort_timeslice
|
#define cpu_abort_timeslice device_abort_timeslice
|
||||||
|
|
||||||
#define cpu_triggerint device_triggerint
|
#define cpu_triggerint device_triggerint
|
||||||
#define cpu_set_input_line device_set_input_line
|
#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_vector device_set_input_line_vector
|
||||||
#define cpu_set_input_line_and_vector device_set_input_line_and_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_set_irq_callback device_set_irq_callback
|
||||||
#define cpu_spin_until_int device_spin_until_int
|
#define cpu_spin_until_int device_spin_until_int
|
||||||
|
|
||||||
#define cpu_get_address_space device_get_space
|
#define cpu_get_address_space device_get_space
|
||||||
|
|
||||||
@ -403,9 +403,9 @@ union cpuinfo
|
|||||||
|
|
||||||
// ======================> cpu_device_config
|
// ======================> cpu_device_config
|
||||||
|
|
||||||
class cpu_device_config : public device_config,
|
class cpu_device_config : public device_config,
|
||||||
public device_config_execute_interface,
|
public device_config_execute_interface,
|
||||||
public device_config_memory_interface,
|
public device_config_memory_interface,
|
||||||
public device_config_state_interface,
|
public device_config_state_interface,
|
||||||
public device_config_disasm_interface
|
public device_config_disasm_interface
|
||||||
{
|
{
|
||||||
@ -431,7 +431,7 @@ public:
|
|||||||
// allocators
|
// allocators
|
||||||
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
virtual device_t *alloc_device(running_machine &machine) const;
|
virtual device_t *alloc_device(running_machine &machine) const;
|
||||||
|
|
||||||
// basic information getters
|
// basic information getters
|
||||||
virtual const char *name() const { return get_legacy_config_string(DEVINFO_STR_NAME); }
|
virtual const char *name() const { return get_legacy_config_string(DEVINFO_STR_NAME); }
|
||||||
virtual const rom_entry *rom_region() const { return reinterpret_cast<const rom_entry *>(get_legacy_config_ptr(DEVINFO_PTR_ROM_REGION)); }
|
virtual const rom_entry *rom_region() const { return reinterpret_cast<const rom_entry *>(get_legacy_config_ptr(DEVINFO_PTR_ROM_REGION)); }
|
||||||
@ -473,9 +473,9 @@ const device_type CPU = legacy_cpu_device_config::static_alloc_device_config;
|
|||||||
|
|
||||||
// ======================> cpu_device
|
// ======================> cpu_device
|
||||||
|
|
||||||
class cpu_device : public device_t,
|
class cpu_device : public device_t,
|
||||||
public device_execute_interface,
|
public device_execute_interface,
|
||||||
public device_memory_interface,
|
public device_memory_interface,
|
||||||
public device_state_interface,
|
public device_state_interface,
|
||||||
public device_disasm_interface
|
public device_disasm_interface
|
||||||
{
|
{
|
||||||
@ -509,29 +509,29 @@ public:
|
|||||||
cpu_type cputype() const { return m_cpu_config.m_cputype; }
|
cpu_type cputype() const { return m_cpu_config.m_cputype; }
|
||||||
|
|
||||||
void *token() const { return m_token; }
|
void *token() const { return m_token; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
virtual void device_debug_setup();
|
virtual void device_debug_setup();
|
||||||
|
|
||||||
// device_execute_interface overrides
|
// device_execute_interface overrides
|
||||||
virtual void execute_run();
|
virtual void execute_run();
|
||||||
virtual void execute_burn(INT32 cycles);
|
virtual void execute_burn(INT32 cycles);
|
||||||
virtual void execute_set_input(int inputnum, int state) { set_legacy_runtime_int(CPUINFO_INT_INPUT_STATE + inputnum, state); }
|
virtual void execute_set_input(int inputnum, int state) { set_legacy_runtime_int(CPUINFO_INT_INPUT_STATE + inputnum, state); }
|
||||||
|
|
||||||
// device_memory_interface overrides
|
// device_memory_interface overrides
|
||||||
virtual bool memory_translate(int spacenum, int intention, offs_t &address);
|
virtual bool memory_translate(int spacenum, int intention, offs_t &address);
|
||||||
virtual bool memory_read(int spacenum, offs_t offset, int size, UINT64 &value);
|
virtual bool memory_read(int spacenum, offs_t offset, int size, UINT64 &value);
|
||||||
virtual bool memory_write(int spacenum, offs_t offset, int size, UINT64 value);
|
virtual bool memory_write(int spacenum, offs_t offset, int size, UINT64 value);
|
||||||
virtual bool memory_readop(offs_t offset, int size, UINT64 &value);
|
virtual bool memory_readop(offs_t offset, int size, UINT64 &value);
|
||||||
|
|
||||||
// device_state_interface overrides
|
// device_state_interface overrides
|
||||||
virtual void state_import(const device_state_entry &entry);
|
virtual void state_import(const device_state_entry &entry);
|
||||||
virtual void state_export(const device_state_entry &entry);
|
virtual void state_export(const device_state_entry &entry);
|
||||||
virtual void state_string_export(const device_state_entry &entry, astring &string);
|
virtual void state_string_export(const device_state_entry &entry, astring &string);
|
||||||
|
|
||||||
// device_disasm_interface overrides
|
// device_disasm_interface overrides
|
||||||
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
|
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
|
||||||
|
|
||||||
@ -545,9 +545,9 @@ protected:
|
|||||||
// internal state
|
// internal state
|
||||||
const legacy_cpu_device_config &m_cpu_config; // reference to the config
|
const legacy_cpu_device_config &m_cpu_config; // reference to the config
|
||||||
void * m_token; // pointer to our state
|
void * m_token; // pointer to our state
|
||||||
|
|
||||||
cpu_set_info_func m_set_info; // extracted legacy function pointers
|
cpu_set_info_func m_set_info; // extracted legacy function pointers
|
||||||
cpu_execute_func m_execute; //
|
cpu_execute_func m_execute; //
|
||||||
cpu_burn_func m_burn; //
|
cpu_burn_func m_burn; //
|
||||||
cpu_translate_func m_translate; //
|
cpu_translate_func m_translate; //
|
||||||
cpu_read_func m_read; //
|
cpu_read_func m_read; //
|
||||||
|
@ -109,7 +109,7 @@ void device_list::import_config_list(const device_config_list &list, running_mac
|
|||||||
{
|
{
|
||||||
// remember the machine for later use
|
// remember the machine for later use
|
||||||
m_machine = &machine;
|
m_machine = &machine;
|
||||||
|
|
||||||
// append each device from the configuration list
|
// append each device from the configuration list
|
||||||
for (const device_config *devconfig = list.first(); devconfig != NULL; devconfig = devconfig->next())
|
for (const device_config *devconfig = list.first(); devconfig != NULL; devconfig = devconfig->next())
|
||||||
append(devconfig->tag(), devconfig->alloc_device(*m_machine));
|
append(devconfig->tag(), devconfig->alloc_device(*m_machine));
|
||||||
@ -137,7 +137,7 @@ void device_list::start_all()
|
|||||||
int numstarted = 0;
|
int numstarted = 0;
|
||||||
while (numstarted < devcount)
|
while (numstarted < devcount)
|
||||||
{
|
{
|
||||||
// iterate over devices and start them
|
// iterate over devices and start them
|
||||||
int prevstarted = numstarted;
|
int prevstarted = numstarted;
|
||||||
for (device_t *device = first(); device != NULL; device = device->next())
|
for (device_t *device = first(); device != NULL; device = device->next())
|
||||||
if (!device->started())
|
if (!device->started())
|
||||||
@ -257,7 +257,7 @@ device_config_interface::~device_config_interface()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// interface_config_complete - perform any
|
// interface_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -281,7 +281,7 @@ bool device_config_interface::interface_process_token(UINT32 entrytype, const ma
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// interface_validity_check - default validation
|
// interface_validity_check - default validation
|
||||||
// for a device after the configuration has been
|
// for a device after the configuration has been
|
||||||
// constructed
|
// constructed
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ device_config::~device_config()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// config_complete - called when the
|
// config_complete - called when the
|
||||||
// configuration of a device is complete
|
// configuration of a device is complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ void device_config::config_complete()
|
|||||||
// first notify the interfaces
|
// first notify the interfaces
|
||||||
for (device_config_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_config_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
intf->interface_config_complete();
|
intf->interface_config_complete();
|
||||||
|
|
||||||
// then notify the device itself
|
// then notify the device itself
|
||||||
device_config_complete();
|
device_config_complete();
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ void device_config::process_token(UINT32 entrytype, const machine_config_token *
|
|||||||
m_static_config = TOKEN_GET_PTR(tokens, voidptr);
|
m_static_config = TOKEN_GET_PTR(tokens, voidptr);
|
||||||
processed = true;
|
processed = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// provide inline device data packed into a 16-bit space
|
// provide inline device data packed into a 16-bit space
|
||||||
case MCONFIG_TOKEN_DEVICE_INLINE_DATA16:
|
case MCONFIG_TOKEN_DEVICE_INLINE_DATA16:
|
||||||
TOKEN_UNGET_UINT32(tokens);
|
TOKEN_UNGET_UINT32(tokens);
|
||||||
@ -451,14 +451,14 @@ void device_config::process_token(UINT32 entrytype, const machine_config_token *
|
|||||||
assert(!processed);
|
assert(!processed);
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// or it might be processed by the device itself
|
// or it might be processed by the device itself
|
||||||
if (device_process_token(entrytype, tokens))
|
if (device_process_token(entrytype, tokens))
|
||||||
{
|
{
|
||||||
assert(!processed);
|
assert(!processed);
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// regardless, *somebody* must handle it
|
// regardless, *somebody* must handle it
|
||||||
if (!processed)
|
if (!processed)
|
||||||
throw emu_fatalerror("Unhandled token %d for device '%s'", entrytype, tag());
|
throw emu_fatalerror("Unhandled token %d for device '%s'", entrytype, tag());
|
||||||
@ -478,17 +478,17 @@ bool device_config::validity_check(const game_driver &driver) const
|
|||||||
for (device_config_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_config_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
if (intf->interface_validity_check(driver))
|
if (intf->interface_validity_check(driver))
|
||||||
error = true;
|
error = true;
|
||||||
|
|
||||||
// let the device itself validate
|
// let the device itself validate
|
||||||
if (device_validity_check(driver))
|
if (device_validity_check(driver))
|
||||||
error = true;
|
error = true;
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -512,7 +512,7 @@ bool device_config::device_process_token(UINT32 entrytype, const machine_config_
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_validity_check - validate a device after
|
// device_validity_check - validate a device after
|
||||||
// the configuration has been constructed
|
// the configuration has been constructed
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -536,7 +536,7 @@ const rom_entry *device_config::rom_region() const
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// machine_config_tokens - return a pointer to
|
// machine_config_tokens - return a pointer to
|
||||||
// a set of machine configuration tokens
|
// a set of machine configuration tokens
|
||||||
// describing sub-devices for this device
|
// describing sub-devices for this device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -819,17 +819,17 @@ void device_t::start()
|
|||||||
{
|
{
|
||||||
// populate the region field
|
// populate the region field
|
||||||
m_region = m_machine.region(tag());
|
m_region = m_machine.region(tag());
|
||||||
|
|
||||||
// let the interfaces do their pre-work
|
// let the interfaces do their pre-work
|
||||||
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
intf->interface_pre_start();
|
intf->interface_pre_start();
|
||||||
|
|
||||||
// remember the number of state registrations
|
// remember the number of state registrations
|
||||||
int state_registrations = state_save_get_reg_count(machine);
|
int state_registrations = state_save_get_reg_count(machine);
|
||||||
|
|
||||||
// start the device
|
// start the device
|
||||||
device_start();
|
device_start();
|
||||||
|
|
||||||
// complain if nothing was registered by the device
|
// complain if nothing was registered by the device
|
||||||
state_registrations = state_save_get_reg_count(machine) - state_registrations;
|
state_registrations = state_save_get_reg_count(machine) - state_registrations;
|
||||||
device_execute_interface *exec;
|
device_execute_interface *exec;
|
||||||
@ -844,11 +844,11 @@ void device_t::start()
|
|||||||
// let the interfaces do their post-work
|
// let the interfaces do their post-work
|
||||||
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
intf->interface_post_start();
|
intf->interface_post_start();
|
||||||
|
|
||||||
// force an update of the clock
|
// force an update of the clock
|
||||||
notify_clock_changed();
|
notify_clock_changed();
|
||||||
|
|
||||||
// register our save states
|
// register our save states
|
||||||
state_save_register_device_item(this, 0, m_clock);
|
state_save_register_device_item(this, 0, m_clock);
|
||||||
state_save_register_device_item(this, 0, m_unscaled_clock);
|
state_save_register_device_item(this, 0, m_unscaled_clock);
|
||||||
state_save_register_device_item(this, 0, m_clock_scale);
|
state_save_register_device_item(this, 0, m_clock_scale);
|
||||||
@ -867,7 +867,7 @@ void device_t::debug_setup()
|
|||||||
// notify the interface
|
// notify the interface
|
||||||
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
intf->interface_debug_setup();
|
intf->interface_debug_setup();
|
||||||
|
|
||||||
// notify the device
|
// notify the device
|
||||||
device_debug_setup();
|
device_debug_setup();
|
||||||
}
|
}
|
||||||
@ -882,7 +882,7 @@ void device_t::reset()
|
|||||||
// let the interfaces do their pre-work
|
// let the interfaces do their pre-work
|
||||||
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
intf->interface_pre_reset();
|
intf->interface_pre_reset();
|
||||||
|
|
||||||
// reset the device
|
// reset the device
|
||||||
device_reset();
|
device_reset();
|
||||||
|
|
||||||
@ -902,7 +902,7 @@ void device_t::pre_save()
|
|||||||
// notify the interface
|
// notify the interface
|
||||||
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
intf->interface_pre_save();
|
intf->interface_pre_save();
|
||||||
|
|
||||||
// notify the device
|
// notify the device
|
||||||
device_pre_save();
|
device_pre_save();
|
||||||
}
|
}
|
||||||
@ -918,7 +918,7 @@ void device_t::post_load()
|
|||||||
// notify the interface
|
// notify the interface
|
||||||
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
|
||||||
intf->interface_post_load();
|
intf->interface_post_load();
|
||||||
|
|
||||||
// notify the device
|
// notify the device
|
||||||
device_post_load();
|
device_post_load();
|
||||||
}
|
}
|
||||||
|
@ -52,10 +52,10 @@
|
|||||||
// MACROS
|
// MACROS
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
// macro for specifying a clock derived from an owning device
|
// macro for specifying a clock derived from an owning device
|
||||||
#define DERIVED_CLOCK(num, den) (0xff000000 | ((num) << 12) | ((den) << 0))
|
#define DERIVED_CLOCK(num, den) (0xff000000 | ((num) << 12) | ((den) << 0))
|
||||||
|
|
||||||
// shorthand for accessing devices by machine/type/tag
|
// shorthand for accessing devices by machine/type/tag
|
||||||
#define devtag_get_device(mach,tag) (mach)->device(tag)
|
#define devtag_get_device(mach,tag) (mach)->device(tag)
|
||||||
#define devtag_reset(mach,tag) (mach)->device(tag)->reset()
|
#define devtag_reset(mach,tag) (mach)->device(tag)->reset()
|
||||||
|
|
||||||
@ -123,11 +123,11 @@ typedef device_config *(*device_type)(const machine_config &mconfig, const char
|
|||||||
// ======================> tagged_device_list
|
// ======================> tagged_device_list
|
||||||
|
|
||||||
// tagged_device_list is a tagged_list with additional searching based on type
|
// tagged_device_list is a tagged_list with additional searching based on type
|
||||||
template<class T>
|
template<class T>
|
||||||
class tagged_device_list : public tagged_list<T>
|
class tagged_device_list : public tagged_list<T>
|
||||||
{
|
{
|
||||||
typedef tagged_list<T> super;
|
typedef tagged_list<T> super;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
tagged_device_list(resource_pool &pool = global_resource_pool)
|
tagged_device_list(resource_pool &pool = global_resource_pool)
|
||||||
: tagged_list<T>(pool) { }
|
: tagged_list<T>(pool) { }
|
||||||
@ -137,7 +137,7 @@ public:
|
|||||||
using super::count;
|
using super::count;
|
||||||
using super::index;
|
using super::index;
|
||||||
using super::find;
|
using super::find;
|
||||||
|
|
||||||
// provide type-specific overrides
|
// provide type-specific overrides
|
||||||
T *first(device_type type) const
|
T *first(device_type type) const
|
||||||
{
|
{
|
||||||
@ -145,14 +145,14 @@ public:
|
|||||||
for (cur = super::first(); cur != NULL && cur->type() != type; cur = cur->next()) ;
|
for (cur = super::first(); cur != NULL && cur->type() != type; cur = cur->next()) ;
|
||||||
return cur;
|
return cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count(device_type type) const
|
int count(device_type type) const
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (const T *curdev = first(type); curdev != NULL; curdev = curdev->typenext()) num++;
|
for (const T *curdev = first(type); curdev != NULL; curdev = curdev->typenext()) num++;
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index(device_type type, T *object) const
|
int index(device_type type, T *object) const
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
@ -160,13 +160,13 @@ public:
|
|||||||
if (cur == object) return num;
|
if (cur == object) return num;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index(device_type type, const char *tag) const
|
int index(device_type type, const char *tag) const
|
||||||
{
|
{
|
||||||
T *object = find(tag);
|
T *object = find(tag);
|
||||||
return (object != NULL && object->type() == type) ? index(type, object) : -1;
|
return (object != NULL && object->type() == type) ? index(type, object) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
T *find(device_type type, int index) const
|
T *find(device_type type, int index) const
|
||||||
{
|
{
|
||||||
for (T *cur = first(type); cur != NULL; cur = cur->typenext())
|
for (T *cur = first(type); cur != NULL; cur = cur->typenext())
|
||||||
@ -200,12 +200,12 @@ typedef tagged_device_list<device_config> device_config_list;
|
|||||||
class device_list : public tagged_device_list<device_t>
|
class device_list : public tagged_device_list<device_t>
|
||||||
{
|
{
|
||||||
running_machine *m_machine;
|
running_machine *m_machine;
|
||||||
|
|
||||||
static void static_reset(running_machine *machine);
|
static void static_reset(running_machine *machine);
|
||||||
static void static_exit(running_machine *machine);
|
static void static_exit(running_machine *machine);
|
||||||
static void static_pre_save(running_machine *machine, void *param);
|
static void static_pre_save(running_machine *machine, void *param);
|
||||||
static void static_post_load(running_machine *machine, void *param);
|
static void static_post_load(running_machine *machine, void *param);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
device_list(resource_pool &pool = global_resource_pool);
|
device_list(resource_pool &pool = global_resource_pool);
|
||||||
void import_config_list(const device_config_list &list, running_machine &machine);
|
void import_config_list(const device_config_list &list, running_machine &machine);
|
||||||
@ -223,11 +223,11 @@ public:
|
|||||||
class device_config
|
class device_config
|
||||||
{
|
{
|
||||||
DISABLE_COPYING(device_config);
|
DISABLE_COPYING(device_config);
|
||||||
|
|
||||||
friend class device_t;
|
friend class device_t;
|
||||||
friend class device_config_interface;
|
friend class device_config_interface;
|
||||||
template<class T> friend class tagged_list;
|
template<class T> friend class tagged_list;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
device_config(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock);
|
device_config(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
@ -263,7 +263,7 @@ public:
|
|||||||
void process_token(UINT32 entrytype, const machine_config_token *&tokens);
|
void process_token(UINT32 entrytype, const machine_config_token *&tokens);
|
||||||
void config_complete();
|
void config_complete();
|
||||||
bool validity_check(const game_driver &driver) const;
|
bool validity_check(const game_driver &driver) const;
|
||||||
|
|
||||||
//------------------- begin derived class overrides
|
//------------------- begin derived class overrides
|
||||||
|
|
||||||
// required operation overrides
|
// required operation overrides
|
||||||
@ -278,24 +278,24 @@ protected:
|
|||||||
// required information overrides
|
// required information overrides
|
||||||
public:
|
public:
|
||||||
virtual const char *name() const = 0;
|
virtual const char *name() const = 0;
|
||||||
|
|
||||||
// optional information overrides
|
// optional information overrides
|
||||||
virtual const rom_entry *rom_region() const;
|
virtual const rom_entry *rom_region() const;
|
||||||
virtual const machine_config_token *machine_config_tokens() const;
|
virtual const machine_config_token *machine_config_tokens() const;
|
||||||
|
|
||||||
//------------------- end derived class overrides
|
//------------------- end derived class overrides
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device relationships
|
// device relationships
|
||||||
device_config * m_next; // next device (of any type/class)
|
device_config * m_next; // next device (of any type/class)
|
||||||
device_config * m_owner; // device that owns us, or NULL if nobody
|
device_config * m_owner; // device that owns us, or NULL if nobody
|
||||||
device_config_interface *m_interface_list; // head of interface list
|
device_config_interface *m_interface_list; // head of interface list
|
||||||
|
|
||||||
const device_type m_type; // device type
|
const device_type m_type; // device type
|
||||||
UINT32 m_clock; // device clock
|
UINT32 m_clock; // device clock
|
||||||
|
|
||||||
const machine_config & m_machine_config; // reference to the machine's configuration
|
const machine_config & m_machine_config; // reference to the machine's configuration
|
||||||
const void * m_static_config; // static device configuration
|
const void * m_static_config; // static device configuration
|
||||||
UINT64 m_inline_data[16]; // array of inline configuration values
|
UINT64 m_inline_data[16]; // array of inline configuration values
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -322,7 +322,7 @@ public:
|
|||||||
operator const device_config &() const { return m_device_config; }
|
operator const device_config &() const { return m_device_config; }
|
||||||
operator const device_config *() const { return &m_device_config; }
|
operator const device_config *() const { return &m_device_config; }
|
||||||
|
|
||||||
// iteration helpers
|
// iteration helpers
|
||||||
device_config_interface *interface_next() const { return m_interface_next; }
|
device_config_interface *interface_next() const { return m_interface_next; }
|
||||||
template<class T> bool next(T *&intf) const { return m_device_config.next(intf); }
|
template<class T> bool next(T *&intf) const { return m_device_config.next(intf); }
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ public:
|
|||||||
device_t *next() const { return m_next; }
|
device_t *next() const { return m_next; }
|
||||||
device_t *typenext() const;
|
device_t *typenext() const;
|
||||||
device_t *owner() const { return m_owner; }
|
device_t *owner() const { return m_owner; }
|
||||||
|
|
||||||
// interface helpers
|
// interface helpers
|
||||||
template<class T> bool interface(T *&intf) { intf = dynamic_cast<T *>(this); return (intf != NULL); }
|
template<class T> bool interface(T *&intf) { intf = dynamic_cast<T *>(this); return (intf != NULL); }
|
||||||
template<class T> bool next(T *&intf) const
|
template<class T> bool next(T *&intf) const
|
||||||
@ -426,15 +426,15 @@ protected:
|
|||||||
virtual void device_debug_setup();
|
virtual void device_debug_setup();
|
||||||
|
|
||||||
//------------------- end derived class overrides
|
//------------------- end derived class overrides
|
||||||
|
|
||||||
running_machine & m_machine;
|
running_machine & m_machine;
|
||||||
|
|
||||||
// device relationships
|
// device relationships
|
||||||
device_t * m_next; // next device (of any type/class)
|
device_t * m_next; // next device (of any type/class)
|
||||||
device_t * m_owner; // device that owns us, or NULL if nobody
|
device_t * m_owner; // device that owns us, or NULL if nobody
|
||||||
device_interface * m_interface_list; // head of interface list
|
device_interface * m_interface_list; // head of interface list
|
||||||
|
|
||||||
bool m_started; // true if the start function has succeeded
|
bool m_started; // true if the start function has succeeded
|
||||||
UINT32 m_clock; // device clock
|
UINT32 m_clock; // device clock
|
||||||
const region_info * m_region; // our device-local region
|
const region_info * m_region; // our device-local region
|
||||||
|
|
||||||
@ -461,13 +461,13 @@ protected:
|
|||||||
// construction/destruction
|
// construction/destruction
|
||||||
device_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
virtual ~device_interface();
|
virtual ~device_interface();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// casting helpers
|
// casting helpers
|
||||||
device_t &device() { return m_device; }
|
device_t &device() { return m_device; }
|
||||||
operator device_t &() { return m_device; }
|
operator device_t &() { return m_device; }
|
||||||
operator device_t *() { return &m_device; }
|
operator device_t *() { return &m_device; }
|
||||||
|
|
||||||
// iteration helpers
|
// iteration helpers
|
||||||
device_interface *interface_next() const { return m_interface_next; }
|
device_interface *interface_next() const { return m_interface_next; }
|
||||||
template<class T> bool next(T *&intf) const { return m_device.next(intf); }
|
template<class T> bool next(T *&intf) const { return m_device.next(intf); }
|
||||||
@ -481,7 +481,7 @@ public:
|
|||||||
virtual void interface_post_load();
|
virtual void interface_post_load();
|
||||||
virtual void interface_clock_changed();
|
virtual void interface_clock_changed();
|
||||||
virtual void interface_debug_setup();
|
virtual void interface_debug_setup();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
device_interface * m_interface_next;
|
device_interface * m_interface_next;
|
||||||
device_t & m_device;
|
device_t & m_device;
|
||||||
|
@ -73,7 +73,7 @@ legacy_device_config_base::~legacy_device_config_base()
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// get_legacy_config_int - return a legacy
|
// get_legacy_config_int - return a legacy
|
||||||
// configuration parameter as an integer
|
// configuration parameter as an integer
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
INT64 legacy_device_config_base::get_legacy_config_int(UINT32 state) const
|
INT64 legacy_device_config_base::get_legacy_config_int(UINT32 state) const
|
||||||
@ -86,7 +86,7 @@ INT64 legacy_device_config_base::get_legacy_config_int(UINT32 state) const
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// get_legacy_config_ptr - return a legacy
|
// get_legacy_config_ptr - return a legacy
|
||||||
// configuration parameter as a pointer
|
// configuration parameter as a pointer
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void *legacy_device_config_base::get_legacy_config_ptr(UINT32 state) const
|
void *legacy_device_config_base::get_legacy_config_ptr(UINT32 state) const
|
||||||
@ -99,7 +99,7 @@ void *legacy_device_config_base::get_legacy_config_ptr(UINT32 state) const
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// get_legacy_config_fct - return a legacy
|
// get_legacy_config_fct - return a legacy
|
||||||
// configuration parameter as a function pointer
|
// configuration parameter as a function pointer
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
genf *legacy_device_config_base::get_legacy_config_fct(UINT32 state) const
|
genf *legacy_device_config_base::get_legacy_config_fct(UINT32 state) const
|
||||||
@ -112,7 +112,7 @@ genf *legacy_device_config_base::get_legacy_config_fct(UINT32 state) const
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// get_legacy_config_string - return a legacy
|
// get_legacy_config_string - return a legacy
|
||||||
// configuration parameter as a string pointer
|
// configuration parameter as a string pointer
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
const char *legacy_device_config_base::get_legacy_config_string(UINT32 state) const
|
const char *legacy_device_config_base::get_legacy_config_string(UINT32 state) const
|
||||||
@ -248,7 +248,7 @@ legacy_memory_device_config_base::legacy_memory_device_config_base(const machine
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - update configuration
|
// device_config_complete - update configuration
|
||||||
// based on completed device setup
|
// based on completed device setup
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void legacy_memory_device_config_base::device_config_complete()
|
void legacy_memory_device_config_base::device_config_complete()
|
||||||
@ -365,8 +365,8 @@ const image_device_type_info legacy_image_device_config_base::m_device_info_arra
|
|||||||
{ IO_MEMCARD, "memcard", "memc" }, /* 12 */
|
{ IO_MEMCARD, "memcard", "memc" }, /* 12 */
|
||||||
{ IO_CDROM, "cdrom", "cdrm" }, /* 13 */
|
{ IO_CDROM, "cdrom", "cdrm" }, /* 13 */
|
||||||
{ IO_MAGTAPE, "magtape", "magt" }, /* 14 */
|
{ IO_MAGTAPE, "magtape", "magt" }, /* 14 */
|
||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// legacy_image_device_config_base - constructor
|
// legacy_image_device_config_base - constructor
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -381,7 +381,7 @@ legacy_image_device_config_base::legacy_image_device_config_base(const machine_c
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - update configuration
|
// device_config_complete - update configuration
|
||||||
// based on completed device setup
|
// based on completed device setup
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void legacy_image_device_config_base::device_config_complete()
|
void legacy_image_device_config_base::device_config_complete()
|
||||||
@ -390,10 +390,10 @@ void legacy_image_device_config_base::device_config_complete()
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
int index = -1;
|
int index = -1;
|
||||||
image_device_format **formatptr;
|
image_device_format **formatptr;
|
||||||
image_device_format *format;
|
image_device_format *format;
|
||||||
formatptr = &m_formatlist;
|
formatptr = &m_formatlist;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
m_type = static_cast<iodevice_t>(get_legacy_config_int(DEVINFO_INT_IMAGE_TYPE));
|
m_type = static_cast<iodevice_t>(get_legacy_config_int(DEVINFO_INT_IMAGE_TYPE));
|
||||||
m_readable = get_legacy_config_int(DEVINFO_INT_IMAGE_READABLE)!=0;
|
m_readable = get_legacy_config_int(DEVINFO_INT_IMAGE_READABLE)!=0;
|
||||||
m_writeable = get_legacy_config_int(DEVINFO_INT_IMAGE_WRITEABLE)!=0;
|
m_writeable = get_legacy_config_int(DEVINFO_INT_IMAGE_WRITEABLE)!=0;
|
||||||
@ -401,37 +401,37 @@ void legacy_image_device_config_base::device_config_complete()
|
|||||||
m_must_be_loaded = get_legacy_config_int(DEVINFO_INT_IMAGE_MUST_BE_LOADED)!=0;
|
m_must_be_loaded = get_legacy_config_int(DEVINFO_INT_IMAGE_MUST_BE_LOADED)!=0;
|
||||||
m_reset_on_load = get_legacy_config_int(DEVINFO_INT_IMAGE_RESET_ON_LOAD)!=0;
|
m_reset_on_load = get_legacy_config_int(DEVINFO_INT_IMAGE_RESET_ON_LOAD)!=0;
|
||||||
m_has_partial_hash = get_legacy_config_int(DEVINFO_FCT_IMAGE_PARTIAL_HASH)!=0;
|
m_has_partial_hash = get_legacy_config_int(DEVINFO_FCT_IMAGE_PARTIAL_HASH)!=0;
|
||||||
|
|
||||||
m_interface_name = get_legacy_config_string(DEVINFO_STR_IMAGE_INTERFACE);
|
m_interface_name = get_legacy_config_string(DEVINFO_STR_IMAGE_INTERFACE);
|
||||||
|
|
||||||
m_file_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_FILE_EXTENSIONS);
|
m_file_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_FILE_EXTENSIONS);
|
||||||
|
|
||||||
load = reinterpret_cast<device_image_load_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_LOAD));
|
load = reinterpret_cast<device_image_load_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_LOAD));
|
||||||
create = reinterpret_cast<device_image_create_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_CREATE));
|
create = reinterpret_cast<device_image_create_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_CREATE));
|
||||||
unload = reinterpret_cast<device_image_unload_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_UNLOAD));
|
unload = reinterpret_cast<device_image_unload_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_UNLOAD));
|
||||||
display = reinterpret_cast<device_image_display_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_DISPLAY));
|
display = reinterpret_cast<device_image_display_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_DISPLAY));
|
||||||
partialhash = reinterpret_cast<device_image_partialhash_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_PARTIAL_HASH));
|
partialhash = reinterpret_cast<device_image_partialhash_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_PARTIAL_HASH));
|
||||||
get_devices = reinterpret_cast<device_image_get_devices_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_GET_DEVICES));
|
get_devices = reinterpret_cast<device_image_get_devices_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_GET_DEVICES));
|
||||||
|
|
||||||
m_create_option_guide = reinterpret_cast<const option_guide *>(get_legacy_config_ptr(DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE));
|
m_create_option_guide = reinterpret_cast<const option_guide *>(get_legacy_config_ptr(DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE));
|
||||||
|
|
||||||
int format_count = get_legacy_config_int(DEVINFO_INT_IMAGE_CREATE_OPTCOUNT);
|
int format_count = get_legacy_config_int(DEVINFO_INT_IMAGE_CREATE_OPTCOUNT);
|
||||||
|
|
||||||
for (int i = 0; i < format_count; i++)
|
for (int i = 0; i < format_count; i++)
|
||||||
{
|
{
|
||||||
// only add if creatable
|
// only add if creatable
|
||||||
if (get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i)) {
|
if (get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i)) {
|
||||||
// allocate a new format
|
// allocate a new format
|
||||||
format = global_alloc_clear(image_device_format);
|
format = global_alloc_clear(image_device_format);
|
||||||
|
|
||||||
// populate it
|
// populate it
|
||||||
format->m_index = cnt;
|
format->m_index = cnt;
|
||||||
format->m_name = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTNAME + i);
|
format->m_name = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTNAME + i);
|
||||||
format->m_description = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTDESC + i);
|
format->m_description = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTDESC + i);
|
||||||
format->m_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTEXTS + i);
|
format->m_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTEXTS + i);
|
||||||
format->m_optspec = get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i);
|
format->m_optspec = get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i);
|
||||||
|
|
||||||
// and append it to the list
|
// and append it to the list
|
||||||
*formatptr = format;
|
*formatptr = format;
|
||||||
formatptr = &format->m_next;
|
formatptr = &format->m_next;
|
||||||
cnt++;
|
cnt++;
|
||||||
@ -442,14 +442,14 @@ void legacy_image_device_config_base::device_config_complete()
|
|||||||
{
|
{
|
||||||
if (this == image)
|
if (this == image)
|
||||||
index = count;
|
index = count;
|
||||||
if (image->image_type_direct() == m_type)
|
if (image->image_type_direct() == m_type)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
m_instance_name.printf("%s%d", device_typename(m_type), index + 1);
|
m_instance_name.printf("%s%d", device_typename(m_type), index + 1);
|
||||||
m_brief_instance_name.printf("%s%d", device_brieftypename(m_type), index + 1);
|
m_brief_instance_name.printf("%s%d", device_brieftypename(m_type), index + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_instance_name = device_typename(m_type);
|
m_instance_name = device_typename(m_type);
|
||||||
m_brief_instance_name = device_brieftypename(m_type);
|
m_brief_instance_name = device_brieftypename(m_type);
|
||||||
@ -465,7 +465,7 @@ void legacy_image_device_config_base::device_config_complete()
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// find_device_type - search trough list of
|
// find_device_type - search trough list of
|
||||||
// device types to extact data
|
// device types to extact data
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
const image_device_type_info *legacy_image_device_config_base::find_device_type(iodevice_t type)
|
const image_device_type_info *legacy_image_device_config_base::find_device_type(iodevice_t type)
|
||||||
@ -474,7 +474,7 @@ const image_device_type_info *legacy_image_device_config_base::find_device_type(
|
|||||||
for (i = 0; i < ARRAY_LENGTH(legacy_image_device_config_base::m_device_info_array); i++)
|
for (i = 0; i < ARRAY_LENGTH(legacy_image_device_config_base::m_device_info_array); i++)
|
||||||
{
|
{
|
||||||
if (m_device_info_array[i].m_type == type)
|
if (m_device_info_array[i].m_type == type)
|
||||||
return &m_device_info_array[i];
|
return &m_device_info_array[i];
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -491,7 +491,7 @@ const char *legacy_image_device_config_base::device_typename(iodevice_t type)
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_brieftypename - retrieves device
|
// device_brieftypename - retrieves device
|
||||||
// brief type name
|
// brief type name
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
const char *legacy_image_device_config_base::device_brieftypename(iodevice_t type)
|
const char *legacy_image_device_config_base::device_brieftypename(iodevice_t type)
|
||||||
@ -502,17 +502,17 @@ const char *legacy_image_device_config_base::device_brieftypename(iodevice_t typ
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// uses_file_extension - update configuration
|
// uses_file_extension - update configuration
|
||||||
// based on completed device setup
|
// based on completed device setup
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
bool legacy_image_device_config_base::uses_file_extension(const char *file_extension) const
|
bool legacy_image_device_config_base::uses_file_extension(const char *file_extension) const
|
||||||
{
|
{
|
||||||
bool result = FALSE;
|
bool result = FALSE;
|
||||||
|
|
||||||
if (file_extension[0] == '.')
|
if (file_extension[0] == '.')
|
||||||
file_extension++;
|
file_extension++;
|
||||||
|
|
||||||
/* find the extensions */
|
/* find the extensions */
|
||||||
char *ext = strtok((char*)m_file_extensions.cstr(),",");
|
char *ext = strtok((char*)m_file_extensions.cstr(),",");
|
||||||
while (ext != NULL)
|
while (ext != NULL)
|
||||||
{
|
{
|
||||||
@ -522,7 +522,7 @@ bool legacy_image_device_config_base::uses_file_extension(const char *file_exten
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ext = strtok (NULL, ",");
|
ext = strtok (NULL, ",");
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -532,18 +532,18 @@ bool legacy_image_device_config_base::uses_file_extension(const char *file_exten
|
|||||||
|
|
||||||
legacy_image_device_config_base::~legacy_image_device_config_base()
|
legacy_image_device_config_base::~legacy_image_device_config_base()
|
||||||
{
|
{
|
||||||
image_device_format **formatptr = &m_formatlist;
|
image_device_format **formatptr = &m_formatlist;
|
||||||
|
|
||||||
/* free all entries */
|
/* free all entries */
|
||||||
while (*formatptr != NULL)
|
while (*formatptr != NULL)
|
||||||
{
|
{
|
||||||
image_device_format *entry = *formatptr;
|
image_device_format *entry = *formatptr;
|
||||||
*formatptr = entry->m_next;
|
*formatptr = entry->m_next;
|
||||||
global_free(entry);
|
global_free(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// LIVE LEGACY IMAGE DEVICE
|
// LIVE LEGACY IMAGE DEVICE
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
@ -53,87 +53,87 @@
|
|||||||
// state constants passed to the device_get_config_func
|
// state constants passed to the device_get_config_func
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
// --- the following bits of info are returned as 64-bit signed integers ---
|
// --- the following bits of info are returned as 64-bit signed integers ---
|
||||||
DEVINFO_INT_FIRST = 0x00000,
|
DEVINFO_INT_FIRST = 0x00000,
|
||||||
|
|
||||||
DEVINFO_INT_TOKEN_BYTES = DEVINFO_INT_FIRST, // R/O: bytes to allocate for the token
|
DEVINFO_INT_TOKEN_BYTES = DEVINFO_INT_FIRST, // R/O: bytes to allocate for the token
|
||||||
DEVINFO_INT_INLINE_CONFIG_BYTES, // R/O: bytes to allocate for the inline configuration
|
DEVINFO_INT_INLINE_CONFIG_BYTES, // R/O: bytes to allocate for the inline configuration
|
||||||
|
|
||||||
DEVINFO_INT_ENDIANNESS, // R/O: either ENDIANNESS_BIG or ENDIANNESS_LITTLE
|
DEVINFO_INT_ENDIANNESS, // R/O: either ENDIANNESS_BIG or ENDIANNESS_LITTLE
|
||||||
DEVINFO_INT_DATABUS_WIDTH, // R/O: data bus size for each address space (8,16,32,64)
|
DEVINFO_INT_DATABUS_WIDTH, // R/O: data bus size for each address space (8,16,32,64)
|
||||||
DEVINFO_INT_DATABUS_WIDTH_0 = DEVINFO_INT_DATABUS_WIDTH + 0,
|
DEVINFO_INT_DATABUS_WIDTH_0 = DEVINFO_INT_DATABUS_WIDTH + 0,
|
||||||
DEVINFO_INT_DATABUS_WIDTH_1 = DEVINFO_INT_DATABUS_WIDTH + 1,
|
DEVINFO_INT_DATABUS_WIDTH_1 = DEVINFO_INT_DATABUS_WIDTH + 1,
|
||||||
DEVINFO_INT_DATABUS_WIDTH_2 = DEVINFO_INT_DATABUS_WIDTH + 2,
|
DEVINFO_INT_DATABUS_WIDTH_2 = DEVINFO_INT_DATABUS_WIDTH + 2,
|
||||||
DEVINFO_INT_DATABUS_WIDTH_3 = DEVINFO_INT_DATABUS_WIDTH + 3,
|
DEVINFO_INT_DATABUS_WIDTH_3 = DEVINFO_INT_DATABUS_WIDTH + 3,
|
||||||
DEVINFO_INT_DATABUS_WIDTH_LAST = DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACES - 1,
|
DEVINFO_INT_DATABUS_WIDTH_LAST = DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACES - 1,
|
||||||
DEVINFO_INT_ADDRBUS_WIDTH, // R/O: address bus size for each address space (12-32)
|
DEVINFO_INT_ADDRBUS_WIDTH, // R/O: address bus size for each address space (12-32)
|
||||||
DEVINFO_INT_ADDRBUS_WIDTH_0 = DEVINFO_INT_ADDRBUS_WIDTH + 0,
|
DEVINFO_INT_ADDRBUS_WIDTH_0 = DEVINFO_INT_ADDRBUS_WIDTH + 0,
|
||||||
DEVINFO_INT_ADDRBUS_WIDTH_1 = DEVINFO_INT_ADDRBUS_WIDTH + 1,
|
DEVINFO_INT_ADDRBUS_WIDTH_1 = DEVINFO_INT_ADDRBUS_WIDTH + 1,
|
||||||
DEVINFO_INT_ADDRBUS_WIDTH_2 = DEVINFO_INT_ADDRBUS_WIDTH + 2,
|
DEVINFO_INT_ADDRBUS_WIDTH_2 = DEVINFO_INT_ADDRBUS_WIDTH + 2,
|
||||||
DEVINFO_INT_ADDRBUS_WIDTH_3 = DEVINFO_INT_ADDRBUS_WIDTH + 3,
|
DEVINFO_INT_ADDRBUS_WIDTH_3 = DEVINFO_INT_ADDRBUS_WIDTH + 3,
|
||||||
DEVINFO_INT_ADDRBUS_WIDTH_LAST = DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACES - 1,
|
DEVINFO_INT_ADDRBUS_WIDTH_LAST = DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACES - 1,
|
||||||
DEVINFO_INT_ADDRBUS_SHIFT, // R/O: shift applied to addresses each address space (+3 means >>3, -1 means <<1)
|
DEVINFO_INT_ADDRBUS_SHIFT, // R/O: shift applied to addresses each address space (+3 means >>3, -1 means <<1)
|
||||||
DEVINFO_INT_ADDRBUS_SHIFT_0 = DEVINFO_INT_ADDRBUS_SHIFT + 0,
|
DEVINFO_INT_ADDRBUS_SHIFT_0 = DEVINFO_INT_ADDRBUS_SHIFT + 0,
|
||||||
DEVINFO_INT_ADDRBUS_SHIFT_1 = DEVINFO_INT_ADDRBUS_SHIFT + 1,
|
DEVINFO_INT_ADDRBUS_SHIFT_1 = DEVINFO_INT_ADDRBUS_SHIFT + 1,
|
||||||
DEVINFO_INT_ADDRBUS_SHIFT_2 = DEVINFO_INT_ADDRBUS_SHIFT + 2,
|
DEVINFO_INT_ADDRBUS_SHIFT_2 = DEVINFO_INT_ADDRBUS_SHIFT + 2,
|
||||||
DEVINFO_INT_ADDRBUS_SHIFT_3 = DEVINFO_INT_ADDRBUS_SHIFT + 3,
|
DEVINFO_INT_ADDRBUS_SHIFT_3 = DEVINFO_INT_ADDRBUS_SHIFT + 3,
|
||||||
DEVINFO_INT_ADDRBUS_SHIFT_LAST = DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACES - 1,
|
DEVINFO_INT_ADDRBUS_SHIFT_LAST = DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACES - 1,
|
||||||
|
|
||||||
DEVINFO_INT_CLASS_SPECIFIC = 0x04000, // R/W: device-specific values start here
|
DEVINFO_INT_CLASS_SPECIFIC = 0x04000, // R/W: device-specific values start here
|
||||||
DEVINFO_INT_DEVICE_SPECIFIC = 0x08000, // R/W: device-specific values start here
|
DEVINFO_INT_DEVICE_SPECIFIC = 0x08000, // R/W: device-specific values start here
|
||||||
DEVINFO_INT_LAST = 0x0ffff,
|
DEVINFO_INT_LAST = 0x0ffff,
|
||||||
|
|
||||||
// --- the following bits of info are returned as pointers ---
|
// --- the following bits of info are returned as pointers ---
|
||||||
DEVINFO_PTR_FIRST = 0x10000,
|
DEVINFO_PTR_FIRST = 0x10000,
|
||||||
|
|
||||||
DEVINFO_PTR_ROM_REGION = DEVINFO_PTR_FIRST, // R/O: pointer to device-specific ROM region
|
DEVINFO_PTR_ROM_REGION = DEVINFO_PTR_FIRST, // R/O: pointer to device-specific ROM region
|
||||||
DEVINFO_PTR_MACHINE_CONFIG, // R/O: pointer to device-specific machine config
|
DEVINFO_PTR_MACHINE_CONFIG, // R/O: pointer to device-specific machine config
|
||||||
|
|
||||||
DEVINFO_PTR_INTERNAL_MEMORY_MAP, // R/O: const addrmap_token *map
|
DEVINFO_PTR_INTERNAL_MEMORY_MAP, // R/O: const addrmap_token *map
|
||||||
DEVINFO_PTR_INTERNAL_MEMORY_MAP_0 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 0,
|
DEVINFO_PTR_INTERNAL_MEMORY_MAP_0 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 0,
|
||||||
DEVINFO_PTR_INTERNAL_MEMORY_MAP_1 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 1,
|
DEVINFO_PTR_INTERNAL_MEMORY_MAP_1 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 1,
|
||||||
DEVINFO_PTR_INTERNAL_MEMORY_MAP_2 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 2,
|
DEVINFO_PTR_INTERNAL_MEMORY_MAP_2 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 2,
|
||||||
DEVINFO_PTR_INTERNAL_MEMORY_MAP_3 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 3,
|
DEVINFO_PTR_INTERNAL_MEMORY_MAP_3 = DEVINFO_PTR_INTERNAL_MEMORY_MAP + 3,
|
||||||
DEVINFO_PTR_INTERNAL_MEMORY_MAP_LAST = DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACES - 1,
|
DEVINFO_PTR_INTERNAL_MEMORY_MAP_LAST = DEVINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACES - 1,
|
||||||
|
|
||||||
DEVINFO_PTR_DEFAULT_MEMORY_MAP, // R/O: const addrmap_token *map
|
DEVINFO_PTR_DEFAULT_MEMORY_MAP, // R/O: const addrmap_token *map
|
||||||
DEVINFO_PTR_DEFAULT_MEMORY_MAP_0 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 0,
|
DEVINFO_PTR_DEFAULT_MEMORY_MAP_0 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 0,
|
||||||
DEVINFO_PTR_DEFAULT_MEMORY_MAP_1 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 1,
|
DEVINFO_PTR_DEFAULT_MEMORY_MAP_1 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 1,
|
||||||
DEVINFO_PTR_DEFAULT_MEMORY_MAP_2 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 2,
|
DEVINFO_PTR_DEFAULT_MEMORY_MAP_2 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 2,
|
||||||
DEVINFO_PTR_DEFAULT_MEMORY_MAP_3 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 3,
|
DEVINFO_PTR_DEFAULT_MEMORY_MAP_3 = DEVINFO_PTR_DEFAULT_MEMORY_MAP + 3,
|
||||||
DEVINFO_PTR_DEFAULT_MEMORY_MAP_LAST = DEVINFO_PTR_DEFAULT_MEMORY_MAP + ADDRESS_SPACES - 1,
|
DEVINFO_PTR_DEFAULT_MEMORY_MAP_LAST = DEVINFO_PTR_DEFAULT_MEMORY_MAP + ADDRESS_SPACES - 1,
|
||||||
|
|
||||||
DEVINFO_PTR_CLASS_SPECIFIC = 0x14000, // R/W: device-specific values start here
|
DEVINFO_PTR_CLASS_SPECIFIC = 0x14000, // R/W: device-specific values start here
|
||||||
DEVINFO_PTR_DEVICE_SPECIFIC = 0x18000, // R/W: device-specific values start here
|
DEVINFO_PTR_DEVICE_SPECIFIC = 0x18000, // R/W: device-specific values start here
|
||||||
DEVINFO_PTR_LAST = 0x1ffff,
|
DEVINFO_PTR_LAST = 0x1ffff,
|
||||||
|
|
||||||
// --- the following bits of info are returned as pointers to functions ---
|
// --- the following bits of info are returned as pointers to functions ---
|
||||||
DEVINFO_FCT_FIRST = 0x20000,
|
DEVINFO_FCT_FIRST = 0x20000,
|
||||||
|
|
||||||
DEVINFO_FCT_START = DEVINFO_FCT_FIRST, // R/O: device_start_func
|
DEVINFO_FCT_START = DEVINFO_FCT_FIRST, // R/O: device_start_func
|
||||||
DEVINFO_FCT_STOP, // R/O: device_stop_func
|
DEVINFO_FCT_STOP, // R/O: device_stop_func
|
||||||
DEVINFO_FCT_RESET, // R/O: device_reset_func
|
DEVINFO_FCT_RESET, // R/O: device_reset_func
|
||||||
DEVINFO_FCT_EXECUTE, // R/O: device_execute_func
|
DEVINFO_FCT_EXECUTE, // R/O: device_execute_func
|
||||||
DEVINFO_FCT_NVRAM, // R/O: device_nvram_func
|
DEVINFO_FCT_NVRAM, // R/O: device_nvram_func
|
||||||
DEVINFO_FCT_VALIDITY_CHECK, // R/O: device_validity_check_func
|
DEVINFO_FCT_VALIDITY_CHECK, // R/O: device_validity_check_func
|
||||||
|
|
||||||
DEVINFO_FCT_CLASS_SPECIFIC = 0x24000, // R/W: device-specific values start here
|
DEVINFO_FCT_CLASS_SPECIFIC = 0x24000, // R/W: device-specific values start here
|
||||||
DEVINFO_FCT_DEVICE_SPECIFIC = 0x28000, // R/W: device-specific values start here
|
DEVINFO_FCT_DEVICE_SPECIFIC = 0x28000, // R/W: device-specific values start here
|
||||||
DEVINFO_FCT_LAST = 0x2ffff,
|
DEVINFO_FCT_LAST = 0x2ffff,
|
||||||
|
|
||||||
// --- the following bits of info are returned as NULL-terminated strings ---
|
// --- the following bits of info are returned as NULL-terminated strings ---
|
||||||
DEVINFO_STR_FIRST = 0x30000,
|
DEVINFO_STR_FIRST = 0x30000,
|
||||||
|
|
||||||
DEVINFO_STR_NAME = DEVINFO_STR_FIRST, // R/O: name of the device
|
DEVINFO_STR_NAME = DEVINFO_STR_FIRST, // R/O: name of the device
|
||||||
DEVINFO_STR_FAMILY, // R/O: family of the device
|
DEVINFO_STR_FAMILY, // R/O: family of the device
|
||||||
DEVINFO_STR_VERSION, // R/O: version of the device
|
DEVINFO_STR_VERSION, // R/O: version of the device
|
||||||
DEVINFO_STR_SOURCE_FILE, // R/O: file containing the device implementation
|
DEVINFO_STR_SOURCE_FILE, // R/O: file containing the device implementation
|
||||||
DEVINFO_STR_CREDITS, // R/O: credits for the device implementation
|
DEVINFO_STR_CREDITS, // R/O: credits for the device implementation
|
||||||
|
|
||||||
DEVINFO_STR_CLASS_SPECIFIC = 0x34000, // R/W: device-specific values start here
|
DEVINFO_STR_CLASS_SPECIFIC = 0x34000, // R/W: device-specific values start here
|
||||||
DEVINFO_STR_DEVICE_SPECIFIC = 0x38000, // R/W: device-specific values start here
|
DEVINFO_STR_DEVICE_SPECIFIC = 0x38000, // R/W: device-specific values start here
|
||||||
DEVINFO_STR_LAST = 0x3ffff,
|
DEVINFO_STR_LAST = 0x3ffff,
|
||||||
|
|
||||||
/* --- image device related --- */
|
/* --- image device related --- */
|
||||||
/* --- the following bits of info are returned as integers --- */
|
/* --- the following bits of info are returned as integers --- */
|
||||||
DEVINFO_INT_IMAGE_FIRST = DEVINFO_INT_FIRST + 0x7000,
|
DEVINFO_INT_IMAGE_FIRST = DEVINFO_INT_FIRST + 0x7000,
|
||||||
@ -178,16 +178,16 @@ enum
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
// macro for declaring the configuration and device classes of a legacy device
|
// macro for declaring the configuration and device classes of a legacy device
|
||||||
#define _DECLARE_LEGACY_DEVICE(name, basename, configclass, deviceclass, baseconfigclass, basedeviceclass) \
|
#define _DECLARE_LEGACY_DEVICE(name, basename, configclass, deviceclass, baseconfigclass, basedeviceclass) \
|
||||||
\
|
\
|
||||||
DEVICE_GET_INFO( basename ); \
|
DEVICE_GET_INFO( basename ); \
|
||||||
\
|
\
|
||||||
class configclass; \
|
class configclass; \
|
||||||
\
|
\
|
||||||
class deviceclass : public basedeviceclass \
|
class deviceclass : public basedeviceclass \
|
||||||
{ \
|
{ \
|
||||||
friend class configclass; \
|
friend class configclass; \
|
||||||
deviceclass(running_machine &_machine, const configclass &config); \
|
deviceclass(running_machine &_machine, const configclass &config); \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
class configclass : public baseconfigclass \
|
class configclass : public baseconfigclass \
|
||||||
@ -202,9 +202,9 @@ public: \
|
|||||||
const device_type name = configclass::static_alloc_device_config
|
const device_type name = configclass::static_alloc_device_config
|
||||||
|
|
||||||
// macro for defining the implementation needed for configuration and device classes
|
// macro for defining the implementation needed for configuration and device classes
|
||||||
#define _DEFINE_LEGACY_DEVICE(name, basename, configclass, deviceclass, baseconfigclass, basedeviceclass) \
|
#define _DEFINE_LEGACY_DEVICE(name, basename, configclass, deviceclass, baseconfigclass, basedeviceclass) \
|
||||||
\
|
\
|
||||||
deviceclass::deviceclass(running_machine &_machine, const configclass &config) \
|
deviceclass::deviceclass(running_machine &_machine, const configclass &config) \
|
||||||
: basedeviceclass(_machine, config) \
|
: basedeviceclass(_machine, config) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
@ -221,7 +221,7 @@ device_config *configclass::static_alloc_device_config(const machine_config &mco
|
|||||||
\
|
\
|
||||||
device_t *configclass::alloc_device(running_machine &machine) const \
|
device_t *configclass::alloc_device(running_machine &machine) const \
|
||||||
{ \
|
{ \
|
||||||
return pool_alloc(machine_get_pool(machine), deviceclass(machine, *this)); \
|
return pool_alloc(machine_get_pool(machine), deviceclass(machine, *this)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
// reduced macros that are easier to use, and map to the above two macros
|
// reduced macros that are easier to use, and map to the above two macros
|
||||||
@ -394,29 +394,29 @@ typedef void (*device_image_display_func)(device_t *image);
|
|||||||
typedef void (*device_image_partialhash_func)(char *, const unsigned char *, unsigned long, unsigned int);
|
typedef void (*device_image_partialhash_func)(char *, const unsigned char *, unsigned long, unsigned int);
|
||||||
typedef void (*device_image_get_devices_func)(device_t *device);
|
typedef void (*device_image_get_devices_func)(device_t *device);
|
||||||
|
|
||||||
// the actual deviceinfo union
|
// the actual deviceinfo union
|
||||||
union deviceinfo
|
union deviceinfo
|
||||||
{
|
{
|
||||||
INT64 i; // generic integers
|
INT64 i; // generic integers
|
||||||
void * p; // generic pointers
|
void * p; // generic pointers
|
||||||
genf * f; // generic function pointers
|
genf * f; // generic function pointers
|
||||||
char * s; // generic strings
|
char * s; // generic strings
|
||||||
|
|
||||||
device_start_func start; // DEVINFO_FCT_START
|
device_start_func start; // DEVINFO_FCT_START
|
||||||
device_stop_func stop; // DEVINFO_FCT_STOP
|
device_stop_func stop; // DEVINFO_FCT_STOP
|
||||||
device_reset_func reset; // DEVINFO_FCT_RESET
|
device_reset_func reset; // DEVINFO_FCT_RESET
|
||||||
device_execute_func execute; // DEVINFO_FCT_EXECUTE
|
device_execute_func execute; // DEVINFO_FCT_EXECUTE
|
||||||
device_nvram_func nvram; // DEVINFO_FCT_NVRAM
|
device_nvram_func nvram; // DEVINFO_FCT_NVRAM
|
||||||
const rom_entry * romregion; // DEVINFO_PTR_ROM_REGION
|
const rom_entry * romregion; // DEVINFO_PTR_ROM_REGION
|
||||||
const machine_config_token *machine_config; // DEVINFO_PTR_MACHINE_CONFIG
|
const machine_config_token *machine_config; // DEVINFO_PTR_MACHINE_CONFIG
|
||||||
const addrmap8_token * internal_map8; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
const addrmap8_token * internal_map8; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
||||||
const addrmap16_token * internal_map16; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
const addrmap16_token * internal_map16; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
||||||
const addrmap32_token * internal_map32; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
const addrmap32_token * internal_map32; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
||||||
const addrmap64_token * internal_map64; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
const addrmap64_token * internal_map64; // DEVINFO_PTR_INTERNAL_MEMORY_MAP
|
||||||
const addrmap8_token * default_map8; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
const addrmap8_token * default_map8; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
||||||
const addrmap16_token * default_map16; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
const addrmap16_token * default_map16; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
||||||
const addrmap32_token * default_map32; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
const addrmap32_token * default_map32; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
||||||
const addrmap64_token * default_map64; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
const addrmap64_token * default_map64; // DEVINFO_PTR_DEFAULT_MEMORY_MAP
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ protected:
|
|||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
const legacy_device_config_base & m_config;
|
const legacy_device_config_base & m_config;
|
||||||
void * m_token;
|
void * m_token;
|
||||||
@ -490,7 +490,7 @@ protected:
|
|||||||
// ======================> legacy_sound_device_config_base
|
// ======================> legacy_sound_device_config_base
|
||||||
|
|
||||||
// legacy_sound_device_config is a device_config with a sound interface
|
// legacy_sound_device_config is a device_config with a sound interface
|
||||||
class legacy_sound_device_config_base : public legacy_device_config_base,
|
class legacy_sound_device_config_base : public legacy_device_config_base,
|
||||||
public device_config_sound_interface
|
public device_config_sound_interface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -503,7 +503,7 @@ protected:
|
|||||||
// ======================> legacy_sound_device_base
|
// ======================> legacy_sound_device_base
|
||||||
|
|
||||||
// legacy_sound_device is a legacy_device_base with a sound interface
|
// legacy_sound_device is a legacy_device_base with a sound interface
|
||||||
class legacy_sound_device_base : public legacy_device_base,
|
class legacy_sound_device_base : public legacy_device_base,
|
||||||
public device_sound_interface
|
public device_sound_interface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -516,7 +516,7 @@ protected:
|
|||||||
// ======================> legacy_memory_device_config_base
|
// ======================> legacy_memory_device_config_base
|
||||||
|
|
||||||
// legacy_memory_device_config is a device_config with a memory interface
|
// legacy_memory_device_config is a device_config with a memory interface
|
||||||
class legacy_memory_device_config_base : public legacy_device_config_base,
|
class legacy_memory_device_config_base : public legacy_device_config_base,
|
||||||
public device_config_memory_interface
|
public device_config_memory_interface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -538,7 +538,7 @@ protected:
|
|||||||
// ======================> legacy_memory_device_base
|
// ======================> legacy_memory_device_base
|
||||||
|
|
||||||
// legacy_memory_device is a legacy_device_base with a memory interface
|
// legacy_memory_device is a legacy_device_base with a memory interface
|
||||||
class legacy_memory_device_base : public legacy_device_base,
|
class legacy_memory_device_base : public legacy_device_base,
|
||||||
public device_memory_interface
|
public device_memory_interface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -551,7 +551,7 @@ protected:
|
|||||||
// ======================> legacy_nvram_device_config
|
// ======================> legacy_nvram_device_config
|
||||||
|
|
||||||
// legacy_nvram_device_config is a device_config with a nvram interface
|
// legacy_nvram_device_config is a device_config with a nvram interface
|
||||||
class legacy_nvram_device_config_base : public legacy_device_config_base,
|
class legacy_nvram_device_config_base : public legacy_device_config_base,
|
||||||
public device_config_nvram_interface
|
public device_config_nvram_interface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -564,7 +564,7 @@ protected:
|
|||||||
// ======================> legacy_nvram_device
|
// ======================> legacy_nvram_device
|
||||||
|
|
||||||
// legacy_nvram_device is a legacy_device_base with a nvram interface
|
// legacy_nvram_device is a legacy_device_base with a nvram interface
|
||||||
class legacy_nvram_device_base : public legacy_device_base,
|
class legacy_nvram_device_base : public legacy_device_base,
|
||||||
public device_nvram_interface
|
public device_nvram_interface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -596,13 +596,13 @@ struct image_device_type_info
|
|||||||
};
|
};
|
||||||
|
|
||||||
// legacy_image_device_config is a device_config with a image interface
|
// legacy_image_device_config is a device_config with a image interface
|
||||||
class legacy_image_device_config_base : public legacy_device_config_base,
|
class legacy_image_device_config_base : public legacy_device_config_base,
|
||||||
public device_config_image_interface
|
public device_config_image_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual iodevice_t image_type() const { return m_type; }
|
virtual iodevice_t image_type() const { return m_type; }
|
||||||
virtual const char *image_type_name() const { return device_typename(m_type); }
|
virtual const char *image_type_name() const { return device_typename(m_type); }
|
||||||
virtual iodevice_t image_type_direct() const { return static_cast<iodevice_t>(get_legacy_config_int(DEVINFO_INT_IMAGE_TYPE)); }
|
virtual iodevice_t image_type_direct() const { return static_cast<iodevice_t>(get_legacy_config_int(DEVINFO_INT_IMAGE_TYPE)); }
|
||||||
virtual bool is_readable() const { return m_readable; }
|
virtual bool is_readable() const { return m_readable; }
|
||||||
virtual bool is_writeable() const { return m_writeable; }
|
virtual bool is_writeable() const { return m_writeable; }
|
||||||
virtual bool is_creatable() const { return m_creatable; }
|
virtual bool is_creatable() const { return m_creatable; }
|
||||||
@ -612,22 +612,22 @@ public:
|
|||||||
virtual const char *image_interface() const { return m_interface_name; }
|
virtual const char *image_interface() const { return m_interface_name; }
|
||||||
virtual const char *file_extensions() const { return m_file_extensions; }
|
virtual const char *file_extensions() const { return m_file_extensions; }
|
||||||
virtual const char *instance_name() const { return m_instance_name; }
|
virtual const char *instance_name() const { return m_instance_name; }
|
||||||
virtual const char *brief_instance_name() const { return m_brief_instance_name; }
|
virtual const char *brief_instance_name() const { return m_brief_instance_name; }
|
||||||
virtual bool uses_file_extension(const char *file_extension) const;
|
virtual bool uses_file_extension(const char *file_extension) const;
|
||||||
static const char *device_typename(iodevice_t type);
|
static const char *device_typename(iodevice_t type);
|
||||||
static const char *device_brieftypename(iodevice_t type);
|
static const char *device_brieftypename(iodevice_t type);
|
||||||
protected:
|
protected:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
legacy_image_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
|
legacy_image_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
|
||||||
virtual ~legacy_image_device_config_base();
|
virtual ~legacy_image_device_config_base();
|
||||||
|
|
||||||
// device_config overrides
|
// device_config overrides
|
||||||
virtual void device_config_complete();
|
virtual void device_config_complete();
|
||||||
|
|
||||||
static const image_device_type_info *find_device_type(iodevice_t type);
|
static const image_device_type_info *find_device_type(iodevice_t type);
|
||||||
|
|
||||||
static const image_device_type_info m_device_info_array[];
|
static const image_device_type_info m_device_info_array[];
|
||||||
|
|
||||||
iodevice_t m_type;
|
iodevice_t m_type;
|
||||||
bool m_readable;
|
bool m_readable;
|
||||||
bool m_writeable;
|
bool m_writeable;
|
||||||
@ -646,17 +646,17 @@ protected:
|
|||||||
device_image_display_func display;
|
device_image_display_func display;
|
||||||
device_image_partialhash_func partialhash;
|
device_image_partialhash_func partialhash;
|
||||||
device_image_get_devices_func get_devices;
|
device_image_get_devices_func get_devices;
|
||||||
|
|
||||||
/* creation info */
|
/* creation info */
|
||||||
const option_guide *m_create_option_guide;
|
const option_guide *m_create_option_guide;
|
||||||
image_device_format *m_formatlist;
|
image_device_format *m_formatlist;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ======================> legacy_image_device
|
// ======================> legacy_image_device
|
||||||
|
|
||||||
// legacy_image_device is a legacy_device_base with a image interface
|
// legacy_image_device is a legacy_device_base with a image interface
|
||||||
class legacy_image_device_base : public legacy_device_base,
|
class legacy_image_device_base : public legacy_device_base,
|
||||||
public device_image_interface
|
public device_image_interface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -57,7 +57,7 @@ const UINT32 DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the
|
|||||||
const UINT32 DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards
|
const UINT32 DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards
|
||||||
const UINT32 DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over
|
const UINT32 DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over
|
||||||
const UINT32 DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value
|
const UINT32 DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value
|
||||||
const UINT32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length
|
const UINT32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public:
|
|||||||
device_disasm_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_disasm_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
virtual ~device_disasm_interface();
|
virtual ~device_disasm_interface();
|
||||||
|
|
||||||
// configuration access
|
// configuration access
|
||||||
const device_config_disasm_interface &disasm_config() const { return m_disasm_config; }
|
const device_config_disasm_interface &disasm_config() const { return m_disasm_config; }
|
||||||
UINT32 min_opcode_bytes() const { return m_disasm_config.min_opcode_bytes(); }
|
UINT32 min_opcode_bytes() const { return m_disasm_config.min_opcode_bytes(); }
|
||||||
UINT32 max_opcode_bytes() const { return m_disasm_config.max_opcode_bytes(); }
|
UINT32 max_opcode_bytes() const { return m_disasm_config.max_opcode_bytes(); }
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
const int TRIGGER_INT = -2000;
|
const int TRIGGER_INT = -2000;
|
||||||
const int TRIGGER_SUSPENDTIME = -4000;
|
const int TRIGGER_SUSPENDTIME = -4000;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ device_config_execute_interface::~device_config_execute_interface()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_clocks_to_cycles - convert the number
|
// execute_clocks_to_cycles - convert the number
|
||||||
// of clocks to cycles, rounding down if necessary
|
// of clocks to cycles, rounding down if necessary
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -104,19 +104,19 @@ UINT32 device_config_execute_interface::execute_clocks_to_cycles(UINT32 clocks)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_cycles_to_clocks - convert the number
|
// execute_cycles_to_clocks - convert the number
|
||||||
// of cycles to clocks, rounding down if necessary
|
// of cycles to clocks, rounding down if necessary
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
UINT32 device_config_execute_interface::execute_cycles_to_clocks(UINT32 cycles) const
|
UINT32 device_config_execute_interface::execute_cycles_to_clocks(UINT32 cycles) const
|
||||||
{
|
{
|
||||||
return cycles;
|
return cycles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_min_cycles - return the smallest number
|
// execute_min_cycles - return the smallest number
|
||||||
// of cycles that a single instruction or
|
// of cycles that a single instruction or
|
||||||
// operation can take
|
// operation can take
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -127,8 +127,8 @@ UINT32 device_config_execute_interface::execute_min_cycles() const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_max_cycles - return the maximum number
|
// execute_max_cycles - return the maximum number
|
||||||
// of cycles that a single instruction or
|
// of cycles that a single instruction or
|
||||||
// operation can take
|
// operation can take
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ UINT32 device_config_execute_interface::execute_max_cycles() const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_input_lines - return the total number
|
// execute_input_lines - return the total number
|
||||||
// of input lines for the device
|
// of input lines for the device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ UINT32 device_config_execute_interface::execute_input_lines() const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_default_irq_vector - return the default
|
// execute_default_irq_vector - return the default
|
||||||
// IRQ vector when an acknowledge is processed
|
// IRQ vector when an acknowledge is processed
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ bool device_config_execute_interface::interface_process_token(UINT32 entrytype,
|
|||||||
case MCONFIG_TOKEN_DIEXEC_DISABLE:
|
case MCONFIG_TOKEN_DIEXEC_DISABLE:
|
||||||
m_disabled = true;
|
m_disabled = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// VBLANK interrupt
|
// VBLANK interrupt
|
||||||
case MCONFIG_TOKEN_DIEXEC_VBLANK_INT:
|
case MCONFIG_TOKEN_DIEXEC_VBLANK_INT:
|
||||||
TOKEN_UNGET_UINT32(tokens);
|
TOKEN_UNGET_UINT32(tokens);
|
||||||
@ -188,14 +188,14 @@ bool device_config_execute_interface::interface_process_token(UINT32 entrytype,
|
|||||||
TOKEN_EXTRACT_UINT64(tokens, m_timed_interrupt_period);
|
TOKEN_EXTRACT_UINT64(tokens, m_timed_interrupt_period);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// interface_validity_check - validation for a
|
// interface_validity_check - validation for a
|
||||||
// device after the configuration has been
|
// device after the configuration has been
|
||||||
// constructed
|
// constructed
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ INT32 device_execute_interface::cycles_remaining() const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// eat_cycles - safely eats cycles so we don't
|
// eat_cycles - safely eats cycles so we don't
|
||||||
// cross a timeslice boundary
|
// cross a timeslice boundary
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ if (TEMPLOG) printf("suspend %s (%X)\n", device().tag(), reason);
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// resume - clear a suspend reason for this
|
// resume - clear a suspend reason for this
|
||||||
// device
|
// device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -419,7 +419,7 @@ if (TEMPLOG) printf("resume %s (%X)\n", device().tag(), reason);
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// spinuntil_time - burn cycles for a specific
|
// spinuntil_time - burn cycles for a specific
|
||||||
// period of time
|
// period of time
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ attotime device_execute_interface::local_time() const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// total_cycles - return the total number of
|
// total_cycles - return the total number of
|
||||||
// cycles executed on this device
|
// cycles executed on this device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -506,8 +506,8 @@ UINT64 device_execute_interface::total_cycles() const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_burn - called after we consume a bunch
|
// execute_burn - called after we consume a bunch
|
||||||
// of cycles for artifical reasons (such as
|
// of cycles for artifical reasons (such as
|
||||||
// spinning devices for performance optimization)
|
// spinning devices for performance optimization)
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ void device_execute_interface::interface_pre_reset()
|
|||||||
{
|
{
|
||||||
// reset the total number of cycles
|
// reset the total number of cycles
|
||||||
m_totalcycles = 0;
|
m_totalcycles = 0;
|
||||||
|
|
||||||
// enable all devices (except for disabled devices)
|
// enable all devices (except for disabled devices)
|
||||||
if (!m_execute_config.disabled())
|
if (!m_execute_config.disabled())
|
||||||
resume(SUSPEND_ANY_REASON);
|
resume(SUSPEND_ANY_REASON);
|
||||||
@ -703,7 +703,7 @@ void device_execute_interface::static_on_vblank(screen_device &screen, void *par
|
|||||||
exec->on_vblank_start(screen);
|
exec->on_vblank_start(screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_execute_interface::on_vblank_start(screen_device &screen)
|
void device_execute_interface::on_vblank_start(screen_device &screen)
|
||||||
{
|
{
|
||||||
// start the interrupt counter
|
// start the interrupt counter
|
||||||
@ -738,7 +738,7 @@ void device_execute_interface::on_vblank_start(screen_device &screen)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// static_trigger_partial_frame_interrupt -
|
// static_trigger_partial_frame_interrupt -
|
||||||
// called to trigger a partial frame interrupt
|
// called to trigger a partial frame interrupt
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -767,7 +767,7 @@ void device_execute_interface::trigger_partial_frame_interrupt()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// static_trigger_periodic_interrupt - timer
|
// static_trigger_periodic_interrupt - timer
|
||||||
// callback for timed interrupts
|
// callback for timed interrupts
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -843,7 +843,7 @@ void device_execute_interface::device_input::start(device_execute_interface *exe
|
|||||||
m_execute = execute;
|
m_execute = execute;
|
||||||
m_device = &m_execute->m_device;
|
m_device = &m_execute->m_device;
|
||||||
m_linenum = linenum;
|
m_linenum = linenum;
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
state_save_register_device_item(m_device, m_linenum, m_stored_vector);
|
state_save_register_device_item(m_device, m_linenum, m_stored_vector);
|
||||||
@ -994,14 +994,14 @@ if (TEMPLOG) printf(" (%d,%d)\n", m_curstate, m_curvector);
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// default_irq_callback - the default IRQ
|
// default_irq_callback - the default IRQ
|
||||||
// callback for this input line
|
// callback for this input line
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
int device_execute_interface::device_input::default_irq_callback()
|
int device_execute_interface::device_input::default_irq_callback()
|
||||||
{
|
{
|
||||||
int vector = m_curvector;
|
int vector = m_curvector;
|
||||||
|
|
||||||
// if the IRQ state is HOLD_LINE, clear it
|
// if the IRQ state is HOLD_LINE, clear it
|
||||||
if (m_curstate == HOLD_LINE)
|
if (m_curstate == HOLD_LINE)
|
||||||
{
|
{
|
||||||
|
@ -52,12 +52,12 @@
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
// suspension reasons for executing devices
|
// suspension reasons for executing devices
|
||||||
const UINT32 SUSPEND_REASON_HALT = 0x0001; // HALT line set (or equivalent)
|
const UINT32 SUSPEND_REASON_HALT = 0x0001; // HALT line set (or equivalent)
|
||||||
const UINT32 SUSPEND_REASON_RESET = 0x0002; // RESET line set (or equivalent)
|
const UINT32 SUSPEND_REASON_RESET = 0x0002; // RESET line set (or equivalent)
|
||||||
const UINT32 SUSPEND_REASON_SPIN = 0x0004; // currently spinning
|
const UINT32 SUSPEND_REASON_SPIN = 0x0004; // currently spinning
|
||||||
const UINT32 SUSPEND_REASON_TRIGGER = 0x0008; // waiting for a trigger
|
const UINT32 SUSPEND_REASON_TRIGGER = 0x0008; // waiting for a trigger
|
||||||
const UINT32 SUSPEND_REASON_DISABLE = 0x0010; // disabled (due to disable flag)
|
const UINT32 SUSPEND_REASON_DISABLE = 0x0010; // disabled (due to disable flag)
|
||||||
const UINT32 SUSPEND_REASON_TIMESLICE = 0x0020; // waiting for the next timeslice
|
const UINT32 SUSPEND_REASON_TIMESLICE = 0x0020; // waiting for the next timeslice
|
||||||
const UINT32 SUSPEND_ANY_REASON = ~0; // all of the above
|
const UINT32 SUSPEND_ANY_REASON = ~0; // all of the above
|
||||||
|
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ protected:
|
|||||||
class device_execute_interface : public device_interface
|
class device_execute_interface : public device_interface
|
||||||
{
|
{
|
||||||
friend class device_scheduler;
|
friend class device_scheduler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
device_execute_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_execute_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
@ -247,7 +247,7 @@ public:
|
|||||||
UINT32 cycles_to_clocks(UINT32 cycles) const { return m_execute_config.cycles_to_clocks(cycles); }
|
UINT32 cycles_to_clocks(UINT32 cycles) const { return m_execute_config.cycles_to_clocks(cycles); }
|
||||||
UINT32 min_cycles() const { return m_execute_config.min_cycles(); }
|
UINT32 min_cycles() const { return m_execute_config.min_cycles(); }
|
||||||
UINT32 max_cycles() const { return m_execute_config.max_cycles(); }
|
UINT32 max_cycles() const { return m_execute_config.max_cycles(); }
|
||||||
|
|
||||||
// input line information getters
|
// input line information getters
|
||||||
UINT32 input_lines() const { return m_execute_config.input_lines(); }
|
UINT32 input_lines() const { return m_execute_config.input_lines(); }
|
||||||
UINT32 default_irq_vector() const { return m_execute_config.default_irq_vector(); }
|
UINT32 default_irq_vector() const { return m_execute_config.default_irq_vector(); }
|
||||||
@ -276,13 +276,13 @@ protected:
|
|||||||
class device_input
|
class device_input
|
||||||
{
|
{
|
||||||
static const int USE_STORED_VECTOR = 0xff000000;
|
static const int USE_STORED_VECTOR = 0xff000000;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
device_input();
|
device_input();
|
||||||
|
|
||||||
void start(device_execute_interface *execute, int linenum);
|
void start(device_execute_interface *execute, int linenum);
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
void set_state_synced(int state, int vector = USE_STORED_VECTOR);
|
void set_state_synced(int state, int vector = USE_STORED_VECTOR);
|
||||||
void set_vector(int vector) { m_stored_vector = vector; }
|
void set_vector(int vector) { m_stored_vector = vector; }
|
||||||
int default_irq_callback();
|
int default_irq_callback();
|
||||||
@ -290,11 +290,11 @@ protected:
|
|||||||
device_execute_interface *m_execute;// pointer to the execute interface
|
device_execute_interface *m_execute;// pointer to the execute interface
|
||||||
device_t * m_device; // pointer to our device
|
device_t * m_device; // pointer to our device
|
||||||
int m_linenum; // which input line we are
|
int m_linenum; // which input line we are
|
||||||
|
|
||||||
INT32 m_stored_vector; // most recently written vector
|
INT32 m_stored_vector; // most recently written vector
|
||||||
INT32 m_curvector; // most recently processed vector
|
INT32 m_curvector; // most recently processed vector
|
||||||
UINT8 m_curstate; // most recently processed state
|
UINT8 m_curstate; // most recently processed state
|
||||||
INT32 m_queue[32]; // queue of pending events
|
INT32 m_queue[32]; // queue of pending events
|
||||||
int m_qindex; // index within the queue
|
int m_qindex; // index within the queue
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -311,11 +311,11 @@ protected:
|
|||||||
|
|
||||||
// input states and IRQ callbacks
|
// input states and IRQ callbacks
|
||||||
device_irq_callback m_driver_irq; // driver-specific IRQ callback
|
device_irq_callback m_driver_irq; // driver-specific IRQ callback
|
||||||
device_input m_input[MAX_INPUT_LINES]; // data about inputs
|
device_input m_input[MAX_INPUT_LINES]; // data about inputs
|
||||||
emu_timer * m_timedint_timer; // reference to this device's periodic interrupt timer
|
emu_timer * m_timedint_timer; // reference to this device's periodic interrupt timer
|
||||||
|
|
||||||
// these below are hacks to support multiple interrupts per frame
|
// these below are hacks to support multiple interrupts per frame
|
||||||
INT32 m_iloops; // number of interrupts remaining this frame
|
INT32 m_iloops; // number of interrupts remaining this frame
|
||||||
emu_timer * m_partial_frame_timer; // the timer that triggers partial frame interrupts
|
emu_timer * m_partial_frame_timer; // the timer that triggers partial frame interrupts
|
||||||
attotime m_partial_frame_period; // the length of one partial frame for interrupt purposes
|
attotime m_partial_frame_period; // the length of one partial frame for interrupt purposes
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ protected:
|
|||||||
UINT8 m_divshift; // right shift amount to fit the divisor into 32 bits
|
UINT8 m_divshift; // right shift amount to fit the divisor into 32 bits
|
||||||
UINT32 m_cycles_per_second; // cycles per second, adjusted for multipliers
|
UINT32 m_cycles_per_second; // cycles per second, adjusted for multipliers
|
||||||
attoseconds_t m_attoseconds_per_cycle; // attoseconds per adjusted clock cycle
|
attoseconds_t m_attoseconds_per_cycle; // attoseconds per adjusted clock cycle
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// callbacks
|
// callbacks
|
||||||
static void static_timed_trigger_callback(running_machine *machine, void *ptr, int param);
|
static void static_timed_trigger_callback(running_machine *machine, void *ptr, int param);
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
device_image_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_image_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
virtual ~device_image_interface();
|
virtual ~device_image_interface();
|
||||||
|
|
||||||
// configuration access
|
// configuration access
|
||||||
const device_config_image_interface &image_config() const { return m_image_config; }
|
const device_config_image_interface &image_config() const { return m_image_config; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -83,7 +83,7 @@ device_config_memory_interface::~device_config_memory_interface()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_space_config - return configuration for
|
// memory_space_config - return configuration for
|
||||||
// the given space by index, or NULL if the space
|
// the given space by index, or NULL if the space
|
||||||
// does not exist
|
// does not exist
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -102,7 +102,7 @@ const address_space_config *device_config_memory_interface::memory_space_config(
|
|||||||
bool device_config_memory_interface::interface_process_token(UINT32 entrytype, const machine_config_token *&tokens)
|
bool device_config_memory_interface::interface_process_token(UINT32 entrytype, const machine_config_token *&tokens)
|
||||||
{
|
{
|
||||||
UINT32 data32;
|
UINT32 data32;
|
||||||
|
|
||||||
switch (entrytype)
|
switch (entrytype)
|
||||||
{
|
{
|
||||||
// specify device address map
|
// specify device address map
|
||||||
@ -113,13 +113,13 @@ bool device_config_memory_interface::interface_process_token(UINT32 entrytype, c
|
|||||||
m_address_map[data32] = TOKEN_GET_PTR(tokens, addrmap);
|
m_address_map[data32] = TOKEN_GET_PTR(tokens, addrmap);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// interface_validity_check - perform validity
|
// interface_validity_check - perform validity
|
||||||
// checks on the memory configuration
|
// checks on the memory configuration
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ bool device_config_memory_interface::interface_validity_check(const game_driver
|
|||||||
const device_config *devconfig = crosscast<const device_config *>(this);
|
const device_config *devconfig = crosscast<const device_config *>(this);
|
||||||
bool detected_overlap = DETECT_OVERLAPPING_MEMORY ? false : true;
|
bool detected_overlap = DETECT_OVERLAPPING_MEMORY ? false : true;
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
// loop over all address spaces
|
// loop over all address spaces
|
||||||
for (int spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
for (int spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||||
{
|
{
|
||||||
@ -246,12 +246,12 @@ bool device_config_memory_interface::interface_validity_check(const game_driver
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make sure ports exist
|
// make sure ports exist
|
||||||
// if ((entry->read.type == AMH_PORT && entry->read.tag != NULL && portlist.find(entry->read.tag) == NULL) ||
|
// if ((entry->read.type == AMH_PORT && entry->read.tag != NULL && portlist.find(entry->read.tag) == NULL) ||
|
||||||
// (entry->write.type == AMH_PORT && entry->write.tag != NULL && portlist.find(entry->write.tag) == NULL))
|
// (entry->write.type == AMH_PORT && entry->write.tag != NULL && portlist.find(entry->write.tag) == NULL))
|
||||||
// {
|
// {
|
||||||
// mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver.source_file, driver.name, devconfig->tag(), spaceconfig->m_name, entry->read.tag);
|
// mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver.source_file, driver.name, devconfig->tag(), spaceconfig->m_name, entry->read.tag);
|
||||||
// error = true;
|
// error = true;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// validate bank and share tags
|
// validate bank and share tags
|
||||||
if (entry->read.type == AMH_BANK && !validate_tag(&driver, "bank", entry->read.tag))
|
if (entry->read.type == AMH_BANK && !validate_tag(&driver, "bank", entry->read.tag))
|
||||||
@ -309,9 +309,9 @@ void device_memory_interface::set_address_space(int spacenum, const address_spac
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_translate - translate from logical to
|
// memory_translate - translate from logical to
|
||||||
// phyiscal addresses; designed to be overridden
|
// phyiscal addresses; designed to be overridden
|
||||||
// by the actual device implementation if address
|
// by the actual device implementation if address
|
||||||
// translation is supported
|
// translation is supported
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -323,10 +323,10 @@ bool device_memory_interface::memory_translate(int spacenum, int intention, offs
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_read - perform internal memory
|
// memory_read - perform internal memory
|
||||||
// operations that bypass the memory system;
|
// operations that bypass the memory system;
|
||||||
// designed to be overridden by the actual device
|
// designed to be overridden by the actual device
|
||||||
// implementation if internal read operations are
|
// implementation if internal read operations are
|
||||||
// handled by bypassing the memory system
|
// handled by bypassing the memory system
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -338,10 +338,10 @@ bool device_memory_interface::memory_read(int spacenum, offs_t offset, int size,
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_write - perform internal memory
|
// memory_write - perform internal memory
|
||||||
// operations that bypass the memory system;
|
// operations that bypass the memory system;
|
||||||
// designed to be overridden by the actual device
|
// designed to be overridden by the actual device
|
||||||
// implementation if internal write operations are
|
// implementation if internal write operations are
|
||||||
// handled by bypassing the memory system
|
// handled by bypassing the memory system
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -353,11 +353,11 @@ bool device_memory_interface::memory_write(int spacenum, offs_t offset, int size
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_readop - perform internal memory
|
// memory_readop - perform internal memory
|
||||||
// operations that bypass the memory system;
|
// operations that bypass the memory system;
|
||||||
// designed to be overridden by the actual device
|
// designed to be overridden by the actual device
|
||||||
// implementation if internal opcode fetching
|
// implementation if internal opcode fetching
|
||||||
// operations are handled by bypassing the memory
|
// operations are handled by bypassing the memory
|
||||||
// system
|
// system
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
// CONSTANTS
|
// CONSTANTS
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
// the configuration for a general device
|
// the configuration for a general device
|
||||||
enum device_space
|
enum device_space
|
||||||
{
|
{
|
||||||
AS_PROGRAM = 0,
|
AS_PROGRAM = 0,
|
||||||
@ -126,7 +126,7 @@ public:
|
|||||||
m_page_shift(0),
|
m_page_shift(0),
|
||||||
m_internal_map(internal),
|
m_internal_map(internal),
|
||||||
m_default_map(defmap) { }
|
m_default_map(defmap) { }
|
||||||
|
|
||||||
address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, UINT8 logwidth, UINT8 pageshift, const addrmap_token *internal = NULL, const addrmap_token *defmap = NULL)
|
address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, UINT8 logwidth, UINT8 pageshift, const addrmap_token *internal = NULL, const addrmap_token *defmap = NULL)
|
||||||
: m_name(name),
|
: m_name(name),
|
||||||
m_endianness(endian),
|
m_endianness(endian),
|
||||||
@ -142,29 +142,29 @@ public:
|
|||||||
{
|
{
|
||||||
return (m_addrbus_shift < 0) ? (address << -m_addrbus_shift) : (address >> m_addrbus_shift);
|
return (m_addrbus_shift < 0) ? (address << -m_addrbus_shift) : (address >> m_addrbus_shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline offs_t addr2byte_end(offs_t address) const
|
inline offs_t addr2byte_end(offs_t address) const
|
||||||
{
|
{
|
||||||
return (m_addrbus_shift < 0) ? ((address << -m_addrbus_shift) | ((1 << -m_addrbus_shift) - 1)) : (address >> m_addrbus_shift);
|
return (m_addrbus_shift < 0) ? ((address << -m_addrbus_shift) | ((1 << -m_addrbus_shift) - 1)) : (address >> m_addrbus_shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline offs_t byte2addr(offs_t address) const
|
inline offs_t byte2addr(offs_t address) const
|
||||||
{
|
{
|
||||||
return (m_addrbus_shift > 0) ? (address << m_addrbus_shift) : (address >> -m_addrbus_shift);
|
return (m_addrbus_shift > 0) ? (address << m_addrbus_shift) : (address >> -m_addrbus_shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline offs_t byte2addr_end(offs_t address) const
|
inline offs_t byte2addr_end(offs_t address) const
|
||||||
{
|
{
|
||||||
return (m_addrbus_shift > 0) ? ((address << m_addrbus_shift) | ((1 << -m_addrbus_shift) - 1)) : (address >> -m_addrbus_shift);
|
return (m_addrbus_shift > 0) ? ((address << m_addrbus_shift) | ((1 << -m_addrbus_shift) - 1)) : (address >> -m_addrbus_shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * m_name;
|
const char * m_name;
|
||||||
endianness_t m_endianness;
|
endianness_t m_endianness;
|
||||||
UINT8 m_databus_width;
|
UINT8 m_databus_width;
|
||||||
UINT8 m_addrbus_width;
|
UINT8 m_addrbus_width;
|
||||||
INT8 m_addrbus_shift;
|
INT8 m_addrbus_shift;
|
||||||
UINT8 m_logaddr_width;
|
UINT8 m_logaddr_width;
|
||||||
UINT8 m_page_shift;
|
UINT8 m_page_shift;
|
||||||
const addrmap_token *m_internal_map;
|
const addrmap_token *m_internal_map;
|
||||||
const addrmap_token *m_default_map;
|
const addrmap_token *m_default_map;
|
||||||
};
|
};
|
||||||
@ -195,7 +195,7 @@ protected:
|
|||||||
virtual bool interface_process_token(UINT32 entrytype, const machine_config_token *&tokens);
|
virtual bool interface_process_token(UINT32 entrytype, const machine_config_token *&tokens);
|
||||||
virtual bool interface_validity_check(const game_driver &driver) const;
|
virtual bool interface_validity_check(const game_driver &driver) const;
|
||||||
|
|
||||||
const addrmap_token * m_address_map[ADDRESS_SPACES]; // address maps for each address space
|
const addrmap_token * m_address_map[ADDRESS_SPACES]; // address maps for each address space
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ protected:
|
|||||||
class device_memory_interface : public device_interface
|
class device_memory_interface : public device_interface
|
||||||
{
|
{
|
||||||
friend class device_scheduler;
|
friend class device_scheduler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
device_memory_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_memory_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
@ -241,7 +241,7 @@ protected:
|
|||||||
|
|
||||||
// configuration
|
// configuration
|
||||||
const device_config_memory_interface &m_memory_config; // reference to our device_config_execute_interface
|
const device_config_memory_interface &m_memory_config; // reference to our device_config_execute_interface
|
||||||
const address_space * m_addrspace[ADDRESS_SPACES]; // reported address spaces
|
const address_space * m_addrspace[ADDRESS_SPACES]; // reported address spaces
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ inline device_memory_interface *device_memory(device_t *device)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_get_space - return a pointer to the
|
// device_get_space - return a pointer to the
|
||||||
// given address space on this device
|
// given address space on this device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ inline const address_space *device_get_space(device_t *device, int spacenum = 0)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// devconfig_get_space_config - return a pointer
|
// devconfig_get_space_config - return a pointer
|
||||||
// to sthe given address space's configuration
|
// to sthe given address space's configuration
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
device_nvram_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_nvram_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
virtual ~device_nvram_interface();
|
virtual ~device_nvram_interface();
|
||||||
|
|
||||||
// configuration access
|
// configuration access
|
||||||
const device_config_nvram_interface &nvram_config() const { return m_nvram_config; }
|
const device_config_nvram_interface &nvram_config() const { return m_nvram_config; }
|
||||||
|
|
||||||
// public accessors... for now
|
// public accessors... for now
|
||||||
|
@ -101,21 +101,21 @@ bool device_config_sound_interface::interface_process_token(UINT32 entrytype, co
|
|||||||
reset_routes();
|
reset_routes();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// interface_validity_check - validation for a
|
// interface_validity_check - validation for a
|
||||||
// device after the configuration has been
|
// device after the configuration has been
|
||||||
// constructed
|
// constructed
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
bool device_config_sound_interface::interface_validity_check(const game_driver &driver) const
|
bool device_config_sound_interface::interface_validity_check(const game_driver &driver) const
|
||||||
{
|
{
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
// loop over all the routes
|
// loop over all the routes
|
||||||
for (const sound_route *route = m_route_list; route != NULL; route = route->m_next)
|
for (const sound_route *route = m_route_list; route != NULL; route = route->m_next)
|
||||||
{
|
{
|
||||||
@ -126,7 +126,7 @@ bool device_config_sound_interface::interface_validity_check(const game_driver &
|
|||||||
mame_printf_error("%s: %s attempting to route sound to non-existant device '%s'\n", driver.source_file, driver.name, route->m_target);
|
mame_printf_error("%s: %s attempting to route sound to non-existant device '%s'\n", driver.source_file, driver.name, route->m_target);
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's not a speaker or a sound device, error
|
// if it's not a speaker or a sound device, error
|
||||||
const device_config_sound_interface *sound;
|
const device_config_sound_interface *sound;
|
||||||
if (target->type() != SPEAKER && !target->interface(sound))
|
if (target->type() != SPEAKER && !target->interface(sound))
|
||||||
@ -194,7 +194,7 @@ device_sound_interface::device_sound_interface(running_machine &machine, const d
|
|||||||
device_sound_interface::~device_sound_interface()
|
device_sound_interface::~device_sound_interface()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// interface_post_start - verify that state was
|
// interface_post_start - verify that state was
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
const int MAX_OUTPUTS = 4095; // maximum number of outputs a sound chip can support
|
const int MAX_OUTPUTS = 4095; // maximum number of outputs a sound chip can support
|
||||||
const int ALL_OUTPUTS = MAX_OUTPUTS; // special value indicating all outputs for the current chip
|
const int ALL_OUTPUTS = MAX_OUTPUTS; // special value indicating all outputs for the current chip
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
sound_route(int output, int input, float gain, const char *target);
|
sound_route(int output, int input, float gain, const char *target);
|
||||||
|
|
||||||
sound_route * m_next; // pointer to next route
|
sound_route * m_next; // pointer to next route
|
||||||
UINT32 m_output; // output index, or ALL_OUTPUTS
|
UINT32 m_output; // output index, or ALL_OUTPUTS
|
||||||
UINT32 m_input; // target input index
|
UINT32 m_input; // target input index
|
||||||
@ -137,7 +137,7 @@ public:
|
|||||||
device_sound_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_sound_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
virtual ~device_sound_interface();
|
virtual ~device_sound_interface();
|
||||||
|
|
||||||
// configuration access
|
// configuration access
|
||||||
const device_config_sound_interface &sound_config() const { return m_sound_config; }
|
const device_config_sound_interface &sound_config() const { return m_sound_config; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -152,7 +152,7 @@ protected:
|
|||||||
|
|
||||||
int m_outputs; // number of outputs from this instance
|
int m_outputs; // number of outputs from this instance
|
||||||
sound_output m_output[MAX_OUTPUTS]; // array of output information
|
sound_output m_output[MAX_OUTPUTS]; // array of output information
|
||||||
|
|
||||||
const device_config_sound_interface &m_sound_config;
|
const device_config_sound_interface &m_sound_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,26 +44,26 @@
|
|||||||
// GLOBAL VARIABLES
|
// GLOBAL VARIABLES
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
const UINT64 device_state_entry::k_decimal_divisor[] =
|
const UINT64 device_state_entry::k_decimal_divisor[] =
|
||||||
{
|
{
|
||||||
1,
|
1,
|
||||||
10,
|
10,
|
||||||
100,
|
100,
|
||||||
1000,
|
1000,
|
||||||
10000,
|
10000,
|
||||||
100000,
|
100000,
|
||||||
1000000,
|
1000000,
|
||||||
10000000,
|
10000000,
|
||||||
100000000,
|
100000000,
|
||||||
1000000000,
|
1000000000,
|
||||||
U64(10000000000),
|
U64(10000000000),
|
||||||
U64(100000000000),
|
U64(100000000000),
|
||||||
U64(1000000000000),
|
U64(1000000000000),
|
||||||
U64(10000000000000),
|
U64(10000000000000),
|
||||||
U64(100000000000000),
|
U64(100000000000000),
|
||||||
U64(1000000000000000),
|
U64(1000000000000000),
|
||||||
U64(10000000000000000),
|
U64(10000000000000000),
|
||||||
U64(100000000000000000),
|
U64(100000000000000000),
|
||||||
U64(1000000000000000000),
|
U64(1000000000000000000),
|
||||||
U64(10000000000000000000)
|
U64(10000000000000000000)
|
||||||
};
|
};
|
||||||
@ -88,7 +88,7 @@ device_state_entry::device_state_entry(int index, const char *symbol, void *data
|
|||||||
m_default_format(true),
|
m_default_format(true),
|
||||||
m_sizemask(0)
|
m_sizemask(0)
|
||||||
{
|
{
|
||||||
// set the data pointer
|
// set the data pointer
|
||||||
m_dataptr.v = dataptr;
|
m_dataptr.v = dataptr;
|
||||||
|
|
||||||
// convert the size to a mask
|
// convert the size to a mask
|
||||||
@ -101,11 +101,11 @@ device_state_entry::device_state_entry(int index, const char *symbol, void *data
|
|||||||
m_sizemask = 0xffffffff;
|
m_sizemask = 0xffffffff;
|
||||||
else
|
else
|
||||||
m_sizemask = ~U64(0);
|
m_sizemask = ~U64(0);
|
||||||
|
|
||||||
// default the data mask to the same
|
// default the data mask to the same
|
||||||
m_datamask = m_sizemask;
|
m_datamask = m_sizemask;
|
||||||
format_from_mask();
|
format_from_mask();
|
||||||
|
|
||||||
// override well-known symbols
|
// override well-known symbols
|
||||||
if (index == STATE_GENPC)
|
if (index == STATE_GENPC)
|
||||||
m_symbol.cpy("CURPC");
|
m_symbol.cpy("CURPC");
|
||||||
@ -158,13 +158,13 @@ UINT64 device_state_entry::value() const
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// format - return the value of the given
|
// format - return the value of the given
|
||||||
// pieces of indexed state as a string
|
// pieces of indexed state as a string
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
astring &device_state_entry::format(astring &dest, const char *string, bool maxout) const
|
astring &device_state_entry::format(astring &dest, const char *string, bool maxout) const
|
||||||
{
|
{
|
||||||
UINT64 result = value();
|
UINT64 result = value();
|
||||||
|
|
||||||
// parse the format
|
// parse the format
|
||||||
bool leadzero = false;
|
bool leadzero = false;
|
||||||
bool percent = false;
|
bool percent = false;
|
||||||
@ -356,7 +356,7 @@ void device_state_entry::set_value(const char *string) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// format_from_mask - make a format based on
|
// format_from_mask - make a format based on
|
||||||
// the data mask
|
// the data mask
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ void device_state_entry::format_from_mask()
|
|||||||
width++;
|
width++;
|
||||||
m_format.printf("%%0%dX", width);
|
m_format.printf("%%0%dX", width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -428,7 +428,7 @@ device_state_interface::~device_state_interface()
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// state_value - return the value of the given
|
// state_value - return the value of the given
|
||||||
// pieces of indexed state as a UINT64
|
// pieces of indexed state as a UINT64
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
UINT64 device_state_interface::state_value(int index)
|
UINT64 device_state_interface::state_value(int index)
|
||||||
@ -437,7 +437,7 @@ UINT64 device_state_interface::state_value(int index)
|
|||||||
const device_state_entry *entry = state_find_entry(index);
|
const device_state_entry *entry = state_find_entry(index);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// call the exporter before we do anything
|
// call the exporter before we do anything
|
||||||
if (entry->needs_export())
|
if (entry->needs_export())
|
||||||
state_export(*entry);
|
state_export(*entry);
|
||||||
@ -449,7 +449,7 @@ UINT64 device_state_interface::state_value(int index)
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// state_string - return the value of the given
|
// state_string - return the value of the given
|
||||||
// pieces of indexed state as a string
|
// pieces of indexed state as a string
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
astring &device_state_interface::state_string(int index, astring &dest)
|
astring &device_state_interface::state_string(int index, astring &dest)
|
||||||
@ -458,7 +458,7 @@ astring &device_state_interface::state_string(int index, astring &dest)
|
|||||||
const device_state_entry *entry = state_find_entry(index);
|
const device_state_entry *entry = state_find_entry(index);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return dest.cpy("???");
|
return dest.cpy("???");
|
||||||
|
|
||||||
// get the custom string if needed
|
// get the custom string if needed
|
||||||
astring custom;
|
astring custom;
|
||||||
if (entry->needs_custom_string())
|
if (entry->needs_custom_string())
|
||||||
@ -489,7 +489,7 @@ int device_state_interface::state_string_max_length(int index)
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// state_set_value - set the value of the given
|
// state_set_value - set the value of the given
|
||||||
// pieces of indexed state from a UINT64
|
// pieces of indexed state from a UINT64
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void device_state_interface::state_set_value(int index, UINT64 value)
|
void device_state_interface::state_set_value(int index, UINT64 value)
|
||||||
@ -498,7 +498,7 @@ void device_state_interface::state_set_value(int index, UINT64 value)
|
|||||||
const device_state_entry *entry = state_find_entry(index);
|
const device_state_entry *entry = state_find_entry(index);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// set the value
|
// set the value
|
||||||
entry->set_value(value);
|
entry->set_value(value);
|
||||||
|
|
||||||
@ -510,7 +510,7 @@ void device_state_interface::state_set_value(int index, UINT64 value)
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// state_set_value - set the value of the given
|
// state_set_value - set the value of the given
|
||||||
// pieces of indexed state from a string
|
// pieces of indexed state from a string
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void device_state_interface::state_set_value(int index, const char *string)
|
void device_state_interface::state_set_value(int index, const char *string)
|
||||||
@ -519,7 +519,7 @@ void device_state_interface::state_set_value(int index, const char *string)
|
|||||||
const device_state_entry *entry = state_find_entry(index);
|
const device_state_entry *entry = state_find_entry(index);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// set the value
|
// set the value
|
||||||
entry->set_value(string);
|
entry->set_value(string);
|
||||||
|
|
||||||
@ -571,7 +571,7 @@ void device_state_interface::state_string_export(const device_state_entry &entry
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// state_add - return the value of the given
|
// state_add - return the value of the given
|
||||||
// pieces of indexed state as a UINT64
|
// pieces of indexed state as a UINT64
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
device_state_entry &device_state_interface::state_add(int index, const char *symbol, void *data, UINT8 size)
|
device_state_entry &device_state_interface::state_add(int index, const char *symbol, void *data, UINT8 size)
|
||||||
@ -579,7 +579,7 @@ device_state_entry &device_state_interface::state_add(int index, const char *sym
|
|||||||
// assert validity of incoming parameters
|
// assert validity of incoming parameters
|
||||||
assert(size == 1 || size == 2 || size == 4 || size == 8);
|
assert(size == 1 || size == 2 || size == 4 || size == 8);
|
||||||
assert(symbol != NULL);
|
assert(symbol != NULL);
|
||||||
|
|
||||||
// allocate new entry
|
// allocate new entry
|
||||||
device_state_entry *entry = auto_alloc(&m_machine, device_state_entry(index, symbol, data, size));
|
device_state_entry *entry = auto_alloc(&m_machine, device_state_entry(index, symbol, data, size));
|
||||||
|
|
||||||
@ -587,11 +587,11 @@ device_state_entry &device_state_interface::state_add(int index, const char *sym
|
|||||||
device_state_entry **tailptr;
|
device_state_entry **tailptr;
|
||||||
for (tailptr = &m_state_list; *tailptr != NULL; tailptr = &(*tailptr)->m_next) ;
|
for (tailptr = &m_state_list; *tailptr != NULL; tailptr = &(*tailptr)->m_next) ;
|
||||||
*tailptr = entry;
|
*tailptr = entry;
|
||||||
|
|
||||||
// set the fast entry if applicable
|
// set the fast entry if applicable
|
||||||
if (index >= k_fast_state_min && index <= k_fast_state_max)
|
if (index >= k_fast_state_min && index <= k_fast_state_max)
|
||||||
m_fast_state[index - k_fast_state_min] = entry;
|
m_fast_state[index - k_fast_state_min] = entry;
|
||||||
|
|
||||||
return *entry;
|
return *entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,12 +606,12 @@ const device_state_entry *device_state_interface::state_find_entry(int index)
|
|||||||
// use fast lookup if possible
|
// use fast lookup if possible
|
||||||
if (index >= k_fast_state_min && index <= k_fast_state_max)
|
if (index >= k_fast_state_min && index <= k_fast_state_max)
|
||||||
return m_fast_state[index - k_fast_state_min];
|
return m_fast_state[index - k_fast_state_min];
|
||||||
|
|
||||||
// otherwise, scan the first
|
// otherwise, scan the first
|
||||||
for (const device_state_entry *entry = m_state_list; entry != NULL; entry = entry->m_next)
|
for (const device_state_entry *entry = m_state_list; entry != NULL; entry = entry->m_next)
|
||||||
if (entry->m_index == index)
|
if (entry->m_index == index)
|
||||||
return entry;
|
return entry;
|
||||||
|
|
||||||
// handle failure by returning NULL
|
// handle failure by returning NULL
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ enum
|
|||||||
class device_state_entry
|
class device_state_entry
|
||||||
{
|
{
|
||||||
friend class device_state_interface;
|
friend class device_state_interface;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size);
|
device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size);
|
||||||
@ -86,7 +86,7 @@ public:
|
|||||||
device_state_entry &callimport() { m_flags |= DSF_IMPORT; return *this; }
|
device_state_entry &callimport() { m_flags |= DSF_IMPORT; return *this; }
|
||||||
device_state_entry &callexport() { m_flags |= DSF_EXPORT; return *this; }
|
device_state_entry &callexport() { m_flags |= DSF_EXPORT; return *this; }
|
||||||
device_state_entry &noshow() { m_flags |= DSF_NOSHOW; return *this; }
|
device_state_entry &noshow() { m_flags |= DSF_NOSHOW; return *this; }
|
||||||
|
|
||||||
// iteration helpers
|
// iteration helpers
|
||||||
const device_state_entry *next() const { return m_next; }
|
const device_state_entry *next() const { return m_next; }
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ protected:
|
|||||||
void set_value(UINT64 value) const;
|
void set_value(UINT64 value) const;
|
||||||
void set_value(const char *string) const;
|
void set_value(const char *string) const;
|
||||||
|
|
||||||
// statics
|
// statics
|
||||||
static const UINT64 k_decimal_divisor[20]; // divisors for outputting decimal values
|
static const UINT64 k_decimal_divisor[20]; // divisors for outputting decimal values
|
||||||
|
|
||||||
// public state description
|
// public state description
|
||||||
@ -159,7 +159,7 @@ public:
|
|||||||
device_state_interface(running_machine &machine, const device_config &config, device_t &device);
|
device_state_interface(running_machine &machine, const device_config &config, device_t &device);
|
||||||
virtual ~device_state_interface();
|
virtual ~device_state_interface();
|
||||||
|
|
||||||
// configuration access
|
// configuration access
|
||||||
const device_config_state_interface &state_config() const { return m_state_config; }
|
const device_config_state_interface &state_config() const { return m_state_config; }
|
||||||
const device_state_entry *state_first() const { return m_state_list; }
|
const device_state_entry *state_first() const { return m_state_list; }
|
||||||
|
|
||||||
@ -190,8 +190,8 @@ protected:
|
|||||||
|
|
||||||
// internal operation overrides
|
// internal operation overrides
|
||||||
virtual void interface_post_start();
|
virtual void interface_post_start();
|
||||||
|
|
||||||
// find the entry for a given index
|
// find the entry for a given index
|
||||||
const device_state_entry *state_find_entry(int index);
|
const device_state_entry *state_find_entry(int index);
|
||||||
|
|
||||||
// constants
|
// constants
|
||||||
@ -202,7 +202,7 @@ protected:
|
|||||||
running_machine & m_machine; // reference to owning machine
|
running_machine & m_machine; // reference to owning machine
|
||||||
const device_config_state_interface & m_state_config; // reference to configuration data
|
const device_config_state_interface & m_state_config; // reference to configuration data
|
||||||
device_state_entry * m_state_list; // head of state list
|
device_state_entry * m_state_list; // head of state list
|
||||||
device_state_entry * m_fast_state[k_fast_state_max + 1 - k_fast_state_min];
|
device_state_entry * m_fast_state[k_fast_state_max + 1 - k_fast_state_min];
|
||||||
// fast access to common entries
|
// fast access to common entries
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -320,16 +320,16 @@ private:
|
|||||||
// CASTING TEMPLATES
|
// CASTING TEMPLATES
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
// template function for casting from a base class to a derived class that is checked
|
// template function for casting from a base class to a derived class that is checked
|
||||||
// in debug builds and fast in release builds
|
// in debug builds and fast in release builds
|
||||||
template<class _Dest, class _Source>
|
template<class _Dest, class _Source>
|
||||||
inline _Dest downcast(_Source *src)
|
inline _Dest downcast(_Source *src)
|
||||||
{
|
{
|
||||||
assert(dynamic_cast<_Dest>(src) == src);
|
assert(dynamic_cast<_Dest>(src) == src);
|
||||||
return static_cast<_Dest>(src);
|
return static_cast<_Dest>(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _Dest, class _Source>
|
template<class _Dest, class _Source>
|
||||||
inline _Dest downcast(_Source &src)
|
inline _Dest downcast(_Source &src)
|
||||||
{
|
{
|
||||||
assert(&dynamic_cast<_Dest>(src) == &src);
|
assert(&dynamic_cast<_Dest>(src) == &src);
|
||||||
@ -339,7 +339,7 @@ inline _Dest downcast(_Source &src)
|
|||||||
|
|
||||||
// template function for cross-casting from one class to another that throws a bad_cast
|
// template function for cross-casting from one class to another that throws a bad_cast
|
||||||
// exception instead of returning NULL
|
// exception instead of returning NULL
|
||||||
template<class _Dest, class _Source>
|
template<class _Dest, class _Source>
|
||||||
inline _Dest crosscast(_Source *src)
|
inline _Dest crosscast(_Source *src)
|
||||||
{
|
{
|
||||||
_Dest result = dynamic_cast<_Dest>(src);
|
_Dest result = dynamic_cast<_Dest>(src);
|
||||||
@ -355,7 +355,7 @@ inline _Dest crosscast(_Source *src)
|
|||||||
// COMMON TEMPLATES
|
// COMMON TEMPLATES
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class tagged_list
|
class tagged_list
|
||||||
{
|
{
|
||||||
DISABLE_COPYING(tagged_list);
|
DISABLE_COPYING(tagged_list);
|
||||||
|
@ -160,7 +160,7 @@ const options_entry mame_core_options[] =
|
|||||||
{ "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" },
|
{ "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" },
|
||||||
|
|
||||||
/* image device options */
|
/* image device options */
|
||||||
{ OPTION_ADDED_DEVICE_OPTIONS, "0", OPTION_BOOLEAN | OPTION_INTERNAL, "image device-specific options have been added" },
|
{ OPTION_ADDED_DEVICE_OPTIONS, "0", OPTION_BOOLEAN | OPTION_INTERNAL, "image device-specific options have been added" },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ static void mame_puts_error(const char *s)
|
|||||||
{
|
{
|
||||||
mame_printf_error("%s", s);
|
mame_printf_error("%s", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
image_get_device_option - accesses a device
|
image_get_device_option - accesses a device
|
||||||
option
|
option
|
||||||
@ -249,14 +249,14 @@ void image_add_device_options(core_options *opts, const game_driver *driver)
|
|||||||
options_add_entries(opts, entry);
|
options_add_entries(opts, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve info about the device instance */
|
/* retrieve info about the device instance */
|
||||||
dev_full_name.printf("%s;%s", image->instance_name(), image->brief_instance_name());
|
dev_full_name.printf("%s;%s", image->instance_name(), image->brief_instance_name());
|
||||||
|
|
||||||
/* add the option */
|
/* add the option */
|
||||||
memset(entry, 0, sizeof(entry));
|
memset(entry, 0, sizeof(entry));
|
||||||
entry[0].name = dev_full_name;
|
entry[0].name = dev_full_name;
|
||||||
options_add_entries(opts, entry);
|
options_add_entries(opts, entry);
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ core_options *mame_options_init(const options_entry *entries)
|
|||||||
|
|
||||||
/* we need to dynamically add options when the device name is parsed */
|
/* we need to dynamically add options when the device name is parsed */
|
||||||
options_set_option_callback(opts, OPTION_GAMENAME, image_driver_name_callback);
|
options_set_option_callback(opts, OPTION_GAMENAME, image_driver_name_callback);
|
||||||
|
|
||||||
#ifdef MESS
|
#ifdef MESS
|
||||||
mess_options_init(opts);
|
mess_options_init(opts);
|
||||||
#endif /* MESS */
|
#endif /* MESS */
|
||||||
|
@ -904,7 +904,7 @@ static void print_game_images(FILE *out, const game_driver *game, const machine_
|
|||||||
fprintf(out, " name=\"%s\"", xml_normalize_string(name));
|
fprintf(out, " name=\"%s\"", xml_normalize_string(name));
|
||||||
fprintf(out, " briefname=\"%s\"", xml_normalize_string(shortname));
|
fprintf(out, " briefname=\"%s\"", xml_normalize_string(shortname));
|
||||||
fprintf(out, "/>\n");
|
fprintf(out, "/>\n");
|
||||||
|
|
||||||
char *ext = strtok((char*)dev->file_extensions(),",");
|
char *ext = strtok((char*)dev->file_extensions(),",");
|
||||||
while (ext != NULL)
|
while (ext != NULL)
|
||||||
{
|
{
|
||||||
@ -912,7 +912,7 @@ static void print_game_images(FILE *out, const game_driver *game, const machine_
|
|||||||
fprintf(out, " name=\"%s\"", xml_normalize_string(ext));
|
fprintf(out, " name=\"%s\"", xml_normalize_string(ext));
|
||||||
fprintf(out, "/>\n");
|
fprintf(out, "/>\n");
|
||||||
ext = strtok (NULL, ",");
|
ext = strtok (NULL, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(out, "\t\t</device>\n");
|
fprintf(out, "\t\t</device>\n");
|
||||||
}
|
}
|
||||||
|
@ -150,11 +150,11 @@ enum
|
|||||||
IPT_TILT1,
|
IPT_TILT1,
|
||||||
IPT_TILT2,
|
IPT_TILT2,
|
||||||
IPT_TILT3,
|
IPT_TILT3,
|
||||||
IPT_TILT4,
|
IPT_TILT4,
|
||||||
|
|
||||||
/* misc other digital inputs */
|
/* misc other digital inputs */
|
||||||
IPT_SERVICE,
|
IPT_SERVICE,
|
||||||
IPT_TILT,
|
IPT_TILT,
|
||||||
IPT_INTERLOCK,
|
IPT_INTERLOCK,
|
||||||
IPT_VOLUME_UP,
|
IPT_VOLUME_UP,
|
||||||
IPT_VOLUME_DOWN,
|
IPT_VOLUME_DOWN,
|
||||||
@ -732,7 +732,7 @@ class input_port_config
|
|||||||
public:
|
public:
|
||||||
input_port_config(const char *tag);
|
input_port_config(const char *tag);
|
||||||
~input_port_config();
|
~input_port_config();
|
||||||
|
|
||||||
input_port_config *next() const { return m_next; }
|
input_port_config *next() const { return m_next; }
|
||||||
|
|
||||||
input_port_config * m_next; /* pointer to next port */
|
input_port_config * m_next; /* pointer to next port */
|
||||||
|
@ -396,7 +396,7 @@ static const input_type_desc core_types[] =
|
|||||||
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN9, "Coin 9", SEQ_DEF_0 )
|
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN9, "Coin 9", SEQ_DEF_0 )
|
||||||
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN10, "Coin 10", SEQ_DEF_0 )
|
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN10, "Coin 10", SEQ_DEF_0 )
|
||||||
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN11, "Coin 11", SEQ_DEF_0 )
|
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN11, "Coin 11", SEQ_DEF_0 )
|
||||||
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN12, "Coin 12", SEQ_DEF_0 )
|
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN12, "Coin 12", SEQ_DEF_0 )
|
||||||
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, BILL1, "Bill 1", SEQ_DEF_1(KEYCODE_BACKSPACE) )
|
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, BILL1, "Bill 1", SEQ_DEF_1(KEYCODE_BACKSPACE) )
|
||||||
|
|
||||||
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, SERVICE1, "Service 1", SEQ_DEF_1(KEYCODE_9) )
|
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, SERVICE1, "Service 1", SEQ_DEF_1(KEYCODE_9) )
|
||||||
|
@ -963,7 +963,7 @@ DEVICE_GET_INFO(cia6526r1)
|
|||||||
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cia); break;
|
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cia); break;
|
||||||
case DEVINFO_FCT_STOP: /* Nothing */ break;
|
case DEVINFO_FCT_STOP: /* Nothing */ break;
|
||||||
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cia); break;
|
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cia); break;
|
||||||
// case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME(cia); break;
|
// case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME(cia); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as NULL-terminated strings --- */
|
/* --- the following bits of info are returned as NULL-terminated strings --- */
|
||||||
case DEVINFO_STR_NAME: strcpy(info->s, "MOS6526 rev1"); break;
|
case DEVINFO_STR_NAME: strcpy(info->s, "MOS6526 rev1"); break;
|
||||||
|
@ -107,7 +107,7 @@ device_t *eeprom_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -119,11 +119,11 @@ void eeprom_device_config::device_config_complete()
|
|||||||
m_default_data = reinterpret_cast<const UINT8 *>(m_inline_data[INLINE_DATAPTR]);
|
m_default_data = reinterpret_cast<const UINT8 *>(m_inline_data[INLINE_DATAPTR]);
|
||||||
m_default_data_size = m_inline_data[INLINE_DATASIZE];
|
m_default_data_size = m_inline_data[INLINE_DATASIZE];
|
||||||
m_default_value = m_inline_data[INLINE_DEFVALUE];
|
m_default_value = m_inline_data[INLINE_DEFVALUE];
|
||||||
|
|
||||||
// inherit a copy of the static data
|
// inherit a copy of the static data
|
||||||
if (intf != NULL)
|
if (intf != NULL)
|
||||||
*static_cast<eeprom_interface *>(this) = *intf;
|
*static_cast<eeprom_interface *>(this) = *intf;
|
||||||
|
|
||||||
// now describe our address space
|
// now describe our address space
|
||||||
if (m_data_bits == 8)
|
if (m_data_bits == 8)
|
||||||
m_space_config = address_space_config("eeprom", ENDIANNESS_BIG, 8, m_address_bits, 0, *ADDRESS_MAP_NAME(eeprom_map8));
|
m_space_config = address_space_config("eeprom", ENDIANNESS_BIG, 8, m_address_bits, 0, *ADDRESS_MAP_NAME(eeprom_map8));
|
||||||
@ -133,7 +133,7 @@ void eeprom_device_config::device_config_complete()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_validity_check - perform validity checks
|
// device_validity_check - perform validity checks
|
||||||
// on this device
|
// on this device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ bool eeprom_device_config::device_validity_check(const game_driver &driver) cons
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_space_config - return a description of
|
// memory_space_config - return a description of
|
||||||
// any address spaces owned by this device
|
// any address spaces owned by this device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
@ -45,14 +45,14 @@
|
|||||||
|
|
||||||
struct eeprom_interface
|
struct eeprom_interface
|
||||||
{
|
{
|
||||||
UINT8 m_address_bits; // EEPROM has 2^address_bits cells
|
UINT8 m_address_bits; // EEPROM has 2^address_bits cells
|
||||||
UINT8 m_data_bits; // every cell has this many bits (8 or 16)
|
UINT8 m_data_bits; // every cell has this many bits (8 or 16)
|
||||||
const char *m_cmd_read; // read command string, e.g. "0110"
|
const char *m_cmd_read; // read command string, e.g. "0110"
|
||||||
const char *m_cmd_write; // write command string, e.g. "0111"
|
const char *m_cmd_write; // write command string, e.g. "0111"
|
||||||
const char *m_cmd_erase; // erase command string, or 0 if n/a
|
const char *m_cmd_erase; // erase command string, or 0 if n/a
|
||||||
const char *m_cmd_lock; // lock command string, or 0 if n/a
|
const char *m_cmd_lock; // lock command string, or 0 if n/a
|
||||||
const char *m_cmd_unlock; // unlock command string, or 0 if n/a
|
const char *m_cmd_unlock; // unlock command string, or 0 if n/a
|
||||||
bool m_enable_multi_read; // set to 1 to enable multiple values to be read from one read command
|
bool m_enable_multi_read; // set to 1 to enable multiple values to be read from one read command
|
||||||
int m_reset_delay; // number of times eeprom_read_bit() should return 0 after a reset,
|
int m_reset_delay; // number of times eeprom_read_bit() should return 0 after a reset,
|
||||||
// before starting to return 1.
|
// before starting to return 1.
|
||||||
};
|
};
|
||||||
@ -61,13 +61,13 @@ struct eeprom_interface
|
|||||||
|
|
||||||
// ======================> eeprom_device_config
|
// ======================> eeprom_device_config
|
||||||
|
|
||||||
class eeprom_device_config : public device_config,
|
class eeprom_device_config : public device_config,
|
||||||
public device_config_memory_interface,
|
public device_config_memory_interface,
|
||||||
public device_config_nvram_interface,
|
public device_config_nvram_interface,
|
||||||
public eeprom_interface
|
public eeprom_interface
|
||||||
{
|
{
|
||||||
friend class eeprom_device;
|
friend class eeprom_device;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
eeprom_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
eeprom_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
|
|
||||||
@ -92,21 +92,21 @@ protected:
|
|||||||
// device_config overrides
|
// device_config overrides
|
||||||
virtual void device_config_complete();
|
virtual void device_config_complete();
|
||||||
virtual bool device_validity_check(const game_driver &driver) const;
|
virtual bool device_validity_check(const game_driver &driver) const;
|
||||||
|
|
||||||
// device_config_memory_interface overrides
|
// device_config_memory_interface overrides
|
||||||
virtual const address_space_config *memory_space_config(int spacenum = 0) const;
|
virtual const address_space_config *memory_space_config(int spacenum = 0) const;
|
||||||
|
|
||||||
// device-specific configuration
|
// device-specific configuration
|
||||||
const UINT8 * m_default_data;
|
const UINT8 * m_default_data;
|
||||||
int m_default_data_size;
|
int m_default_data_size;
|
||||||
UINT32 m_default_value;
|
UINT32 m_default_value;
|
||||||
address_space_config m_space_config;
|
address_space_config m_space_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ======================> eeprom_device
|
// ======================> eeprom_device
|
||||||
|
|
||||||
class eeprom_device : public device_t,
|
class eeprom_device : public device_t,
|
||||||
public device_memory_interface,
|
public device_memory_interface,
|
||||||
public device_nvram_interface
|
public device_nvram_interface
|
||||||
{
|
{
|
||||||
@ -114,7 +114,7 @@ class eeprom_device : public device_t,
|
|||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
eeprom_device(running_machine &_machine, const eeprom_device_config &config);
|
eeprom_device(running_machine &_machine, const eeprom_device_config &config);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// I/O operations
|
// I/O operations
|
||||||
void write_bit(int state);
|
void write_bit(int state);
|
||||||
@ -126,7 +126,7 @@ protected:
|
|||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
|
|
||||||
// device_nvram_interface overrides
|
// device_nvram_interface overrides
|
||||||
virtual void nvram_default();
|
virtual void nvram_default();
|
||||||
virtual void nvram_read(mame_file &file);
|
virtual void nvram_read(mame_file &file);
|
||||||
@ -142,7 +142,7 @@ protected:
|
|||||||
const eeprom_device_config &m_config;
|
const eeprom_device_config &m_config;
|
||||||
|
|
||||||
int m_serial_count;
|
int m_serial_count;
|
||||||
UINT8 m_serial_buffer[SERIAL_BUFFER_LENGTH];
|
UINT8 m_serial_buffer[SERIAL_BUFFER_LENGTH];
|
||||||
int m_data_bits;
|
int m_data_bits;
|
||||||
int m_read_address;
|
int m_read_address;
|
||||||
int m_clock_count;
|
int m_clock_count;
|
||||||
|
@ -347,7 +347,7 @@ void nvram_load(running_machine *machine)
|
|||||||
// close the file
|
// close the file
|
||||||
mame_fclose(nvram_file);
|
mame_fclose(nvram_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, tell everyone to initialize their NVRAM areas
|
// otherwise, tell everyone to initialize their NVRAM areas
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -266,7 +266,7 @@ UINT32 intelflash_read(int chip, UINT32 address)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// logerror( "intelflash_read( %d, %08x ) %08x\n", chip, address, data );
|
// logerror( "intelflash_read( %d, %08x ) %08x\n", chip, address, data );
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ void intelflash_write(int chip, UINT32 address, UINT32 data)
|
|||||||
}
|
}
|
||||||
c = &chips[ chip ];
|
c = &chips[ chip ];
|
||||||
|
|
||||||
// logerror( "intelflash_write( %d, %08x, %08x )\n", chip, address, data );
|
// logerror( "intelflash_write( %d, %08x, %08x )\n", chip, address, data );
|
||||||
|
|
||||||
switch( c->flash_mode )
|
switch( c->flash_mode )
|
||||||
{
|
{
|
||||||
@ -443,13 +443,13 @@ void intelflash_write(int chip, UINT32 address, UINT32 data)
|
|||||||
UINT16 *flash_memory = (UINT16 *)c->flash_memory;
|
UINT16 *flash_memory = (UINT16 *)c->flash_memory;
|
||||||
if (c->sector_is_4k)
|
if (c->sector_is_4k)
|
||||||
{
|
{
|
||||||
memset( &flash_memory[ address & ~0x7ff ], 0xff, 4 * 1024 );
|
memset( &flash_memory[ address & ~0x7ff ], 0xff, 4 * 1024 );
|
||||||
c->erase_sector = address & ~0x7ff;
|
c->erase_sector = address & ~0x7ff;
|
||||||
timer_adjust_oneshot( c->timer, ATTOTIME_IN_MSEC( 125 ), 0 );
|
timer_adjust_oneshot( c->timer, ATTOTIME_IN_MSEC( 125 ), 0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 );
|
memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 );
|
||||||
c->erase_sector = address & ~0x7fff;
|
c->erase_sector = address & ~0x7fff;
|
||||||
timer_adjust_oneshot( c->timer, ATTOTIME_IN_SEC( 1 ), 0 );
|
timer_adjust_oneshot( c->timer, ATTOTIME_IN_SEC( 1 ), 0 );
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ device_t *z80ctc_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -116,7 +116,7 @@ void z80ctc_device_config::device_config_complete()
|
|||||||
const z80ctc_interface *intf = reinterpret_cast<const z80ctc_interface *>(static_config());
|
const z80ctc_interface *intf = reinterpret_cast<const z80ctc_interface *>(static_config());
|
||||||
if (intf != NULL)
|
if (intf != NULL)
|
||||||
*static_cast<z80ctc_interface *>(this) = *intf;
|
*static_cast<z80ctc_interface *>(this) = *intf;
|
||||||
|
|
||||||
// or initialize to defaults if none provided
|
// or initialize to defaults if none provided
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -154,7 +154,7 @@ void z80ctc_device::device_start()
|
|||||||
{
|
{
|
||||||
m_period16 = attotime_mul(ATTOTIME_IN_HZ(m_clock), 16);
|
m_period16 = attotime_mul(ATTOTIME_IN_HZ(m_clock), 16);
|
||||||
m_period256 = attotime_mul(ATTOTIME_IN_HZ(m_clock), 256);
|
m_period256 = attotime_mul(ATTOTIME_IN_HZ(m_clock), 256);
|
||||||
|
|
||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
devcb_resolve_write_line(&m_intr, &m_config.m_intr, this);
|
devcb_resolve_write_line(&m_intr, &m_config.m_intr, this);
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ int z80ctc_device::z80daisy_irq_ack()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// z80daisy_irq_reti - clear the interrupt
|
// z80daisy_irq_reti - clear the interrupt
|
||||||
// pending state to allow other interrupts through
|
// pending state to allow other interrupts through
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
@ -47,18 +47,18 @@ const int NOTIMER_3 = (1<<3);
|
|||||||
|
|
||||||
struct z80ctc_interface
|
struct z80ctc_interface
|
||||||
{
|
{
|
||||||
UINT8 m_notimer; // timer disabler mask
|
UINT8 m_notimer; // timer disabler mask
|
||||||
devcb_write_line m_intr; // callback when change interrupt status
|
devcb_write_line m_intr; // callback when change interrupt status
|
||||||
devcb_write_line m_zc0; // ZC/TO0 callback
|
devcb_write_line m_zc0; // ZC/TO0 callback
|
||||||
devcb_write_line m_zc1; // ZC/TO1 callback
|
devcb_write_line m_zc1; // ZC/TO1 callback
|
||||||
devcb_write_line m_zc2; // ZC/TO2 callback
|
devcb_write_line m_zc2; // ZC/TO2 callback
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ======================> z80ctc_device_config
|
// ======================> z80ctc_device_config
|
||||||
|
|
||||||
class z80ctc_device_config : public device_config,
|
class z80ctc_device_config : public device_config,
|
||||||
public device_config_z80daisy_interface,
|
public device_config_z80daisy_interface,
|
||||||
public z80ctc_interface
|
public z80ctc_interface
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ protected:
|
|||||||
|
|
||||||
// ======================> z80ctc_device
|
// ======================> z80ctc_device
|
||||||
|
|
||||||
class z80ctc_device : public device_t,
|
class z80ctc_device : public device_t,
|
||||||
public device_z80daisy_interface
|
public device_z80daisy_interface
|
||||||
{
|
{
|
||||||
friend class z80ctc_device_config;
|
friend class z80ctc_device_config;
|
||||||
|
@ -178,7 +178,7 @@ device_t *z80dart_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -189,7 +189,7 @@ void z80dart_device_config::device_config_complete()
|
|||||||
const z80dart_interface *intf = reinterpret_cast<const z80dart_interface *>(static_config());
|
const z80dart_interface *intf = reinterpret_cast<const z80dart_interface *>(static_config());
|
||||||
if (intf != NULL)
|
if (intf != NULL)
|
||||||
*static_cast<z80dart_interface *>(this) = *intf;
|
*static_cast<z80dart_interface *>(this) = *intf;
|
||||||
|
|
||||||
// or initialize to defaults if none provided
|
// or initialize to defaults if none provided
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -234,7 +234,7 @@ void z80dart_device::device_start()
|
|||||||
{
|
{
|
||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
|
devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
|
||||||
|
|
||||||
m_channel[Z80DART_CH_A].start(this, Z80DART_CH_A, m_config.m_in_rxda_func, m_config.m_out_txda_func, m_config.m_out_dtra_func, m_config.m_out_rtsa_func, m_config.m_out_wrdya_func);
|
m_channel[Z80DART_CH_A].start(this, Z80DART_CH_A, m_config.m_in_rxda_func, m_config.m_out_txda_func, m_config.m_out_dtra_func, m_config.m_out_rtsa_func, m_config.m_out_wrdya_func);
|
||||||
m_channel[Z80DART_CH_B].start(this, Z80DART_CH_B, m_config.m_in_rxdb_func, m_config.m_out_txdb_func, m_config.m_out_dtrb_func, m_config.m_out_rtsb_func, m_config.m_out_wrdyb_func);
|
m_channel[Z80DART_CH_B].start(this, Z80DART_CH_B, m_config.m_in_rxdb_func, m_config.m_out_txdb_func, m_config.m_out_dtrb_func, m_config.m_out_rtsb_func, m_config.m_out_wrdyb_func);
|
||||||
|
|
||||||
@ -457,7 +457,7 @@ z80dart_device::dart_channel::dart_channel()
|
|||||||
void z80dart_device::dart_channel::start(z80dart_device *device, int index, const devcb_read_line &in_rxd, const devcb_write_line &out_txd, const devcb_write_line &out_dtr, const devcb_write_line &out_rts, const devcb_write_line &out_wrdy)
|
void z80dart_device::dart_channel::start(z80dart_device *device, int index, const devcb_read_line &in_rxd, const devcb_write_line &out_txd, const devcb_write_line &out_dtr, const devcb_write_line &out_rts, const devcb_write_line &out_wrdy)
|
||||||
{
|
{
|
||||||
m_index = index;
|
m_index = index;
|
||||||
|
|
||||||
devcb_resolve_read_line(&m_in_rxd_func, &in_rxd, m_device);
|
devcb_resolve_read_line(&m_in_rxd_func, &in_rxd, m_device);
|
||||||
devcb_resolve_write_line(&m_out_txd_func, &out_txd, m_device);
|
devcb_resolve_write_line(&m_out_txd_func, &out_txd, m_device);
|
||||||
devcb_resolve_write_line(&m_out_dtr_func, &out_dtr, m_device);
|
devcb_resolve_write_line(&m_out_dtr_func, &out_dtr, m_device);
|
||||||
|
@ -97,7 +97,7 @@ struct z80dart_interface
|
|||||||
|
|
||||||
// ======================> z80dart_device_config
|
// ======================> z80dart_device_config
|
||||||
|
|
||||||
class z80dart_device_config : public device_config,
|
class z80dart_device_config : public device_config,
|
||||||
public device_config_z80daisy_interface,
|
public device_config_z80daisy_interface,
|
||||||
public z80dart_interface
|
public z80dart_interface
|
||||||
{
|
{
|
||||||
@ -123,7 +123,7 @@ protected:
|
|||||||
|
|
||||||
// ======================> z80dart_device
|
// ======================> z80dart_device
|
||||||
|
|
||||||
class z80dart_device : public device_t,
|
class z80dart_device : public device_t,
|
||||||
public device_z80daisy_interface
|
public device_z80daisy_interface
|
||||||
{
|
{
|
||||||
friend class z80dart_device_config;
|
friend class z80dart_device_config;
|
||||||
@ -140,10 +140,10 @@ public:
|
|||||||
// data register access
|
// data register access
|
||||||
UINT8 data_read(int which) { return m_channel[which].data_read(); }
|
UINT8 data_read(int which) { return m_channel[which].data_read(); }
|
||||||
void data_write(int which, UINT8 data) { return m_channel[which].data_write(data); }
|
void data_write(int which, UINT8 data) { return m_channel[which].data_write(data); }
|
||||||
|
|
||||||
// put data on the input lines
|
// put data on the input lines
|
||||||
void receive_data(int which, UINT8 data) { m_channel[which].receive_data(data); }
|
void receive_data(int which, UINT8 data) { m_channel[which].receive_data(data); }
|
||||||
|
|
||||||
// control line access
|
// control line access
|
||||||
void cts_w(int which, int state) { m_channel[which].cts_w(state); }
|
void cts_w(int which, int state) { m_channel[which].cts_w(state); }
|
||||||
void dcd_w(int which, int state) { m_channel[which].dcd_w(state); }
|
void dcd_w(int which, int state) { m_channel[which].dcd_w(state); }
|
||||||
@ -164,26 +164,26 @@ private:
|
|||||||
// internal interrupt management
|
// internal interrupt management
|
||||||
void check_interrupts();
|
void check_interrupts();
|
||||||
void take_interrupt(int priority);
|
void take_interrupt(int priority);
|
||||||
|
|
||||||
// a single channel on the DART
|
// a single channel on the DART
|
||||||
class dart_channel
|
class dart_channel
|
||||||
{
|
{
|
||||||
friend class z80dart_device;
|
friend class z80dart_device;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
dart_channel();
|
dart_channel();
|
||||||
|
|
||||||
void start(z80dart_device *device, int index, const devcb_read_line &in_rxd, const devcb_write_line &out_txd, const devcb_write_line &out_dtr, const devcb_write_line &out_rts, const devcb_write_line &out_wrdy);
|
void start(z80dart_device *device, int index, const devcb_read_line &in_rxd, const devcb_write_line &out_txd, const devcb_write_line &out_dtr, const devcb_write_line &out_rts, const devcb_write_line &out_wrdy);
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
UINT8 control_read();
|
UINT8 control_read();
|
||||||
void control_write(UINT8 data);
|
void control_write(UINT8 data);
|
||||||
|
|
||||||
UINT8 data_read();
|
UINT8 data_read();
|
||||||
void data_write(UINT8 data);
|
void data_write(UINT8 data);
|
||||||
|
|
||||||
void receive_data(UINT8 data);
|
void receive_data(UINT8 data);
|
||||||
|
|
||||||
void cts_w(int state);
|
void cts_w(int state);
|
||||||
void dcd_w(int state);
|
void dcd_w(int state);
|
||||||
void ri_w(int state);
|
void ri_w(int state);
|
||||||
@ -207,10 +207,10 @@ private:
|
|||||||
static TIMER_CALLBACK( static_rxca_tick ) { reinterpret_cast<dart_channel *>(ptr)->rx_w(1); }
|
static TIMER_CALLBACK( static_rxca_tick ) { reinterpret_cast<dart_channel *>(ptr)->rx_w(1); }
|
||||||
static TIMER_CALLBACK( static_txca_tick ) { reinterpret_cast<dart_channel *>(ptr)->tx_w(1); }
|
static TIMER_CALLBACK( static_txca_tick ) { reinterpret_cast<dart_channel *>(ptr)->tx_w(1); }
|
||||||
static TIMER_CALLBACK( static_rxtxcb_tick ) { reinterpret_cast<dart_channel *>(ptr)->rx_w(1); reinterpret_cast<dart_channel *>(ptr)->tx_w(1); }
|
static TIMER_CALLBACK( static_rxtxcb_tick ) { reinterpret_cast<dart_channel *>(ptr)->rx_w(1); reinterpret_cast<dart_channel *>(ptr)->tx_w(1); }
|
||||||
|
|
||||||
z80dart_device *m_device;
|
z80dart_device *m_device;
|
||||||
int m_index;
|
int m_index;
|
||||||
|
|
||||||
devcb_resolved_read_line m_in_rxd_func;
|
devcb_resolved_read_line m_in_rxd_func;
|
||||||
devcb_resolved_write_line m_out_txd_func;
|
devcb_resolved_write_line m_out_txd_func;
|
||||||
devcb_resolved_write_line m_out_dtr_func;
|
devcb_resolved_write_line m_out_dtr_func;
|
||||||
@ -256,7 +256,7 @@ private:
|
|||||||
// internal state
|
// internal state
|
||||||
const z80dart_device_config & m_config;
|
const z80dart_device_config & m_config;
|
||||||
devcb_resolved_write_line m_out_int_func;
|
devcb_resolved_write_line m_out_int_func;
|
||||||
dart_channel m_channel[2]; // channels
|
dart_channel m_channel[2]; // channels
|
||||||
int m_int_state[8]; // interrupt state
|
int m_int_state[8]; // interrupt state
|
||||||
|
|
||||||
// timers
|
// timers
|
||||||
|
@ -67,8 +67,8 @@ const int TM_SEARCH_TRANSFER = 0x03;
|
|||||||
|
|
||||||
#define LOG 0
|
#define LOG 0
|
||||||
|
|
||||||
#define REGNUM(_m, _s) (((_m)<<3) + (_s))
|
#define REGNUM(_m, _s) (((_m)<<3) + (_s))
|
||||||
#define GET_REGNUM(_r) (&(_r) - &(WR0))
|
#define GET_REGNUM(_r) (&(_r) - &(WR0))
|
||||||
#define REG(_m, _s) m_regs[REGNUM(_m,_s)]
|
#define REG(_m, _s) m_regs[REGNUM(_m,_s)]
|
||||||
#define WR0 REG(0, 0)
|
#define WR0 REG(0, 0)
|
||||||
#define WR1 REG(1, 0)
|
#define WR1 REG(1, 0)
|
||||||
@ -123,7 +123,7 @@ const int TM_SEARCH_TRANSFER = 0x03;
|
|||||||
#define EOB_F_SET (m_status &= ~0x20)
|
#define EOB_F_SET (m_status &= ~0x20)
|
||||||
#define EOB_F_CLEAR (m_status |= 0x20)
|
#define EOB_F_CLEAR (m_status |= 0x20)
|
||||||
|
|
||||||
#define READY_ACTIVE_HIGH ((WR5>>3) & 0x01)
|
#define READY_ACTIVE_HIGH ((WR5>>3) & 0x01)
|
||||||
|
|
||||||
#define INTERRUPT_ENABLE (WR3 & 0x20)
|
#define INTERRUPT_ENABLE (WR3 & 0x20)
|
||||||
#define INT_ON_MATCH (INTERRUPT_CTRL & 0x01)
|
#define INT_ON_MATCH (INTERRUPT_CTRL & 0x01)
|
||||||
@ -170,7 +170,7 @@ device_t *z80dma_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -317,14 +317,14 @@ int z80dma_device::z80daisy_irq_ack()
|
|||||||
if (m_ip)
|
if (m_ip)
|
||||||
{
|
{
|
||||||
if (LOG) logerror("Z80DMA '%s' Interrupt Acknowledge\n", tag());
|
if (LOG) logerror("Z80DMA '%s' Interrupt Acknowledge\n", tag());
|
||||||
|
|
||||||
// clear interrupt pending flag
|
// clear interrupt pending flag
|
||||||
m_ip = 0;
|
m_ip = 0;
|
||||||
interrupt_check();
|
interrupt_check();
|
||||||
|
|
||||||
// set interrupt under service flag
|
// set interrupt under service flag
|
||||||
m_ius = 1;
|
m_ius = 1;
|
||||||
|
|
||||||
// disable DMA
|
// disable DMA
|
||||||
m_dma_enabled = 0;
|
m_dma_enabled = 0;
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ int z80dma_device::z80daisy_irq_ack()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// z80daisy_irq_reti - clear the interrupt
|
// z80daisy_irq_reti - clear the interrupt
|
||||||
// pending state to allow other interrupts through
|
// pending state to allow other interrupts through
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -563,14 +563,14 @@ void z80dma_device::timerproc()
|
|||||||
{
|
{
|
||||||
m_dma_enabled = 0; //FIXME: Correct?
|
m_dma_enabled = 0; //FIXME: Correct?
|
||||||
m_status = 0x19;
|
m_status = 0x19;
|
||||||
|
|
||||||
m_status |= !is_ready() << 1; // ready line status
|
m_status |= !is_ready() << 1; // ready line status
|
||||||
|
|
||||||
if(TRANSFER_MODE == TM_TRANSFER) m_status |= 0x10; // no match found
|
if(TRANSFER_MODE == TM_TRANSFER) m_status |= 0x10; // no match found
|
||||||
|
|
||||||
update_status();
|
update_status();
|
||||||
if (LOG) logerror("Z80DMA '%s' End of Block\n", tag());
|
if (LOG) logerror("Z80DMA '%s' End of Block\n", tag());
|
||||||
|
|
||||||
if (INT_ON_END_OF_BLOCK)
|
if (INT_ON_END_OF_BLOCK)
|
||||||
{
|
{
|
||||||
trigger_interrupt(INT_END_OF_BLOCK);
|
trigger_interrupt(INT_END_OF_BLOCK);
|
||||||
@ -698,7 +698,7 @@ void z80dma_device::write(UINT8 data)
|
|||||||
m_dma_enabled = 0;
|
m_dma_enabled = 0;
|
||||||
|
|
||||||
WR6 = data;
|
WR6 = data;
|
||||||
|
|
||||||
|
|
||||||
switch (data)
|
switch (data)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ struct z80dma_interface
|
|||||||
|
|
||||||
// ======================> z80dma_device_config
|
// ======================> z80dma_device_config
|
||||||
|
|
||||||
class z80dma_device_config : public device_config,
|
class z80dma_device_config : public device_config,
|
||||||
public device_config_z80daisy_interface,
|
public device_config_z80daisy_interface,
|
||||||
public z80dma_interface
|
public z80dma_interface
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ class z80dma_device_config : public device_config,
|
|||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
z80dma_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
z80dma_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// allocators
|
// allocators
|
||||||
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
@ -101,18 +101,18 @@ protected:
|
|||||||
|
|
||||||
// ======================> z80dma_device
|
// ======================> z80dma_device
|
||||||
|
|
||||||
class z80dma_device : public device_t,
|
class z80dma_device : public device_t,
|
||||||
public device_z80daisy_interface
|
public device_z80daisy_interface
|
||||||
{
|
{
|
||||||
friend class z80dma_device_config;
|
friend class z80dma_device_config;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
z80dma_device(running_machine &_machine, const z80dma_device_config &_config);
|
z80dma_device(running_machine &_machine, const z80dma_device_config &_config);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UINT8 read();
|
UINT8 read();
|
||||||
void write(UINT8 data);
|
void write(UINT8 data);
|
||||||
|
|
||||||
void rdy_w(int state);
|
void rdy_w(int state);
|
||||||
void wait_w(int state);
|
void wait_w(int state);
|
||||||
void bai_w(int state);
|
void bai_w(int state);
|
||||||
@ -138,7 +138,7 @@ private:
|
|||||||
void timerproc();
|
void timerproc();
|
||||||
|
|
||||||
void update_status();
|
void update_status();
|
||||||
|
|
||||||
static TIMER_CALLBACK( static_rdy_write_callback ) { reinterpret_cast<z80dma_device *>(ptr)->rdy_write_callback(param); }
|
static TIMER_CALLBACK( static_rdy_write_callback ) { reinterpret_cast<z80dma_device *>(ptr)->rdy_write_callback(param); }
|
||||||
void rdy_write_callback(int state);
|
void rdy_write_callback(int state);
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ private:
|
|||||||
UINT8 m_read_regs_follow[7];
|
UINT8 m_read_regs_follow[7];
|
||||||
UINT8 m_status;
|
UINT8 m_status;
|
||||||
UINT8 m_dma_enabled;
|
UINT8 m_dma_enabled;
|
||||||
|
|
||||||
UINT16 m_addressA;
|
UINT16 m_addressA;
|
||||||
UINT16 m_addressB;
|
UINT16 m_addressB;
|
||||||
UINT16 m_count;
|
UINT16 m_count;
|
||||||
|
@ -82,7 +82,7 @@ device_t *z80pio_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -93,7 +93,7 @@ void z80pio_device_config::device_config_complete()
|
|||||||
const z80pio_interface *intf = reinterpret_cast<const z80pio_interface *>(static_config());
|
const z80pio_interface *intf = reinterpret_cast<const z80pio_interface *>(static_config());
|
||||||
if (intf != NULL)
|
if (intf != NULL)
|
||||||
*static_cast<z80pio_interface *>(this) = *intf;
|
*static_cast<z80pio_interface *>(this) = *intf;
|
||||||
|
|
||||||
// or initialize to defaults if none provided
|
// or initialize to defaults if none provided
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -164,7 +164,7 @@ void z80pio_device::device_reset()
|
|||||||
int z80pio_device::z80daisy_irq_state()
|
int z80pio_device::z80daisy_irq_state()
|
||||||
{
|
{
|
||||||
int state = 0;
|
int state = 0;
|
||||||
|
|
||||||
for (int index = PORT_A; index < PORT_COUNT; index++)
|
for (int index = PORT_A; index < PORT_COUNT; index++)
|
||||||
{
|
{
|
||||||
pio_port &port = m_port[index];
|
pio_port &port = m_port[index];
|
||||||
@ -219,7 +219,7 @@ int z80pio_device::z80daisy_irq_ack()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// z80daisy_irq_reti - clear the interrupt
|
// z80daisy_irq_reti - clear the interrupt
|
||||||
// pending state to allow other interrupts through
|
// pending state to allow other interrupts through
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ UINT8 z80pio_device::control_read()
|
|||||||
void z80pio_device::check_interrupts()
|
void z80pio_device::check_interrupts()
|
||||||
{
|
{
|
||||||
int state = CLEAR_LINE;
|
int state = CLEAR_LINE;
|
||||||
|
|
||||||
for (int index = PORT_A; index < PORT_COUNT; index++)
|
for (int index = PORT_A; index < PORT_COUNT; index++)
|
||||||
if (m_port[index].interrupt_signalled())
|
if (m_port[index].interrupt_signalled())
|
||||||
state = ASSERT_LINE;
|
state = ASSERT_LINE;
|
||||||
@ -318,7 +318,7 @@ void z80pio_device::pio_port::start(z80pio_device *device, int index, const devc
|
|||||||
{
|
{
|
||||||
m_device = device;
|
m_device = device;
|
||||||
m_index = index;
|
m_index = index;
|
||||||
|
|
||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
devcb_resolve_read8(&m_in_p_func, &infunc, m_device);
|
devcb_resolve_read8(&m_in_p_func, &infunc, m_device);
|
||||||
devcb_resolve_write8(&m_out_p_func, &outfunc, m_device);
|
devcb_resolve_write8(&m_out_p_func, &outfunc, m_device);
|
||||||
@ -693,7 +693,7 @@ void z80pio_device::pio_port::control_write(UINT8 data)
|
|||||||
case MASK: // interrupt mask
|
case MASK: // interrupt mask
|
||||||
m_mask = data;
|
m_mask = data;
|
||||||
if (LOG) logerror("Z80PIO '%s' Port %c Mask: %02x\n", m_device->tag(), 'A' + m_index, data);
|
if (LOG) logerror("Z80PIO '%s' Port %c Mask: %02x\n", m_device->tag(), 'A' + m_index, data);
|
||||||
|
|
||||||
// set interrupt enable
|
// set interrupt enable
|
||||||
m_ie = BIT(m_icw, 7) ? true : false;
|
m_ie = BIT(m_icw, 7) ? true : false;
|
||||||
check_interrupts();
|
check_interrupts();
|
||||||
|
@ -73,7 +73,7 @@ struct z80pio_interface
|
|||||||
|
|
||||||
// ======================> z80pio_device_config
|
// ======================> z80pio_device_config
|
||||||
|
|
||||||
class z80pio_device_config : public device_config,
|
class z80pio_device_config : public device_config,
|
||||||
public device_config_z80daisy_interface,
|
public device_config_z80daisy_interface,
|
||||||
public z80pio_interface
|
public z80pio_interface
|
||||||
{
|
{
|
||||||
@ -99,7 +99,7 @@ protected:
|
|||||||
|
|
||||||
// ======================> z80pio_device
|
// ======================> z80pio_device
|
||||||
|
|
||||||
class z80pio_device : public device_t,
|
class z80pio_device : public device_t,
|
||||||
public device_z80daisy_interface
|
public device_z80daisy_interface
|
||||||
{
|
{
|
||||||
friend class z80pio_device_config;
|
friend class z80pio_device_config;
|
||||||
@ -115,7 +115,7 @@ public:
|
|||||||
PORT_COUNT
|
PORT_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
// I/O line access
|
// I/O line access
|
||||||
int rdy(int which) { return m_port[which].rdy(); }
|
int rdy(int which) { return m_port[which].rdy(); }
|
||||||
void strobe(int which, bool state) { m_port[which].strobe(state); }
|
void strobe(int which, bool state) { m_port[which].strobe(state); }
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ private:
|
|||||||
virtual int z80daisy_irq_state();
|
virtual int z80daisy_irq_state();
|
||||||
virtual int z80daisy_irq_ack();
|
virtual int z80daisy_irq_ack();
|
||||||
virtual void z80daisy_irq_reti();
|
virtual void z80daisy_irq_reti();
|
||||||
|
|
||||||
// internal helpers
|
// internal helpers
|
||||||
void check_interrupts();
|
void check_interrupts();
|
||||||
|
|
||||||
@ -148,10 +148,10 @@ private:
|
|||||||
class pio_port
|
class pio_port
|
||||||
{
|
{
|
||||||
friend class z80pio_device;
|
friend class z80pio_device;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
pio_port();
|
pio_port();
|
||||||
|
|
||||||
void start(z80pio_device *device, int index, const devcb_read8 &infunc, const devcb_write8 &outfunc, const devcb_write_line &rdyfunc);
|
void start(z80pio_device *device, int index, const devcb_read8 &infunc, const devcb_write8 &outfunc, const devcb_write_line &rdyfunc);
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
@ -162,21 +162,21 @@ private:
|
|||||||
void set_rdy(bool state);
|
void set_rdy(bool state);
|
||||||
void set_mode(int mode);
|
void set_mode(int mode);
|
||||||
void strobe(bool state);
|
void strobe(bool state);
|
||||||
|
|
||||||
UINT8 read();
|
UINT8 read();
|
||||||
void write(UINT8 data);
|
void write(UINT8 data);
|
||||||
|
|
||||||
void control_write(UINT8 data);
|
void control_write(UINT8 data);
|
||||||
|
|
||||||
UINT8 data_read();
|
UINT8 data_read();
|
||||||
void data_write(UINT8 data);
|
void data_write(UINT8 data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void check_interrupts() { m_device->check_interrupts(); }
|
void check_interrupts() { m_device->check_interrupts(); }
|
||||||
|
|
||||||
z80pio_device * m_device;
|
z80pio_device * m_device;
|
||||||
int m_index;
|
int m_index;
|
||||||
|
|
||||||
devcb_resolved_read8 m_in_p_func;
|
devcb_resolved_read8 m_in_p_func;
|
||||||
devcb_resolved_write8 m_out_p_func;
|
devcb_resolved_write8 m_out_p_func;
|
||||||
devcb_resolved_write_line m_out_rdy_func;
|
devcb_resolved_write_line m_out_rdy_func;
|
||||||
@ -201,7 +201,7 @@ private:
|
|||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
const z80pio_device_config &m_config;
|
const z80pio_device_config &m_config;
|
||||||
pio_port m_port[2];
|
pio_port m_port[2];
|
||||||
devcb_resolved_write_line m_out_int_func;
|
devcb_resolved_write_line m_out_int_func;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ const int SIO_WR4_CLOCK_MODE_x64 = 0xc0; // 11 = x64 clock mode
|
|||||||
const int SIO_WR4_SYNC_MODE_MASK = 0x30; // D5-D4 = Sync mode
|
const int SIO_WR4_SYNC_MODE_MASK = 0x30; // D5-D4 = Sync mode
|
||||||
const int SIO_WR4_SYNC_MODE_8BIT = 0x00; // 00 = 8 bit sync character
|
const int SIO_WR4_SYNC_MODE_8BIT = 0x00; // 00 = 8 bit sync character
|
||||||
const int SIO_WR4_SYNC_MODE_16BIT = 0x10; // 01 = 16 bit sync character
|
const int SIO_WR4_SYNC_MODE_16BIT = 0x10; // 01 = 16 bit sync character
|
||||||
const int SIO_WR4_SYNC_MODE_SDLC = 0x20; // 10 = SDLC mode (01111110 flag)
|
const int SIO_WR4_SYNC_MODE_SDLC = 0x20; // 10 = SDLC mode (01111110 flag)
|
||||||
const int SIO_WR4_SYNC_MODE_EXTERNAL = 0x30; // 11 = External sync mode
|
const int SIO_WR4_SYNC_MODE_EXTERNAL = 0x30; // 11 = External sync mode
|
||||||
const int SIO_WR4_STOPBITS_MASK = 0x0c; // D3-D2 = Stop bits
|
const int SIO_WR4_STOPBITS_MASK = 0x0c; // D3-D2 = Stop bits
|
||||||
const int SIO_WR4_STOPBITS_SYNC = 0x00; // 00 = Sync modes enable
|
const int SIO_WR4_STOPBITS_SYNC = 0x00; // 00 = Sync modes enable
|
||||||
@ -121,7 +121,7 @@ const int SIO_WR5_CRC16_SDLC = 0x04; // D2 = CRC-16/SDLC
|
|||||||
const int SIO_WR5_RTS = 0x02; // D1 = RTS
|
const int SIO_WR5_RTS = 0x02; // D1 = RTS
|
||||||
const int SIO_WR5_TX_CRC_ENABLE = 0x01; // D0 = Tx CRC enable
|
const int SIO_WR5_TX_CRC_ENABLE = 0x01; // D0 = Tx CRC enable
|
||||||
|
|
||||||
// SIO write register 6
|
// SIO write register 6
|
||||||
const int SIO_WR6_SYNC_7_0_MASK = 0xff; // D7-D0 = Sync bits 7-0
|
const int SIO_WR6_SYNC_7_0_MASK = 0xff; // D7-D0 = Sync bits 7-0
|
||||||
|
|
||||||
// SIO write register 7
|
// SIO write register 7
|
||||||
@ -260,8 +260,8 @@ inline void z80sio_device::sio_channel::set_interrupt(int type)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// clear_interrupt - clear the given interrupt
|
// clear_interrupt - clear the given interrupt
|
||||||
// state on this channel and update the overall
|
// state on this channel and update the overall
|
||||||
// device state
|
// device state
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ device_t *z80sio_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -334,7 +334,7 @@ void z80sio_device_config::device_config_complete()
|
|||||||
const z80sio_interface *intf = reinterpret_cast<const z80sio_interface *>(static_config());
|
const z80sio_interface *intf = reinterpret_cast<const z80sio_interface *>(static_config());
|
||||||
if (intf != NULL)
|
if (intf != NULL)
|
||||||
*static_cast<z80sio_interface *>(this) = *intf;
|
*static_cast<z80sio_interface *>(this) = *intf;
|
||||||
|
|
||||||
// or initialize to defaults if none provided
|
// or initialize to defaults if none provided
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -454,7 +454,7 @@ int z80sio_device::z80daisy_irq_ack()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// z80daisy_irq_reti - clear the interrupt
|
// z80daisy_irq_reti - clear the interrupt
|
||||||
// pending state to allow other interrupts through
|
// pending state to allow other interrupts through
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ struct z80sio_interface
|
|||||||
|
|
||||||
// ======================> z80sio_device_config
|
// ======================> z80sio_device_config
|
||||||
|
|
||||||
class z80sio_device_config : public device_config,
|
class z80sio_device_config : public device_config,
|
||||||
public device_config_z80daisy_interface,
|
public device_config_z80daisy_interface,
|
||||||
public z80sio_interface
|
public z80sio_interface
|
||||||
{
|
{
|
||||||
@ -57,7 +57,7 @@ public:
|
|||||||
// allocators
|
// allocators
|
||||||
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
virtual device_t *alloc_device(running_machine &machine) const;
|
virtual device_t *alloc_device(running_machine &machine) const;
|
||||||
|
|
||||||
// basic information getters
|
// basic information getters
|
||||||
virtual const char *name() const { return "Zilog Z80 SIO"; }
|
virtual const char *name() const { return "Zilog Z80 SIO"; }
|
||||||
|
|
||||||
@ -70,16 +70,16 @@ protected:
|
|||||||
|
|
||||||
// ======================> z80sio_device
|
// ======================> z80sio_device
|
||||||
|
|
||||||
class z80sio_device : public device_t,
|
class z80sio_device : public device_t,
|
||||||
public device_z80daisy_interface
|
public device_z80daisy_interface
|
||||||
{
|
{
|
||||||
friend class z80sio_device_config;
|
friend class z80sio_device_config;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
z80sio_device(running_machine &_machine, const z80sio_device_config &config);
|
z80sio_device(running_machine &_machine, const z80sio_device_config &config);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// control register I/O
|
// control register I/O
|
||||||
UINT8 control_read(int ch) { return m_channel[ch].control_read(); }
|
UINT8 control_read(int ch) { return m_channel[ch].control_read(); }
|
||||||
void control_write(int ch, UINT8 data) { m_channel[ch].control_write(data); }
|
void control_write(int ch, UINT8 data) { m_channel[ch].control_write(data); }
|
||||||
|
|
||||||
@ -112,21 +112,21 @@ private:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
sio_channel();
|
sio_channel();
|
||||||
|
|
||||||
void start(z80sio_device *device, int index);
|
void start(z80sio_device *device, int index);
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
UINT8 control_read();
|
UINT8 control_read();
|
||||||
UINT8 data_read();
|
UINT8 data_read();
|
||||||
void control_write(UINT8 data);
|
void control_write(UINT8 data);
|
||||||
void data_write(UINT8 data);
|
void data_write(UINT8 data);
|
||||||
|
|
||||||
int dtr();
|
int dtr();
|
||||||
int rts();
|
int rts();
|
||||||
void set_cts(int state);
|
void set_cts(int state);
|
||||||
void set_dcd(int state);
|
void set_dcd(int state);
|
||||||
void receive_data(int data);
|
void receive_data(int data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_interrupt(int type);
|
void set_interrupt(int type);
|
||||||
void clear_interrupt(int type);
|
void clear_interrupt(int type);
|
||||||
@ -153,7 +153,7 @@ private:
|
|||||||
UINT8 m_receive_inptr; // index of data coming in
|
UINT8 m_receive_inptr; // index of data coming in
|
||||||
UINT8 m_receive_outptr; // index of data going out
|
UINT8 m_receive_outptr; // index of data going out
|
||||||
};
|
};
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
const z80sio_device_config &m_config;
|
const z80sio_device_config &m_config;
|
||||||
sio_channel m_channel[2]; // 2 channels
|
sio_channel m_channel[2]; // 2 channels
|
||||||
|
@ -172,7 +172,7 @@ device_t *z80sti_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -183,7 +183,7 @@ void z80sti_device_config::device_config_complete()
|
|||||||
const z80sti_interface *intf = reinterpret_cast<const z80sti_interface *>(static_config());
|
const z80sti_interface *intf = reinterpret_cast<const z80sti_interface *>(static_config());
|
||||||
if (intf != NULL)
|
if (intf != NULL)
|
||||||
*static_cast<z80sti_interface *>(this) = *intf;
|
*static_cast<z80sti_interface *>(this) = *intf;
|
||||||
|
|
||||||
// or initialize to defaults if none provided
|
// or initialize to defaults if none provided
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ struct z80sti_interface
|
|||||||
|
|
||||||
// ======================> z80sti_device_config
|
// ======================> z80sti_device_config
|
||||||
|
|
||||||
class z80sti_device_config : public device_config,
|
class z80sti_device_config : public device_config,
|
||||||
public device_config_z80daisy_interface,
|
public device_config_z80daisy_interface,
|
||||||
public z80sti_interface
|
public z80sti_interface
|
||||||
{
|
{
|
||||||
@ -105,7 +105,7 @@ public:
|
|||||||
// allocators
|
// allocators
|
||||||
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
virtual device_t *alloc_device(running_machine &machine) const;
|
virtual device_t *alloc_device(running_machine &machine) const;
|
||||||
|
|
||||||
// basic information getters
|
// basic information getters
|
||||||
virtual const char *name() const { return "Mostek MK3801"; }
|
virtual const char *name() const { return "Mostek MK3801"; }
|
||||||
|
|
||||||
@ -118,24 +118,24 @@ protected:
|
|||||||
|
|
||||||
// ======================> z80sti_device
|
// ======================> z80sti_device
|
||||||
|
|
||||||
class z80sti_device : public device_t,
|
class z80sti_device : public device_t,
|
||||||
public device_z80daisy_interface
|
public device_z80daisy_interface
|
||||||
{
|
{
|
||||||
friend class z80sti_device_config;
|
friend class z80sti_device_config;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
z80sti_device(running_machine &_machine, const z80sti_device_config &config);
|
z80sti_device(running_machine &_machine, const z80sti_device_config &config);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// I/O accessors
|
// I/O accessors
|
||||||
UINT8 read(offs_t offset);
|
UINT8 read(offs_t offset);
|
||||||
void write(offs_t offset, UINT8 data);
|
void write(offs_t offset, UINT8 data);
|
||||||
|
|
||||||
// communication I/O
|
// communication I/O
|
||||||
void serial_receive();
|
void serial_receive();
|
||||||
void serial_transmit();
|
void serial_transmit();
|
||||||
void gpip_input(int bit, int state);
|
void gpip_input(int bit, int state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
@ -159,7 +159,7 @@ private:
|
|||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
const z80sti_device_config &m_config;
|
const z80sti_device_config &m_config;
|
||||||
|
|
||||||
// device callbacks
|
// device callbacks
|
||||||
devcb_resolved_read8 m_in_gpio_func;
|
devcb_resolved_read8 m_in_gpio_func;
|
||||||
devcb_resolved_write8 m_out_gpio_func;
|
devcb_resolved_write8 m_out_gpio_func;
|
||||||
|
@ -280,7 +280,7 @@ int mame_execute(core_options *options)
|
|||||||
/* load the configuration settings and NVRAM */
|
/* load the configuration settings and NVRAM */
|
||||||
settingsloaded = config_load_settings(machine);
|
settingsloaded = config_load_settings(machine);
|
||||||
nvram_load(machine);
|
nvram_load(machine);
|
||||||
sound_mute(machine, FALSE);
|
sound_mute(machine, FALSE);
|
||||||
|
|
||||||
/* display the startup screens */
|
/* display the startup screens */
|
||||||
ui_display_startup_screens(machine, firstrun, !settingsloaded);
|
ui_display_startup_screens(machine, firstrun, !settingsloaded);
|
||||||
@ -1335,7 +1335,7 @@ running_machine::~running_machine()
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// describe_context - return a string describing
|
// describe_context - return a string describing
|
||||||
// which device is currently executing and its
|
// which device is currently executing and its
|
||||||
// PC
|
// PC
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ typedef void (*output_callback_func)(void *param, const char *format, va_list ar
|
|||||||
class region_info
|
class region_info
|
||||||
{
|
{
|
||||||
DISABLE_COPYING(region_info);
|
DISABLE_COPYING(region_info);
|
||||||
|
|
||||||
running_machine * machine;
|
running_machine * machine;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -267,7 +267,7 @@ public:
|
|||||||
|
|
||||||
/* UI-related */
|
/* UI-related */
|
||||||
bool ui_active; /* ui active or not (useful for games / systems with keyboard inputs) */
|
bool ui_active; /* ui active or not (useful for games / systems with keyboard inputs) */
|
||||||
|
|
||||||
/* generic pointers */
|
/* generic pointers */
|
||||||
generic_pointers generic; /* generic pointers */
|
generic_pointers generic; /* generic pointers */
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ machine_config *machine_config_alloc(const machine_config_token *tokens)
|
|||||||
if (tokens != NULL)
|
if (tokens != NULL)
|
||||||
machine_config_detokenize(config, tokens, device);
|
machine_config_detokenize(config, tokens, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
// then notify all devices that their configuration is complete
|
// then notify all devices that their configuration is complete
|
||||||
for (device_config *device = config->devicelist.first(); device != NULL; device = device->next())
|
for (device_config *device = config->devicelist.first(); device != NULL; device = device->next())
|
||||||
device->config_complete();
|
device->config_complete();
|
||||||
|
@ -133,7 +133,7 @@ enum
|
|||||||
|
|
||||||
MCONFIG_TOKEN_SOUND_START,
|
MCONFIG_TOKEN_SOUND_START,
|
||||||
MCONFIG_TOKEN_SOUND_RESET,
|
MCONFIG_TOKEN_SOUND_RESET,
|
||||||
|
|
||||||
MCONFIG_TOKEN_DEVICE_ADD,
|
MCONFIG_TOKEN_DEVICE_ADD,
|
||||||
MCONFIG_TOKEN_DEVICE_REPLACE,
|
MCONFIG_TOKEN_DEVICE_REPLACE,
|
||||||
MCONFIG_TOKEN_DEVICE_REMOVE,
|
MCONFIG_TOKEN_DEVICE_REMOVE,
|
||||||
@ -145,7 +145,7 @@ enum
|
|||||||
MCONFIG_TOKEN_DEVICE_INLINE_DATA16,
|
MCONFIG_TOKEN_DEVICE_INLINE_DATA16,
|
||||||
MCONFIG_TOKEN_DEVICE_INLINE_DATA32,
|
MCONFIG_TOKEN_DEVICE_INLINE_DATA32,
|
||||||
MCONFIG_TOKEN_DEVICE_INLINE_DATA64,
|
MCONFIG_TOKEN_DEVICE_INLINE_DATA64,
|
||||||
|
|
||||||
// execute interface-specific tokens
|
// execute interface-specific tokens
|
||||||
MCONFIG_TOKEN_DIEXEC_DISABLE,
|
MCONFIG_TOKEN_DIEXEC_DISABLE,
|
||||||
MCONFIG_TOKEN_DIEXEC_VBLANK_INT,
|
MCONFIG_TOKEN_DIEXEC_VBLANK_INT,
|
||||||
|
@ -128,8 +128,8 @@ if (TEMPLOG)
|
|||||||
printf("Timeslice loop: basetime=%15.6f\n", attotime_to_double(timerexec->basetime));
|
printf("Timeslice loop: basetime=%15.6f\n", attotime_to_double(timerexec->basetime));
|
||||||
timer_print_first_timer(&m_machine);
|
timer_print_first_timer(&m_machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// by default, assume our target is the end of the next quantum
|
// by default, assume our target is the end of the next quantum
|
||||||
attotime target;
|
attotime target;
|
||||||
target.seconds = timerexec->basetime.seconds;
|
target.seconds = timerexec->basetime.seconds;
|
||||||
@ -297,11 +297,11 @@ void device_scheduler::trigger(int trigid, attotime after)
|
|||||||
// ensure we have a list of executing devices
|
// ensure we have a list of executing devices
|
||||||
if (m_execute_list == NULL)
|
if (m_execute_list == NULL)
|
||||||
rebuild_execute_list();
|
rebuild_execute_list();
|
||||||
|
|
||||||
// if we have a non-zero time, schedule a timer
|
// if we have a non-zero time, schedule a timer
|
||||||
if (after.attoseconds != 0 || after.seconds != 0)
|
if (after.attoseconds != 0 || after.seconds != 0)
|
||||||
timer_set(&m_machine, after, (void *)this, trigid, static_timed_trigger);
|
timer_set(&m_machine, after, (void *)this, trigid, static_timed_trigger);
|
||||||
|
|
||||||
// send the trigger to everyone who cares
|
// send the trigger to everyone who cares
|
||||||
else
|
else
|
||||||
for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec)
|
for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec)
|
||||||
@ -310,7 +310,7 @@ void device_scheduler::trigger(int trigid, attotime after)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// static_timed_trigger - generate a trigger
|
// static_timed_trigger - generate a trigger
|
||||||
// after a given amount of time
|
// after a given amount of time
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ void device_scheduler::compute_perfect_interleave()
|
|||||||
if (m_execute_list == NULL)
|
if (m_execute_list == NULL)
|
||||||
rebuild_execute_list();
|
rebuild_execute_list();
|
||||||
|
|
||||||
// start with the first one
|
// start with the first one
|
||||||
device_execute_interface *first = m_execute_list;
|
device_execute_interface *first = m_execute_list;
|
||||||
if (first != NULL)
|
if (first != NULL)
|
||||||
{
|
{
|
||||||
@ -374,7 +374,7 @@ void device_scheduler::rebuild_execute_list()
|
|||||||
{
|
{
|
||||||
// set the core scheduling quantum
|
// set the core scheduling quantum
|
||||||
attotime min_quantum = m_machine.config->minimum_quantum;
|
attotime min_quantum = m_machine.config->minimum_quantum;
|
||||||
|
|
||||||
// if none specified default to 60Hz
|
// if none specified default to 60Hz
|
||||||
if (attotime_compare(min_quantum, attotime_zero) == 0)
|
if (attotime_compare(min_quantum, attotime_zero) == 0)
|
||||||
min_quantum = ATTOTIME_IN_HZ(60);
|
min_quantum = ATTOTIME_IN_HZ(60);
|
||||||
@ -385,7 +385,7 @@ void device_scheduler::rebuild_execute_list()
|
|||||||
device_t *device = m_machine.device(m_machine.config->perfect_cpu_quantum);
|
device_t *device = m_machine.device(m_machine.config->perfect_cpu_quantum);
|
||||||
if (device == NULL)
|
if (device == NULL)
|
||||||
fatalerror("Device '%s' specified for perfect interleave is not present!", m_machine.config->perfect_cpu_quantum);
|
fatalerror("Device '%s' specified for perfect interleave is not present!", m_machine.config->perfect_cpu_quantum);
|
||||||
|
|
||||||
device_execute_interface *exec;
|
device_execute_interface *exec;
|
||||||
if (!device->interface(exec))
|
if (!device->interface(exec))
|
||||||
fatalerror("Device '%s' specified for perfect interleave is not an executing device!", m_machine.config->perfect_cpu_quantum);
|
fatalerror("Device '%s' specified for perfect interleave is not an executing device!", m_machine.config->perfect_cpu_quantum);
|
||||||
@ -393,7 +393,7 @@ void device_scheduler::rebuild_execute_list()
|
|||||||
attotime cpu_quantum = attotime_make(0, exec->minimum_quantum());
|
attotime cpu_quantum = attotime_make(0, exec->minimum_quantum());
|
||||||
min_quantum = attotime_min(cpu_quantum, min_quantum);
|
min_quantum = attotime_min(cpu_quantum, min_quantum);
|
||||||
}
|
}
|
||||||
|
|
||||||
// inform the timer system of our decision
|
// inform the timer system of our decision
|
||||||
assert(min_quantum.seconds == 0);
|
assert(min_quantum.seconds == 0);
|
||||||
timer_add_scheduling_quantum(&m_machine, min_quantum.attoseconds, attotime_never);
|
timer_add_scheduling_quantum(&m_machine, min_quantum.attoseconds, attotime_never);
|
||||||
@ -404,7 +404,7 @@ if (TEMPLOG) printf("Setting quantum: %08X%08X\n", (UINT32)(min_quantum.attoseco
|
|||||||
// start with an empty list
|
// start with an empty list
|
||||||
device_execute_interface **active_tailptr = &m_execute_list;
|
device_execute_interface **active_tailptr = &m_execute_list;
|
||||||
*active_tailptr = NULL;
|
*active_tailptr = NULL;
|
||||||
|
|
||||||
// also make an empty list of suspended devices
|
// also make an empty list of suspended devices
|
||||||
device_execute_interface *suspend_list = NULL;
|
device_execute_interface *suspend_list = NULL;
|
||||||
device_execute_interface **suspend_tailptr = &suspend_list;
|
device_execute_interface **suspend_tailptr = &suspend_list;
|
||||||
@ -426,7 +426,7 @@ if (TEMPLOG) printf("Setting quantum: %08X%08X\n", (UINT32)(min_quantum.attoseco
|
|||||||
suspend_tailptr = &exec->m_nextexec;
|
suspend_tailptr = &exec->m_nextexec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// append the suspend list to the end of the active list
|
// append the suspend list to the end of the active list
|
||||||
*active_tailptr = suspend_list;
|
*active_tailptr = suspend_list;
|
||||||
if (TEMPLOG)
|
if (TEMPLOG)
|
||||||
|
@ -68,15 +68,15 @@
|
|||||||
class device_scheduler
|
class device_scheduler
|
||||||
{
|
{
|
||||||
friend class device_execute_interface;
|
friend class device_execute_interface;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
device_scheduler(running_machine &machine);
|
device_scheduler(running_machine &machine);
|
||||||
~device_scheduler();
|
~device_scheduler();
|
||||||
|
|
||||||
void timeslice();
|
void timeslice();
|
||||||
|
|
||||||
void trigger(int trigid, attotime after = attotime_zero);
|
void trigger(int trigid, attotime after = attotime_zero);
|
||||||
|
|
||||||
void boost_interleave(attotime timeslice_time, attotime boost_duration);
|
void boost_interleave(attotime timeslice_time, attotime boost_duration);
|
||||||
void abort_timeslice();
|
void abort_timeslice();
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ public:
|
|||||||
|
|
||||||
// for timer system only!
|
// for timer system only!
|
||||||
attotime override_local_time(attotime default_time);
|
attotime override_local_time(attotime default_time);
|
||||||
|
|
||||||
// for emergencies only!
|
// for emergencies only!
|
||||||
void eat_all_cycles();
|
void eat_all_cycles();
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ static void route_sound(running_machine *machine)
|
|||||||
device_t *target_device = machine->device(route->m_target);
|
device_t *target_device = machine->device(route->m_target);
|
||||||
if (target_device->type() == SPEAKER)
|
if (target_device->type() == SPEAKER)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int inputnum = route->m_input;
|
int inputnum = route->m_input;
|
||||||
|
|
||||||
/* iterate over all outputs, matching any that apply */
|
/* iterate over all outputs, matching any that apply */
|
||||||
@ -491,7 +491,7 @@ device_t *speaker_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -566,20 +566,20 @@ void speaker_device::device_start()
|
|||||||
// if the sound device is not yet started, bail however -- we need the its stream
|
// if the sound device is not yet started, bail however -- we need the its stream
|
||||||
if (!sound->device().started())
|
if (!sound->device().started())
|
||||||
throw device_missing_dependencies();
|
throw device_missing_dependencies();
|
||||||
|
|
||||||
// accumulate inputs
|
// accumulate inputs
|
||||||
inputs += (route->m_output == ALL_OUTPUTS) ? stream_get_device_outputs(*sound) : 1;
|
inputs += (route->m_output == ALL_OUTPUTS) ? stream_get_device_outputs(*sound) : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// no inputs? that's weird
|
// no inputs? that's weird
|
||||||
if (inputs == 0)
|
if (inputs == 0)
|
||||||
{
|
{
|
||||||
logerror("Warning: speaker \"%s\" has no inputs\n", tag());
|
logerror("Warning: speaker \"%s\" has no inputs\n", tag());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we know how many inputs; allocate the mixers and input data
|
// now we know how many inputs; allocate the mixers and input data
|
||||||
m_mixer_stream = stream_create(this, inputs, 1, machine->sample_rate, NULL, static_mixer_update);
|
m_mixer_stream = stream_create(this, inputs, 1, machine->sample_rate, NULL, static_mixer_update);
|
||||||
m_input = auto_alloc_array(machine, speaker_input, inputs);
|
m_input = auto_alloc_array(machine, speaker_input, inputs);
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
|
|
||||||
// basic information getters
|
// basic information getters
|
||||||
virtual const char *name() const { return "Speaker"; }
|
virtual const char *name() const { return "Speaker"; }
|
||||||
|
|
||||||
// indexes to inline data
|
// indexes to inline data
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ public:
|
|||||||
INLINE_Y,
|
INLINE_Y,
|
||||||
INLINE_Z
|
INLINE_Z
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device_config overrides
|
// device_config overrides
|
||||||
virtual void device_config_complete();
|
virtual void device_config_complete();
|
||||||
@ -78,13 +78,13 @@ class speaker_device : public device_t
|
|||||||
{
|
{
|
||||||
friend class speaker_device_config;
|
friend class speaker_device_config;
|
||||||
friend resource_pool_object<speaker_device>::~resource_pool_object();
|
friend resource_pool_object<speaker_device>::~resource_pool_object();
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
speaker_device(running_machine &_machine, const speaker_device_config &config);
|
speaker_device(running_machine &_machine, const speaker_device_config &config);
|
||||||
virtual ~speaker_device();
|
virtual ~speaker_device();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// input properties
|
// input properties
|
||||||
int inputs() const { return m_inputs; }
|
int inputs() const { return m_inputs; }
|
||||||
float input_gain(int index = 0) const { return m_input[index].m_gain; }
|
float input_gain(int index = 0) const { return m_input[index].m_gain; }
|
||||||
float input_default_gain(int index = 0) const { return m_input[index].m_default_gain; }
|
float input_default_gain(int index = 0) const { return m_input[index].m_default_gain; }
|
||||||
|
@ -4212,7 +4212,7 @@ void ym2610_reset_chip(void *chip)
|
|||||||
|
|
||||||
astring name;
|
astring name;
|
||||||
running_device* dev = F2610->OPN.ST.device;
|
running_device* dev = F2610->OPN.ST.device;
|
||||||
|
|
||||||
/* setup PCM buffers again */
|
/* setup PCM buffers again */
|
||||||
name.printf("%s",dev->tag());
|
name.printf("%s",dev->tag());
|
||||||
F2610->pcmbuf = (const UINT8 *)memory_region(dev->machine,name);
|
F2610->pcmbuf = (const UINT8 *)memory_region(dev->machine,name);
|
||||||
|
@ -6,32 +6,32 @@
|
|||||||
|
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
|
|
||||||
Library to transcode from an ADPCM source to raw PCM.
|
Library to transcode from an ADPCM source to raw PCM.
|
||||||
Written by Buffoni Mirko in 08/06/97
|
Written by Buffoni Mirko in 08/06/97
|
||||||
References: various sources and documents.
|
References: various sources and documents.
|
||||||
|
|
||||||
R. Belmont 31/10/2003
|
R. Belmont 31/10/2003
|
||||||
Updated to allow a driver to use both MSM6295s and "raw" ADPCM voices
|
Updated to allow a driver to use both MSM6295s and "raw" ADPCM voices
|
||||||
(gcpinbal). Also added some error trapping for MAME_DEBUG builds
|
(gcpinbal). Also added some error trapping for MAME_DEBUG builds
|
||||||
|
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
|
|
||||||
OKIM 6295 ADPCM chip:
|
OKIM 6295 ADPCM chip:
|
||||||
|
|
||||||
Command bytes are sent:
|
Command bytes are sent:
|
||||||
|
|
||||||
1xxx xxxx = start of 2-byte command sequence, xxxxxxx is the sample
|
1xxx xxxx = start of 2-byte command sequence, xxxxxxx is the sample
|
||||||
number to trigger
|
number to trigger
|
||||||
abcd vvvv = second half of command; one of the abcd bits is set to
|
abcd vvvv = second half of command; one of the abcd bits is set to
|
||||||
indicate which voice the v bits seem to be volumed
|
indicate which voice the v bits seem to be volumed
|
||||||
|
|
||||||
0abc d000 = stop playing; one or more of the abcd bits is set to
|
0abc d000 = stop playing; one or more of the abcd bits is set to
|
||||||
indicate which voice(s)
|
indicate which voice(s)
|
||||||
|
|
||||||
Status is read:
|
Status is read:
|
||||||
|
|
||||||
???? abcd = one bit per voice, set to 0 if nothing is playing, or
|
???? abcd = one bit per voice, set to 0 if nothing is playing, or
|
||||||
1 if it is active
|
1 if it is active
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ device_t *okim6295_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -131,7 +131,7 @@ void okim6295_device_config::device_config_complete()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// memory_space_config - return a description of
|
// memory_space_config - return a description of
|
||||||
// any address spaces owned by this device
|
// any address spaces owned by this device
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ void okim6295_device::data_write(UINT8 data)
|
|||||||
else
|
else
|
||||||
logerror("OKIM6295:'%s' requested to play sample %02x on non-stopped voice\n",tag(),m_command);
|
logerror("OKIM6295:'%s' requested to play sample %02x on non-stopped voice\n",tag(),m_command);
|
||||||
}
|
}
|
||||||
|
|
||||||
// invalid samples go here
|
// invalid samples go here
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@ class adpcm_state
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
adpcm_state() { compute_tables(); reset(); }
|
adpcm_state() { compute_tables(); reset(); }
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
INT16 clock(UINT8 nibble);
|
INT16 clock(UINT8 nibble);
|
||||||
|
|
||||||
@ -75,15 +75,15 @@ private:
|
|||||||
|
|
||||||
// ======================> okim6295_device_config
|
// ======================> okim6295_device_config
|
||||||
|
|
||||||
class okim6295_device_config : public device_config,
|
class okim6295_device_config : public device_config,
|
||||||
public device_config_sound_interface,
|
public device_config_sound_interface,
|
||||||
public device_config_memory_interface
|
public device_config_memory_interface
|
||||||
{
|
{
|
||||||
friend class okim6295_device;
|
friend class okim6295_device;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
okim6295_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
okim6295_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// allocators
|
// allocators
|
||||||
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
// basic information getters
|
// basic information getters
|
||||||
virtual const char *name() const { return "OKI6295"; }
|
virtual const char *name() const { return "OKI6295"; }
|
||||||
|
|
||||||
// inline configuration indexes
|
// inline configuration indexes
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -105,29 +105,29 @@ protected:
|
|||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
const address_space_config m_space_config;
|
const address_space_config m_space_config;
|
||||||
UINT8 m_pin7;
|
UINT8 m_pin7;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ======================> okim6295_device
|
// ======================> okim6295_device
|
||||||
|
|
||||||
class okim6295_device : public device_t,
|
class okim6295_device : public device_t,
|
||||||
public device_sound_interface,
|
public device_sound_interface,
|
||||||
public device_memory_interface
|
public device_memory_interface
|
||||||
{
|
{
|
||||||
friend class okim6295_device_config;
|
friend class okim6295_device_config;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
okim6295_device(running_machine &_machine, const okim6295_device_config &config);
|
okim6295_device(running_machine &_machine, const okim6295_device_config &config);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_bank_base(offs_t base);
|
void set_bank_base(offs_t base);
|
||||||
void set_pin7(int pin7);
|
void set_pin7(int pin7);
|
||||||
|
|
||||||
UINT8 status_read();
|
UINT8 status_read();
|
||||||
void data_write(UINT8 data);
|
void data_write(UINT8 data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
@ -147,11 +147,11 @@ protected:
|
|||||||
void generate_adpcm(const address_space *space, stream_sample_t *buffer, int samples);
|
void generate_adpcm(const address_space *space, stream_sample_t *buffer, int samples);
|
||||||
|
|
||||||
adpcm_state m_adpcm; // current ADPCM state
|
adpcm_state m_adpcm; // current ADPCM state
|
||||||
bool m_playing;
|
bool m_playing;
|
||||||
offs_t m_base_offset; // pointer to the base memory location
|
offs_t m_base_offset; // pointer to the base memory location
|
||||||
UINT32 m_sample; // current sample number
|
UINT32 m_sample; // current sample number
|
||||||
UINT32 m_count; // total samples to play
|
UINT32 m_count; // total samples to play
|
||||||
INT8 m_volume; // output volume
|
INT8 m_volume; // output volume
|
||||||
};
|
};
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
@ -159,10 +159,10 @@ protected:
|
|||||||
|
|
||||||
const okim6295_device_config &m_config;
|
const okim6295_device_config &m_config;
|
||||||
|
|
||||||
okim_voice m_voice[OKIM6295_VOICES];
|
okim_voice m_voice[OKIM6295_VOICES];
|
||||||
INT32 m_command;
|
INT32 m_command;
|
||||||
bool m_bank_installed;
|
bool m_bank_installed;
|
||||||
offs_t m_bank_offs;
|
offs_t m_bank_offs;
|
||||||
sound_stream * m_stream;
|
sound_stream * m_stream;
|
||||||
UINT8 m_pin7_state;
|
UINT8 m_pin7_state;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "devlegcy.h"
|
#include "devlegcy.h"
|
||||||
|
|
||||||
int s14001a_bsy_r(running_device *device); /* read BUSY pin */
|
int s14001a_bsy_r(running_device *device); /* read BUSY pin */
|
||||||
void s14001a_reg_w(running_device *device, int data); /* write to input latch */
|
void s14001a_reg_w(running_device *device, int data); /* write to input latch */
|
||||||
void s14001a_rst_w(running_device *device, int data); /* write to RESET pin */
|
void s14001a_rst_w(running_device *device, int data); /* write to RESET pin */
|
||||||
void s14001a_set_clock(running_device *device, int clock); /* set VSU-1000 clock */
|
void s14001a_set_clock(running_device *device, int clock); /* set VSU-1000 clock */
|
||||||
|
@ -1132,8 +1132,8 @@ static DEVICE_RESET( tms5110 )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* no dummy read! This makes bagman and ad2083 speech fail
|
/* no dummy read! This makes bagman and ad2083 speech fail
|
||||||
* with the new cycle and transition exact interfaces
|
* with the new cycle and transition exact interfaces
|
||||||
*/
|
*/
|
||||||
tms->schedule_dummy_read = FALSE;
|
tms->schedule_dummy_read = FALSE;
|
||||||
}
|
}
|
||||||
tms->addr_bit = 0;
|
tms->addr_bit = 0;
|
||||||
@ -1480,14 +1480,14 @@ WRITE_LINE_DEVICE_HANDLER( tmsprom_enable_w )
|
|||||||
update_prom_cnt(tms);
|
update_prom_cnt(tms);
|
||||||
|
|
||||||
/* the following is needed for ad2084.
|
/* the following is needed for ad2084.
|
||||||
* It is difficult to derive the actual connections from
|
* It is difficult to derive the actual connections from
|
||||||
* pcb pictures but the reset pin of the LS393 driving
|
* pcb pictures but the reset pin of the LS393 driving
|
||||||
* the prom address line is connected somewhere.
|
* the prom address line is connected somewhere.
|
||||||
*
|
*
|
||||||
* This does not affect bagman. It just simulates that a
|
* This does not affect bagman. It just simulates that a
|
||||||
* write to ads3 is always happening when the four lower
|
* write to ads3 is always happening when the four lower
|
||||||
* counter bits are 0!
|
* counter bits are 0!
|
||||||
*/
|
*/
|
||||||
if (state)
|
if (state)
|
||||||
tms->prom_cnt &= 0x10;
|
tms->prom_cnt &= 0x10;
|
||||||
}
|
}
|
||||||
|
@ -1652,15 +1652,15 @@ WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w )
|
|||||||
tms->io_ready = 0;
|
tms->io_ready = 0;
|
||||||
update_ready_state(tms);
|
update_ready_state(tms);
|
||||||
/* Now comes the complicated part: long does /READY stay inactive, when /WS is pulled low? This depends ENTIRELY on the command written, or whether the chip is in speak external mode or not...
|
/* Now comes the complicated part: long does /READY stay inactive, when /WS is pulled low? This depends ENTIRELY on the command written, or whether the chip is in speak external mode or not...
|
||||||
Speak external mode: ~16 cycles
|
Speak external mode: ~16 cycles
|
||||||
Command Mode:
|
Command Mode:
|
||||||
SPK: ? cycles
|
SPK: ? cycles
|
||||||
SPKEXT: ? cycles
|
SPKEXT: ? cycles
|
||||||
RDBY: between 60 and 140 cycles
|
RDBY: between 60 and 140 cycles
|
||||||
RB: ? cycles (80?)
|
RB: ? cycles (80?)
|
||||||
RST: between 60 and 140 cycles
|
RST: between 60 and 140 cycles
|
||||||
SET RATE (5220C only): ? cycles (probably ~16)
|
SET RATE (5220C only): ? cycles (probably ~16)
|
||||||
*/
|
*/
|
||||||
// TODO: actually HANDLE the timing differences! currently just assuming always 16 cycles
|
// TODO: actually HANDLE the timing differences! currently just assuming always 16 cycles
|
||||||
timer_set(tms->device->machine, ATTOTIME_IN_HZ(device->clock()/16), tms, 1, io_ready_cb); // this should take around 10-16 (closer to ~15) cycles to complete for fifo writes, TODO: but actually depends on what command is written if in command mode
|
timer_set(tms->device->machine, ATTOTIME_IN_HZ(device->clock()/16), tms, 1, io_ready_cb); // this should take around 10-16 (closer to ~15) cycles to complete for fifo writes, TODO: but actually depends on what command is written if in command mode
|
||||||
}
|
}
|
||||||
|
@ -975,7 +975,7 @@ device_t *timer_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -1046,7 +1046,7 @@ bool timer_device_config::device_validity_check(const game_driver &driver) const
|
|||||||
error = true;
|
error = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1122,7 +1122,7 @@ void timer_device::device_reset()
|
|||||||
case timer_device_config::TIMER_TYPE_SCANLINE:
|
case timer_device_config::TIMER_TYPE_SCANLINE:
|
||||||
if (m_screen == NULL)
|
if (m_screen == NULL)
|
||||||
fatalerror("timer '%s': unable to find screen '%s'\n", tag(), m_config.m_screen);
|
fatalerror("timer '%s': unable to find screen '%s'\n", tag(), m_config.m_screen);
|
||||||
|
|
||||||
// set the timer to to fire immediately
|
// set the timer to to fire immediately
|
||||||
m_first_time = true;
|
m_first_time = true;
|
||||||
timer_adjust_oneshot(m_timer, attotime_zero, m_config.m_param);
|
timer_adjust_oneshot(m_timer, attotime_zero, m_config.m_param);
|
||||||
|
@ -224,7 +224,7 @@ attotime timer_firetime(emu_timer *which);
|
|||||||
class timer_device_config : public device_config
|
class timer_device_config : public device_config
|
||||||
{
|
{
|
||||||
friend class timer_device;
|
friend class timer_device;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
timer_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
timer_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ public:
|
|||||||
|
|
||||||
// basic information getters
|
// basic information getters
|
||||||
virtual const char *name() const { return "Timer"; }
|
virtual const char *name() const { return "Timer"; }
|
||||||
|
|
||||||
// indexes to inline data
|
// indexes to inline data
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -264,7 +264,7 @@ private:
|
|||||||
virtual bool device_validity_check(const game_driver &driver) const;
|
virtual bool device_validity_check(const game_driver &driver) const;
|
||||||
|
|
||||||
// configuration data
|
// configuration data
|
||||||
timer_type m_type; // type of timer
|
timer_type m_type; // type of timer
|
||||||
timer_device_fired_func m_callback; // the timer's callback function
|
timer_device_fired_func m_callback; // the timer's callback function
|
||||||
void * m_ptr; // the pointer parameter passed to the timer callback
|
void * m_ptr; // the pointer parameter passed to the timer callback
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ private:
|
|||||||
class timer_device : public device_t
|
class timer_device : public device_t
|
||||||
{
|
{
|
||||||
friend class timer_device_config;
|
friend class timer_device_config;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
timer_device(running_machine &_machine, const timer_device_config &config);
|
timer_device(running_machine &_machine, const timer_device_config &config);
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ public:
|
|||||||
bool enabled() const { return (timer_enabled(m_timer) != 0); }
|
bool enabled() const { return (timer_enabled(m_timer) != 0); }
|
||||||
|
|
||||||
// property setters
|
// property setters
|
||||||
void set_param(int param) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); timer_set_param(m_timer, param); }
|
void set_param(int param) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); timer_set_param(m_timer, param); }
|
||||||
void set_ptr(void *ptr) { m_ptr = ptr; }
|
void set_ptr(void *ptr) { m_ptr = ptr; }
|
||||||
void enable(bool enable = true) { timer_enable(m_timer, enable); }
|
void enable(bool enable = true) { timer_enable(m_timer, enable); }
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ private:
|
|||||||
static TIMER_CALLBACK( static_scanline_timer_callback ) { reinterpret_cast<timer_device *>(ptr)->scanline_timer_callback(param); }
|
static TIMER_CALLBACK( static_scanline_timer_callback ) { reinterpret_cast<timer_device *>(ptr)->scanline_timer_callback(param); }
|
||||||
void scanline_timer_callback(int scanline);
|
void scanline_timer_callback(int scanline);
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
const timer_device_config &m_config;
|
const timer_device_config &m_config;
|
||||||
emu_timer * m_timer; // the backing timer
|
emu_timer * m_timer; // the backing timer
|
||||||
void * m_ptr; // the pointer parameter passed to the timer callback
|
void * m_ptr; // the pointer parameter passed to the timer callback
|
||||||
|
@ -596,7 +596,7 @@ static bool validate_display(int drivnum, const machine_config *config)
|
|||||||
const game_driver *driver = drivers[drivnum];
|
const game_driver *driver = drivers[drivnum];
|
||||||
bool palette_modes = false;
|
bool palette_modes = false;
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
for (const screen_device_config *scrconfig = screen_first(*config); scrconfig != NULL; scrconfig = screen_next(scrconfig))
|
for (const screen_device_config *scrconfig = screen_first(*config); scrconfig != NULL; scrconfig = screen_next(scrconfig))
|
||||||
if (scrconfig->format() == BITMAP_FORMAT_INDEXED16)
|
if (scrconfig->format() == BITMAP_FORMAT_INDEXED16)
|
||||||
palette_modes = true;
|
palette_modes = true;
|
||||||
|
@ -1726,7 +1726,7 @@ device_t *screen_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_config_complete - perform any
|
// device_config_complete - perform any
|
||||||
// operations now that the configuration is
|
// operations now that the configuration is
|
||||||
// complete
|
// complete
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -1754,13 +1754,13 @@ void screen_device_config::device_config_complete()
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_validity_check - verify device
|
// device_validity_check - verify device
|
||||||
// configuration
|
// configuration
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
bool screen_device_config::device_validity_check(const game_driver &driver) const
|
bool screen_device_config::device_validity_check(const game_driver &driver) const
|
||||||
{
|
{
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
// sanity check dimensions
|
// sanity check dimensions
|
||||||
if (m_width <= 0 || m_height <= 0)
|
if (m_width <= 0 || m_height <= 0)
|
||||||
{
|
{
|
||||||
@ -2212,7 +2212,7 @@ int screen_device::hpos() const
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// time_until_pos - returns the amount of time
|
// time_until_pos - returns the amount of time
|
||||||
// remaining until the beam is at the given
|
// remaining until the beam is at the given
|
||||||
// hpos,vpos
|
// hpos,vpos
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -2273,7 +2273,7 @@ void screen_device::register_vblank_callback(vblank_state_changed_func vblank_ca
|
|||||||
for (itemptr = &m_callback_list; *itemptr != NULL; itemptr = &(*itemptr)->m_next)
|
for (itemptr = &m_callback_list; *itemptr != NULL; itemptr = &(*itemptr)->m_next)
|
||||||
if ((*itemptr)->m_callback == vblank_callback)
|
if ((*itemptr)->m_callback == vblank_callback)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// if not found, register
|
// if not found, register
|
||||||
if (*itemptr == NULL)
|
if (*itemptr == NULL)
|
||||||
{
|
{
|
||||||
@ -2387,7 +2387,7 @@ bool screen_device::update_quads()
|
|||||||
rectangle fixedvis = m_visarea;
|
rectangle fixedvis = m_visarea;
|
||||||
fixedvis.max_x++;
|
fixedvis.max_x++;
|
||||||
fixedvis.max_y++;
|
fixedvis.max_y++;
|
||||||
|
|
||||||
palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? machine->palette : NULL;
|
palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? machine->palette : NULL;
|
||||||
render_texture_set_bitmap(m_texture[m_curbitmap], m_bitmap[m_curbitmap], &fixedvis, m_texture_format, palette);
|
render_texture_set_bitmap(m_texture[m_curbitmap], m_bitmap[m_curbitmap], &fixedvis, m_texture_format, palette);
|
||||||
|
|
||||||
|
@ -85,19 +85,19 @@ typedef void (*vblank_state_changed_func)(screen_device &device, void *param, bo
|
|||||||
class screen_device_config : public device_config
|
class screen_device_config : public device_config
|
||||||
{
|
{
|
||||||
friend class screen_device;
|
friend class screen_device;
|
||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
screen_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
screen_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// allocators
|
// allocators
|
||||||
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||||
virtual device_t *alloc_device(running_machine &machine) const;
|
virtual device_t *alloc_device(running_machine &machine) const;
|
||||||
|
|
||||||
// basic information getters
|
// basic information getters
|
||||||
virtual const char *name() const { return "Video Screen"; }
|
virtual const char *name() const { return "Video Screen"; }
|
||||||
|
|
||||||
// configuration readers
|
// configuration readers
|
||||||
screen_type_enum screen_type() const { return m_type; }
|
screen_type_enum screen_type() const { return m_type; }
|
||||||
int width() const { return m_width; }
|
int width() const { return m_width; }
|
||||||
int height() const { return m_height; }
|
int height() const { return m_height; }
|
||||||
@ -137,7 +137,7 @@ private:
|
|||||||
virtual bool device_validity_check(const game_driver &driver) const;
|
virtual bool device_validity_check(const game_driver &driver) const;
|
||||||
|
|
||||||
// configuration data
|
// configuration data
|
||||||
screen_type_enum m_type; // type of screen
|
screen_type_enum m_type; // type of screen
|
||||||
int m_width, m_height; // default total width/height (HTOTAL, VTOTAL)
|
int m_width, m_height; // default total width/height (HTOTAL, VTOTAL)
|
||||||
rectangle m_visarea; // default visible area (HBLANK end/start, VBLANK end/start)
|
rectangle m_visarea; // default visible area (HBLANK end/start, VBLANK end/start)
|
||||||
bool m_oldstyle_vblank_supplied; // MDRV_SCREEN_VBLANK_TIME macro used
|
bool m_oldstyle_vblank_supplied; // MDRV_SCREEN_VBLANK_TIME macro used
|
||||||
@ -169,7 +169,7 @@ public:
|
|||||||
int height() const { return m_height; }
|
int height() const { return m_height; }
|
||||||
const rectangle &visible_area() const { return m_visarea; }
|
const rectangle &visible_area() const { return m_visarea; }
|
||||||
bitmap_format format() const { return m_config.m_format; }
|
bitmap_format format() const { return m_config.m_format; }
|
||||||
|
|
||||||
// dynamic configuration
|
// dynamic configuration
|
||||||
void configure(int width, int height, const rectangle &visarea, attoseconds_t frame_period);
|
void configure(int width, int height, const rectangle &visarea, attoseconds_t frame_period);
|
||||||
void set_visible_area(int min_x, int max_x, int min_y, int max_y);
|
void set_visible_area(int min_x, int max_x, int min_y, int max_y);
|
||||||
@ -197,7 +197,7 @@ public:
|
|||||||
void save_snapshot(mame_file *fp);
|
void save_snapshot(mame_file *fp);
|
||||||
void register_vblank_callback(vblank_state_changed_func vblank_callback, void *param);
|
void register_vblank_callback(vblank_state_changed_func vblank_callback, void *param);
|
||||||
bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(machine, (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
|
bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(machine, (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
|
||||||
|
|
||||||
// internal to the video system
|
// internal to the video system
|
||||||
bool update_quads();
|
bool update_quads();
|
||||||
void update_burnin();
|
void update_burnin();
|
||||||
@ -264,7 +264,7 @@ private:
|
|||||||
struct callback_item
|
struct callback_item
|
||||||
{
|
{
|
||||||
callback_item * m_next;
|
callback_item * m_next;
|
||||||
vblank_state_changed_func m_callback;
|
vblank_state_changed_func m_callback;
|
||||||
void * m_param;
|
void * m_param;
|
||||||
};
|
};
|
||||||
callback_item * m_callback_list; // list of VBLANK callbacks
|
callback_item * m_callback_list; // list of VBLANK callbacks
|
||||||
|
@ -1032,7 +1032,7 @@ DEVICE_GET_INFO( mc6845 )
|
|||||||
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mc6845); break;
|
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mc6845); break;
|
||||||
case DEVINFO_FCT_STOP: /* Nothing */ break;
|
case DEVINFO_FCT_STOP: /* Nothing */ break;
|
||||||
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc6845); break;
|
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc6845); break;
|
||||||
// case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME(mc6845); break;
|
// case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME(mc6845); break;
|
||||||
|
|
||||||
/* --- the following bits of info are returned as NULL-terminated strings --- */
|
/* --- the following bits of info are returned as NULL-terminated strings --- */
|
||||||
case DEVINFO_STR_NAME: strcpy(info->s, "Motorola 6845"); break;
|
case DEVINFO_STR_NAME: strcpy(info->s, "Motorola 6845"); break;
|
||||||
|
@ -38,7 +38,7 @@ static STATE_POSTLOAD( pc_video_postload )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void pc_video_start(running_machine *machine,
|
void pc_video_start(running_machine *machine,
|
||||||
pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
|
pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
|
||||||
size_t vramsize)
|
size_t vramsize)
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
typedef void (*pc_video_update_proc)(bitmap_t *bitmap);
|
typedef void (*pc_video_update_proc)(bitmap_t *bitmap);
|
||||||
|
|
||||||
void pc_video_start(running_machine *machine,
|
void pc_video_start(running_machine *machine,
|
||||||
pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
|
pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
|
||||||
size_t vramsize);
|
size_t vramsize);
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ public:
|
|||||||
int vprintf(const char *format, va_list args) { return astring_vprintf(this, format, args); }
|
int vprintf(const char *format, va_list args) { return astring_vprintf(this, format, args); }
|
||||||
int catprintf(const char *format, ...) { va_list ap; va_start(ap, format); int result = astring_catvprintf(this, format, ap); va_end(ap); return result; }
|
int catprintf(const char *format, ...) { va_list ap; va_start(ap, format); int result = astring_catvprintf(this, format, ap); va_end(ap); return result; }
|
||||||
int catvprintf(const char *format, va_list args) { return astring_catvprintf(this, format, args); }
|
int catvprintf(const char *format, va_list args) { return astring_catvprintf(this, format, args); }
|
||||||
|
|
||||||
astring &format(const char *format, ...) { va_list ap; va_start(ap, format); astring_vprintf(this, format, ap); va_end(ap); return *this; }
|
astring &format(const char *format, ...) { va_list ap; va_start(ap, format); astring_vprintf(this, format, ap); va_end(ap); return *this; }
|
||||||
|
|
||||||
int cmp(const astring &str2) const { return astring_cmp(this, &str2); }
|
int cmp(const astring &str2) const { return astring_cmp(this, &str2); }
|
||||||
|
@ -569,7 +569,7 @@ const char *cdrom_get_type_string(UINT32 trktype)
|
|||||||
{
|
{
|
||||||
switch (trktype)
|
switch (trktype)
|
||||||
{
|
{
|
||||||
case CD_TRACK_MODE1: return "MODE1";
|
case CD_TRACK_MODE1: return "MODE1";
|
||||||
case CD_TRACK_MODE1_RAW: return "MODE1_RAW";
|
case CD_TRACK_MODE1_RAW: return "MODE1_RAW";
|
||||||
case CD_TRACK_MODE2: return "MODE2";
|
case CD_TRACK_MODE2: return "MODE2";
|
||||||
case CD_TRACK_MODE2_FORM1: return "MODE2_FORM1";
|
case CD_TRACK_MODE2_FORM1: return "MODE2_FORM1";
|
||||||
@ -668,7 +668,7 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = chd_get_metadata(chd, CDROM_TRACK_METADATA2_TAG, toc->numtrks, metadata, sizeof(metadata), NULL, NULL, NULL);
|
err = chd_get_metadata(chd, CDROM_TRACK_METADATA2_TAG, toc->numtrks, metadata, sizeof(metadata), NULL, NULL, NULL);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
break;
|
break;
|
||||||
/* parse the metadata */
|
/* parse the metadata */
|
||||||
|
@ -104,8 +104,8 @@ struct _cdrom_track_info
|
|||||||
UINT32 postgap; /* number of postgap frames */
|
UINT32 postgap; /* number of postgap frames */
|
||||||
UINT32 pgtype; /* type of sectors in pregap */
|
UINT32 pgtype; /* type of sectors in pregap */
|
||||||
UINT32 pgsub; /* type of subchannel data in pregap */
|
UINT32 pgsub; /* type of subchannel data in pregap */
|
||||||
UINT32 pgdatasize; /* size of data in each sector of the pregap */
|
UINT32 pgdatasize; /* size of data in each sector of the pregap */
|
||||||
UINT32 pgsubsize; /* size of subchannel data in each sector of the pregap */
|
UINT32 pgsubsize; /* size of subchannel data in each sector of the pregap */
|
||||||
|
|
||||||
/* fields used in MAME only */
|
/* fields used in MAME only */
|
||||||
UINT32 physframeofs; /* frame number on the real CD this track starts at */
|
UINT32 physframeofs; /* frame number on the real CD this track starts at */
|
||||||
|
@ -184,7 +184,7 @@
|
|||||||
#define CDROM_TRACK_METADATA_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d"
|
#define CDROM_TRACK_METADATA_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d"
|
||||||
#define CDROM_TRACK_METADATA2_TAG 0x43485432 /* 'CHT2' */
|
#define CDROM_TRACK_METADATA2_TAG 0x43485432 /* 'CHT2' */
|
||||||
#define CDROM_TRACK_METADATA2_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"
|
#define CDROM_TRACK_METADATA2_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"
|
||||||
|
|
||||||
/* standard A/V metadata */
|
/* standard A/V metadata */
|
||||||
#define AV_METADATA_TAG 0x41564156 /* 'AVAV' */
|
#define AV_METADATA_TAG 0x41564156 /* 'AVAV' */
|
||||||
#define AV_METADATA_FORMAT "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d"
|
#define AV_METADATA_FORMAT "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d"
|
||||||
|
@ -206,7 +206,7 @@ void scramble_sh_init(running_machine *machine)
|
|||||||
Q6 ==> Reset Counters (LS393)
|
Q6 ==> Reset Counters (LS393)
|
||||||
Q7 ==> Trigger Logic
|
Q7 ==> Trigger Logic
|
||||||
|
|
||||||
only 16 bytes needed ... The original dump is bad. This
|
only 16 bytes needed ... The original dump is bad. This
|
||||||
is what is needed to get speech to work. The prom data has
|
is what is needed to get speech to work. The prom data has
|
||||||
been updated and marked as BAD_DUMP. The information below
|
been updated and marked as BAD_DUMP. The information below
|
||||||
is given for reference once another dump should surface.
|
is given for reference once another dump should surface.
|
||||||
|
@ -53,7 +53,7 @@ public:
|
|||||||
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, k3_state(machine)); }
|
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, k3_state(machine)); }
|
||||||
|
|
||||||
k3_state(running_machine &machine)
|
k3_state(running_machine &machine)
|
||||||
: oki1(machine.device<okim6295_device>("oki1")),
|
: oki1(machine.device<okim6295_device>("oki1")),
|
||||||
oki2(machine.device<okim6295_device>("oki2")) { }
|
oki2(machine.device<okim6295_device>("oki2")) { }
|
||||||
|
|
||||||
/* memory pointers */
|
/* memory pointers */
|
||||||
|
@ -2126,7 +2126,7 @@ static ADDRESS_MAP_START( vortex_io_map, ADDRESS_SPACE_IO, 8 )
|
|||||||
AM_RANGE(0x07, 0x07) AM_DEVWRITE("discrete", invaders_audio_2_w)
|
AM_RANGE(0x07, 0x07) AM_DEVWRITE("discrete", invaders_audio_2_w)
|
||||||
AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
|
AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
|
|
||||||
static INPUT_PORTS_START( vortex )
|
static INPUT_PORTS_START( vortex )
|
||||||
PORT_INCLUDE( sicv )
|
PORT_INCLUDE( sicv )
|
||||||
@ -2153,7 +2153,7 @@ static INPUT_PORTS_START( vortex )
|
|||||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
|
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
|
||||||
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7")
|
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7")
|
||||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8")
|
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8")
|
||||||
@ -2193,16 +2193,16 @@ static DRIVER_INIT( vortex )
|
|||||||
{
|
{
|
||||||
UINT32 addr = x;
|
UINT32 addr = x;
|
||||||
/*
|
/*
|
||||||
A15 A14 A13 A0 A3 A9
|
A15 A14 A13 A0 A3 A9
|
||||||
0 0 0 I I I
|
0 0 0 I I I
|
||||||
0 0 1 I I I
|
0 0 1 I I I
|
||||||
0 1 0 N N N
|
0 1 0 N N N
|
||||||
0 1 1 N I I
|
0 1 1 N I I
|
||||||
1 0 0 N I I
|
1 0 0 N I I
|
||||||
1 0 1 N I I
|
1 0 1 N I I
|
||||||
1 1 0 N I I
|
1 1 0 N I I
|
||||||
1 1 1 N I I
|
1 1 1 N I I
|
||||||
*/
|
*/
|
||||||
switch (x&0xE000) // inputs are A13 A14 A15
|
switch (x&0xE000) // inputs are A13 A14 A15
|
||||||
{
|
{
|
||||||
case 0x0000: case 0x2000: // A0 A3 A9
|
case 0x0000: case 0x2000: // A0 A3 A9
|
||||||
@ -2215,14 +2215,14 @@ static DRIVER_INIT( vortex )
|
|||||||
addr ^= 0x0208;
|
addr ^= 0x0208;
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
case 0x0000: case 0x2000: // A0 A3 A9
|
case 0x0000: case 0x2000: // A0 A3 A9
|
||||||
addr ^= 0x0001;
|
addr ^= 0x0001;
|
||||||
break;
|
break;
|
||||||
case 0x4000:
|
case 0x4000:
|
||||||
addr ^= 0x0208;
|
addr ^= 0x0208;
|
||||||
break;
|
break;
|
||||||
case 0x6000: case 0x8000: case 0xa000: case 0xc000: case 0xe000:
|
case 0x6000: case 0x8000: case 0xa000: case 0xc000: case 0xe000:
|
||||||
break;*/
|
break;*/
|
||||||
}
|
}
|
||||||
buf1[addr] = rom[x];
|
buf1[addr] = rom[x];
|
||||||
}
|
}
|
||||||
|
@ -126,10 +126,10 @@ static WRITE16_DEVICE_HANDLER( pspikesb_oki_banking_w )
|
|||||||
static WRITE16_DEVICE_HANDLER( aerfboo2_okim6295_banking_w )
|
static WRITE16_DEVICE_HANDLER( aerfboo2_okim6295_banking_w )
|
||||||
{
|
{
|
||||||
// if(ACCESSING_BITS_8_15)
|
// if(ACCESSING_BITS_8_15)
|
||||||
// {
|
// {
|
||||||
// okim6295_device *oki = downcast<okim6295_device *>(device);
|
// okim6295_device *oki = downcast<okim6295_device *>(device);
|
||||||
// oki->set_bank_base(0x40000 * ((data & 0xf00)>>8));
|
// oki->set_bank_base(0x40000 * ((data & 0xf00)>>8));
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_HANDLER( aerfboot_okim6295_banking_w )
|
static WRITE8_HANDLER( aerfboot_okim6295_banking_w )
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
Driver by Pierpaolo Prazzoli
|
Driver by Pierpaolo Prazzoli
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
- is the background color pen correct for both games? (Dacholer probably
|
- is the background color pen correct for both games? (Dacholer probably
|
||||||
just use a different color prom data)
|
just use a different color prom data)
|
||||||
|
|
||||||
Mods by Tomasz Slanina (2008.06.12):
|
Mods by Tomasz Slanina (2008.06.12):
|
||||||
- fixed sound cpu interrupts (mode 2 (two vectors)+ nmi)
|
- fixed sound cpu interrupts (mode 2 (two vectors)+ nmi)
|
||||||
|
@ -706,7 +706,7 @@ ROM_START( enigma2b )
|
|||||||
ROM_LOAD( "ic33.bin", 0x1800, 0x0800, CRC(ac6c2410) SHA1(d35565a5ffe795d0c36970bd9c2f948bf79e0ed8) )
|
ROM_LOAD( "ic33.bin", 0x1800, 0x0800, CRC(ac6c2410) SHA1(d35565a5ffe795d0c36970bd9c2f948bf79e0ed8) )
|
||||||
ROM_LOAD( "ic32.bin", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) )
|
ROM_LOAD( "ic32.bin", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) )
|
||||||
ROM_LOAD( "ic42.bin", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) )
|
ROM_LOAD( "ic42.bin", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) )
|
||||||
|
|
||||||
/* this rom was completely broken on this pcb.. */
|
/* this rom was completely broken on this pcb.. */
|
||||||
ROM_REGION( 0x10000, "audiocpu", 0 )
|
ROM_REGION( 0x10000, "audiocpu", 0 )
|
||||||
ROM_LOAD( "sound.bin", 0x0000, 0x0800, BAD_DUMP CRC(5f092d3c) SHA1(17c70f6af1b5560a45e6b1bdb330a98b27570fe9) )
|
ROM_LOAD( "sound.bin", 0x0000, 0x0800, BAD_DUMP CRC(5f092d3c) SHA1(17c70f6af1b5560a45e6b1bdb330a98b27570fe9) )
|
||||||
|
@ -2296,14 +2296,14 @@ ROM_END
|
|||||||
|
|
||||||
ROM_START( popn5 )
|
ROM_START( popn5 )
|
||||||
ROM_REGION32_BE(0x80000, "user1", 0)
|
ROM_REGION32_BE(0x80000, "user1", 0)
|
||||||
ROM_LOAD16_WORD_SWAP( "a02jaa03.21e", 0x000000, 0x080000, CRC(43ecc093) SHA1(637df5b546cf7409dd4752dc471674fe2a046599) )
|
ROM_LOAD16_WORD_SWAP( "a02jaa03.21e", 0x000000, 0x080000, CRC(43ecc093) SHA1(637df5b546cf7409dd4752dc471674fe2a046599) )
|
||||||
|
|
||||||
ROM_REGION(0x400000, "ymz", ROMREGION_ERASE00)
|
ROM_REGION(0x400000, "ymz", ROMREGION_ERASE00)
|
||||||
|
|
||||||
ROM_REGION(0xc0, "user2", ROMREGION_ERASE00) // Security dongle
|
ROM_REGION(0xc0, "user2", ROMREGION_ERASE00) // Security dongle
|
||||||
|
|
||||||
ROM_REGION(0x80000, "audiocpu", 0) // SPU 68K program
|
ROM_REGION(0x80000, "audiocpu", 0) // SPU 68K program
|
||||||
ROM_LOAD16_WORD_SWAP( "a02jaa04.3q", 0x000000, 0x080000, CRC(8c6000dd) SHA1(94ab2a66879839411eac6c673b25143d15836683) )
|
ROM_LOAD16_WORD_SWAP( "a02jaa04.3q", 0x000000, 0x080000, CRC(8c6000dd) SHA1(94ab2a66879839411eac6c673b25143d15836683) )
|
||||||
|
|
||||||
DISK_REGION( "scsi0" )
|
DISK_REGION( "scsi0" )
|
||||||
DISK_IMAGE_READONLY( "a04jaa01", 0, SHA1(87136ddad1d786b4d5f04381fcbf679ab666e6c9) )
|
DISK_IMAGE_READONLY( "a04jaa01", 0, SHA1(87136ddad1d786b4d5f04381fcbf679ab666e6c9) )
|
||||||
|
@ -214,7 +214,7 @@ static INPUT_PORTS_START( galivan )
|
|||||||
PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) )
|
PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) )
|
||||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
|
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
|
||||||
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
|
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
|
||||||
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:3,4")
|
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:3,4")
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
|
||||||
PORT_DIPSETTING( 0x04, DEF_STR( 2C_3C ) )
|
PORT_DIPSETTING( 0x04, DEF_STR( 2C_3C ) )
|
||||||
|
@ -36,8 +36,8 @@ static VIDEO_UPDATE(kongambl)
|
|||||||
bitmap_fill(bitmap, cliprect, 0);
|
bitmap_fill(bitmap, cliprect, 0);
|
||||||
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
|
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
|
||||||
|
|
||||||
// k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0);
|
// k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0);
|
||||||
// k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0);
|
// k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0);
|
||||||
k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0);
|
k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0);
|
||||||
k056832_tilemap_draw(k056832, bitmap, cliprect, 0, 0, 0);
|
k056832_tilemap_draw(k056832, bitmap, cliprect, 0, 0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
@ -70,11 +70,11 @@ static ADDRESS_MAP_START( kongambl_map, ADDRESS_SPACE_PROGRAM, 32 )
|
|||||||
|
|
||||||
AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE("k056832", k056832_ram_long_r, k056832_ram_long_w)
|
AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE("k056832", k056832_ram_long_r, k056832_ram_long_w)
|
||||||
|
|
||||||
AM_RANGE(0x420000, 0x43ffff) AM_DEVREADWRITE("k056832", k056832_unpaged_ram_long_r, k056832_unpaged_ram_long_w)
|
AM_RANGE(0x420000, 0x43ffff) AM_DEVREADWRITE("k056832", k056832_unpaged_ram_long_r, k056832_unpaged_ram_long_w)
|
||||||
|
|
||||||
AM_RANGE(0x440000, 0x443fff) AM_RAM
|
AM_RANGE(0x440000, 0x443fff) AM_RAM
|
||||||
|
|
||||||
AM_RANGE(0x460000, 0x47ffff) AM_RAM_WRITE(konamigx_palette_w) AM_BASE_GENERIC(paletteram)
|
AM_RANGE(0x460000, 0x47ffff) AM_RAM_WRITE(konamigx_palette_w) AM_BASE_GENERIC(paletteram)
|
||||||
|
|
||||||
AM_RANGE(0x480000, 0x48003f) AM_DEVWRITE("k056832", k056832_long_w)
|
AM_RANGE(0x480000, 0x48003f) AM_DEVWRITE("k056832", k056832_long_w)
|
||||||
|
|
||||||
|
@ -91,10 +91,10 @@ static DRIVER_INIT( aliencha )
|
|||||||
rom[0x0AC92/2] = 0x6012; // 0AC92 beq.s $ACA6
|
rom[0x0AC92/2] = 0x6012; // 0AC92 beq.s $ACA6
|
||||||
rom[0x124CC/2] = 0x6012; // 124CC beq.s $124E0
|
rom[0x124CC/2] = 0x6012; // 124CC beq.s $124E0
|
||||||
rom[0x12850/2] = 0x6012; // 12850 beq.s $12864
|
rom[0x12850/2] = 0x6012; // 12850 beq.s $12864
|
||||||
rom[0x12C06/2] = 0x6012; // 12C06 beq.s $12C1A
|
rom[0x12C06/2] = 0x6012; // 12C06 beq.s $12C1A
|
||||||
rom[0x1862A/2] = 0x6012; // 1862A beq.s $1863E
|
rom[0x1862A/2] = 0x6012; // 1862A beq.s $1863E
|
||||||
rom[0x189AE/2] = 0x6012; // 189AE beq.s $189C2
|
rom[0x189AE/2] = 0x6012; // 189AE beq.s $189C2
|
||||||
rom[0x18D64/2] = 0x6012; // 18D64 beq.s $18D78
|
rom[0x18D64/2] = 0x6012; // 18D64 beq.s $18D78
|
||||||
rom[0x230FC/2] = 0x6012; // 230FC beq.s $23110
|
rom[0x230FC/2] = 0x6012; // 230FC beq.s $23110
|
||||||
rom[0x23480/2] = 0x6012; // 23480 beq.s $23494
|
rom[0x23480/2] = 0x6012; // 23480 beq.s $23494
|
||||||
rom[0x23836/2] = 0x6012; // 23836 beq.s $2384A
|
rom[0x23836/2] = 0x6012; // 23836 beq.s $2384A
|
||||||
@ -115,10 +115,10 @@ static DRIVER_INIT( alienchac )
|
|||||||
rom[0x0AC8A/2] = 0x6012; // 0AC8A beq.s $AC9E
|
rom[0x0AC8A/2] = 0x6012; // 0AC8A beq.s $AC9E
|
||||||
rom[0x124B8/2] = 0x6012; // 124B8 beq.s $124CC
|
rom[0x124B8/2] = 0x6012; // 124B8 beq.s $124CC
|
||||||
rom[0x1283C/2] = 0x6012; // 1283C beq.s $12850
|
rom[0x1283C/2] = 0x6012; // 1283C beq.s $12850
|
||||||
rom[0x12BF2/2] = 0x6012; // 12BF2 beq.s $12C06
|
rom[0x12BF2/2] = 0x6012; // 12BF2 beq.s $12C06
|
||||||
rom[0x18616/2] = 0x6012; // 18616 beq.s $1862A
|
rom[0x18616/2] = 0x6012; // 18616 beq.s $1862A
|
||||||
rom[0x1899A/2] = 0x6012; // 1899A beq.s $189AE
|
rom[0x1899A/2] = 0x6012; // 1899A beq.s $189AE
|
||||||
rom[0x18D50/2] = 0x6012; // 18D50 beq.s $18D64
|
rom[0x18D50/2] = 0x6012; // 18D50 beq.s $18D64
|
||||||
rom[0x230E8/2] = 0x6012; // 230E8 beq.s $230FC
|
rom[0x230E8/2] = 0x6012; // 230E8 beq.s $230FC
|
||||||
rom[0x2346C/2] = 0x6012; // 2346C beq.s $23480
|
rom[0x2346C/2] = 0x6012; // 2346C beq.s $23480
|
||||||
rom[0x23822/2] = 0x6012; // 23822 beq.s $23822
|
rom[0x23822/2] = 0x6012; // 23822 beq.s $23822
|
||||||
@ -531,7 +531,7 @@ static INPUT_PORTS_START( aliencha )
|
|||||||
PORT_DIPSETTING( 0x01, "3" )
|
PORT_DIPSETTING( 0x01, "3" )
|
||||||
PORT_DIPSETTING( 0x02, "4" )
|
PORT_DIPSETTING( 0x02, "4" )
|
||||||
PORT_DIPSETTING( 0x03, "6" )
|
PORT_DIPSETTING( 0x03, "6" )
|
||||||
// PORT_DIPSETTING( 0x00, "6" )
|
// PORT_DIPSETTING( 0x00, "6" )
|
||||||
PORT_DIPNAME( 0x04, 0x04, "Vs. Rounds" )
|
PORT_DIPNAME( 0x04, 0x04, "Vs. Rounds" )
|
||||||
PORT_DIPSETTING( 0x00, "3" )
|
PORT_DIPSETTING( 0x00, "3" )
|
||||||
PORT_DIPSETTING( 0x04, "5" )
|
PORT_DIPSETTING( 0x04, "5" )
|
||||||
@ -582,8 +582,8 @@ static INPUT_PORTS_START( aliencha )
|
|||||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
|
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
|
||||||
|
|
||||||
PORT_START("COIN")
|
PORT_START("COIN")
|
||||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
|
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
|
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
|
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
|
||||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
|
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
|
||||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
|
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
|
||||||
|
@ -283,11 +283,11 @@ static VIDEO_UPDATE(luckgrln)
|
|||||||
if (clip.max_x>visarea.max_x) clip.max_x = visarea.max_x;
|
if (clip.max_x>visarea.max_x) clip.max_x = visarea.max_x;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
luck_vram1 tttt tttt (t = low tile bits)
|
luck_vram1 tttt tttt (t = low tile bits)
|
||||||
luck_vram2 tttt ppp? (t = high tile bits) (p = pal select)?
|
luck_vram2 tttt ppp? (t = high tile bits) (p = pal select)?
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tile |= (tile_high & 0xf0) << 4;
|
tile |= (tile_high & 0xf0) << 4;
|
||||||
if (tileattr & 0x02) tile |= 0x1000;
|
if (tileattr & 0x02) tile |= 0x1000;
|
||||||
@ -356,7 +356,7 @@ static ADDRESS_MAP_START( mainmap, ADDRESS_SPACE_PROGRAM, 8 )
|
|||||||
AM_RANGE(0x0ce00, 0x0cfff) AM_RAM_WRITE(luckgrln_reel4_attr_w) AM_BASE(&reel4_attr)
|
AM_RANGE(0x0ce00, 0x0cfff) AM_RAM_WRITE(luckgrln_reel4_attr_w) AM_BASE(&reel4_attr)
|
||||||
AM_RANGE(0x0d600, 0x0d63f) AM_RAM AM_BASE(&reel4_scroll)
|
AM_RANGE(0x0d600, 0x0d63f) AM_RAM AM_BASE(&reel4_scroll)
|
||||||
|
|
||||||
// AM_RANGE(0x0d200, 0x0d2ff) AM_RAM
|
// AM_RANGE(0x0d200, 0x0d2ff) AM_RAM
|
||||||
|
|
||||||
|
|
||||||
AM_RANGE(0x0d800, 0x0dfff) AM_RAM // nvram
|
AM_RANGE(0x0d800, 0x0dfff) AM_RAM // nvram
|
||||||
|
@ -118,11 +118,11 @@ static READ8_HANDLER( pang_port5_r )
|
|||||||
int bit = eeprom_read_bit(devtag_get_device(space->machine, "eeprom")) << 7;
|
int bit = eeprom_read_bit(devtag_get_device(space->machine, "eeprom")) << 7;
|
||||||
|
|
||||||
/* bits 0 and (sometimes) 3 are checked in the interrupt handler.
|
/* bits 0 and (sometimes) 3 are checked in the interrupt handler.
|
||||||
bit 3 is checked before updating the palette so it really seems to be vblank.
|
bit 3 is checked before updating the palette so it really seems to be vblank.
|
||||||
bit 0 may be vblank (or vblank irq flag) related too, but I'm not sure.
|
bit 0 may be vblank (or vblank irq flag) related too, but I'm not sure.
|
||||||
Many games require two interrupts per frame and for these bits to toggle,
|
Many games require two interrupts per frame and for these bits to toggle,
|
||||||
otherwise music doesn't work.
|
otherwise music doesn't work.
|
||||||
*/
|
*/
|
||||||
if (cpu_getiloops(space->cpu) & 1)
|
if (cpu_getiloops(space->cpu) & 1)
|
||||||
bit |= 0x01;
|
bit |= 0x01;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
almost OK
|
almost OK
|
||||||
---------
|
---------
|
||||||
overrev: sound CPU crashes.
|
overrev: sound CPU crashes.
|
||||||
vstriker: shows some attract mode, then hangs
|
vstriker: shows some attract mode, then hangs
|
||||||
manxtt: no escape from "active motion slider" tutorial (needs analog inputs), bypass it by entering then exiting service mode
|
manxtt: no escape from "active motion slider" tutorial (needs analog inputs), bypass it by entering then exiting service mode
|
||||||
manxtt: crashes after the title screen, the TGP is the cause
|
manxtt: crashes after the title screen, the TGP is the cause
|
||||||
@ -51,37 +51,37 @@
|
|||||||
======================================================================================================================================
|
======================================================================================================================================
|
||||||
|
|
||||||
Sega Model 2 Feedback Driver Board
|
Sega Model 2 Feedback Driver Board
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
|
||||||
PCB Layout
|
PCB Layout
|
||||||
----------
|
----------
|
||||||
|
|
||||||
SJ25-0207-01
|
SJ25-0207-01
|
||||||
838-10646 (Daytona)
|
838-10646 (Daytona)
|
||||||
838-11661 (Sega Rally)
|
838-11661 (Sega Rally)
|
||||||
|---------------------------------------------|
|
|---------------------------------------------|
|
||||||
| 7-SEG-LED 7-SEG-LED |
|
| 7-SEG-LED 7-SEG-LED |
|
||||||
| |
|
| |
|
||||||
| 315-5296 315-5296 |
|
| 315-5296 315-5296 |
|
||||||
| DSW(8) |
|
| DSW(8) |
|
||||||
| M6253 MB3759 |
|
| M6253 MB3759 |
|
||||||
| |
|
| |
|
||||||
| GAL.IC23 ROM.IC12 |
|
| GAL.IC23 ROM.IC12 |
|
||||||
| |
|
| |
|
||||||
| Z80 |
|
| Z80 |
|
||||||
|8MHz MB3771 MB3771 8464 |
|
|8MHz MB3771 MB3771 8464 |
|
||||||
|---------------------------------------------|
|
|---------------------------------------------|
|
||||||
Notes:
|
Notes:
|
||||||
Z80 - clock 4.000MHz [8/2]
|
Z80 - clock 4.000MHz [8/2]
|
||||||
8464 - 8k x8 SRAM
|
8464 - 8k x8 SRAM
|
||||||
ROM.IC12 - EPR-16488A for Daytona
|
ROM.IC12 - EPR-16488A for Daytona
|
||||||
EPR-17891 for Sega Rally
|
EPR-17891 for Sega Rally
|
||||||
GAL - Lattice GAL16V8B stamped 315-5625 common to both Daytona and Sega Rally
|
GAL - Lattice GAL16V8B stamped 315-5625 common to both Daytona and Sega Rally
|
||||||
DSW(8) - 8-Position dip switch, all OFF
|
DSW(8) - 8-Position dip switch, all OFF
|
||||||
M6253 - Oki M6253
|
M6253 - Oki M6253
|
||||||
315-5296 - Sega Custom QFP100
|
315-5296 - Sega Custom QFP100
|
||||||
plus several transistors, resistors, a couple of relays and 8 connectors.
|
plus several transistors, resistors, a couple of relays and 8 connectors.
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@ -514,71 +514,71 @@ static CUSTOM_INPUT( _1c0001c_r )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Rail Chase 2 "Drive I/O BD" documentation
|
Rail Chase 2 "Drive I/O BD" documentation
|
||||||
|
|
||||||
I'm fairly sure that this is actually controlled by a CPU with undumped program code.
|
I'm fairly sure that this is actually controlled by a CPU with undumped program code.
|
||||||
|
|
||||||
commands 0x2* are for device status bits (all of them active low)
|
commands 0x2* are for device status bits (all of them active low)
|
||||||
|
|
||||||
command 0x27 (4 port valve rear cylinder)
|
command 0x27 (4 port valve rear cylinder)
|
||||||
---- --xx Cylinder Position (00 - neutral, 01 - up, 10 - down, 11 - error)
|
---- --xx Cylinder Position (00 - neutral, 01 - up, 10 - down, 11 - error)
|
||||||
|
|
||||||
command 0x29
|
command 0x29
|
||||||
---- -x-- Compressor Motor
|
---- -x-- Compressor Motor
|
||||||
---- --x- Unloader Valve
|
---- --x- Unloader Valve
|
||||||
---- ---x Compression Valve
|
---- ---x Compression Valve
|
||||||
|
|
||||||
command 0x2a (4 port valve left cylinder)
|
command 0x2a (4 port valve left cylinder)
|
||||||
---- -x-- Rev Valve
|
---- -x-- Rev Valve
|
||||||
---- --x- Down Valve
|
---- --x- Down Valve
|
||||||
---- ---x Up Valve
|
---- ---x Up Valve
|
||||||
|
|
||||||
command 0x2b (4 port valve right cylinder)
|
command 0x2b (4 port valve right cylinder)
|
||||||
---- -x-- Rev Valve
|
---- -x-- Rev Valve
|
||||||
---- --x- Down Valve
|
---- --x- Down Valve
|
||||||
---- ---x Up Valve
|
---- ---x Up Valve
|
||||||
|
|
||||||
command 0x2e
|
command 0x2e
|
||||||
---- --xx Compression SW (00 - error, 01 - low, 10 - high, 11 - error)
|
---- --xx Compression SW (00 - error, 01 - low, 10 - high, 11 - error)
|
||||||
|
|
||||||
command 0x2f
|
command 0x2f
|
||||||
---- x--- Emergency SW
|
---- x--- Emergency SW
|
||||||
---- ---x Safety Sensor
|
---- ---x Safety Sensor
|
||||||
|
|
||||||
These are all used on network check, probably some specific data port R/Ws
|
These are all used on network check, probably some specific data port R/Ws
|
||||||
|
|
||||||
command 0x3b
|
command 0x3b
|
||||||
command 0xe0
|
command 0xe0
|
||||||
command 0xd0
|
command 0xd0
|
||||||
command 0xb0
|
command 0xb0
|
||||||
command 0x70
|
command 0x70
|
||||||
command 0x0e
|
command 0x0e
|
||||||
command 0x0d
|
command 0x0d
|
||||||
command 0x0b
|
command 0x0b
|
||||||
command 0x07
|
command 0x07
|
||||||
|
|
||||||
Every other write of this controls devices behaviour:
|
Every other write of this controls devices behaviour:
|
||||||
|
|
||||||
command 0x4f (left up valve off)
|
command 0x4f (left up valve off)
|
||||||
command 0x5b (left down valve off)
|
command 0x5b (left down valve off)
|
||||||
command 0x5d (compression valve on)
|
command 0x5d (compression valve on)
|
||||||
command 0x5e (left rev valve on)
|
command 0x5e (left rev valve on)
|
||||||
command 0x5f (left Cylinder reset)
|
command 0x5f (left Cylinder reset)
|
||||||
|
|
||||||
command 0x6f (right up valve off)
|
command 0x6f (right up valve off)
|
||||||
command 0x7b (right down valve off)
|
command 0x7b (right down valve off)
|
||||||
command 0x7d (compression valve on)
|
command 0x7d (compression valve on)
|
||||||
command 0x7e (right rev valve on)
|
command 0x7e (right rev valve on)
|
||||||
command 0x7f (right Cylinder reset)
|
command 0x7f (right Cylinder reset)
|
||||||
|
|
||||||
command 0x84 (reset up/down valves of rear cylinder)
|
command 0x84 (reset up/down valves of rear cylinder)
|
||||||
command 0x85 (rear up valve on)
|
command 0x85 (rear up valve on)
|
||||||
command 0x86 (rear down valve on)
|
command 0x86 (rear down valve on)
|
||||||
|
|
||||||
command 0x8b (compression valve on)
|
command 0x8b (compression valve on)
|
||||||
command 0x8d (left rev valve is on)
|
command 0x8d (left rev valve is on)
|
||||||
command 0x8e (right rev valve is on)
|
command 0x8e (right rev valve is on)
|
||||||
command 0x8f (reset 4 port valve left / right cylinders and compression valve)
|
command 0x8f (reset 4 port valve left / right cylinders and compression valve)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -592,9 +592,9 @@ static CUSTOM_INPUT( rchase2_devices_r )
|
|||||||
static WRITE32_HANDLER( rchase2_devices_w )
|
static WRITE32_HANDLER( rchase2_devices_w )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
0x00040000 start 1 lamp
|
0x00040000 start 1 lamp
|
||||||
0x00080000 start 2 lamp
|
0x00080000 start 2 lamp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(mem_mask == 0x0000ffff)
|
if(mem_mask == 0x0000ffff)
|
||||||
cmd_data = data;
|
cmd_data = data;
|
||||||
@ -605,10 +605,10 @@ static UINT8 driveio_comm_data;
|
|||||||
static WRITE32_HANDLER( srallyc_devices_w )
|
static WRITE32_HANDLER( srallyc_devices_w )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
0x00040000 start 1 lamp
|
0x00040000 start 1 lamp
|
||||||
0x00200000 vr lamp
|
0x00200000 vr lamp
|
||||||
0x00800000 leader lamp
|
0x00800000 leader lamp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(mem_mask == 0x000000ff || mem_mask == 0x0000ffff)
|
if(mem_mask == 0x000000ff || mem_mask == 0x0000ffff)
|
||||||
{
|
{
|
||||||
@ -2120,8 +2120,8 @@ static READ8_HANDLER( driveio_port_r )
|
|||||||
|
|
||||||
static WRITE8_HANDLER( driveio_port_w )
|
static WRITE8_HANDLER( driveio_port_w )
|
||||||
{
|
{
|
||||||
// TODO: hook up to the main CPU
|
// TODO: hook up to the main CPU
|
||||||
// popmessage("%02x",data);
|
// popmessage("%02x",data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static READ8_HANDLER( driveio_port_str_r )
|
static READ8_HANDLER( driveio_port_str_r )
|
||||||
@ -2152,7 +2152,7 @@ static MACHINE_DRIVER_START( srallyc )
|
|||||||
MDRV_CPU_ADD("drivecpu", Z80, 16000000/4) //???
|
MDRV_CPU_ADD("drivecpu", Z80, 16000000/4) //???
|
||||||
MDRV_CPU_PROGRAM_MAP(drive_map)
|
MDRV_CPU_PROGRAM_MAP(drive_map)
|
||||||
MDRV_CPU_IO_MAP(drive_io_map)
|
MDRV_CPU_IO_MAP(drive_io_map)
|
||||||
// MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
|
// MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
|
||||||
MACHINE_DRIVER_END
|
MACHINE_DRIVER_END
|
||||||
|
|
||||||
static const sharc_config sharc_cfg =
|
static const sharc_config sharc_cfg =
|
||||||
|
@ -1088,7 +1088,7 @@ ROM_START( ptblank ) /* World set using 4Mb sound data rom (verified) */
|
|||||||
ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
|
ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
|
||||||
|
|
||||||
ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data - JP1 jumper selectable between 1Mb (27C1024) or 4Mb (27C4096) either rom is correct */
|
ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data - JP1 jumper selectable between 1Mb (27C1024) or 4Mb (27C4096) either rom is correct */
|
||||||
// ROM_LOAD( "gn1_spr0.5b", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) /* 1Megabit, same data as the 4Mb rom at 0x00000-0x1ffff */
|
// ROM_LOAD( "gn1_spr0.5b", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) /* 1Megabit, same data as the 4Mb rom at 0x00000-0x1ffff */
|
||||||
ROM_LOAD( "gn1-spr0.5b", 0, 0x80000, CRC(71773811) SHA1(e482784d9b9ebf8c2e4a2a3f6f6c4dc8304d2251) ) /* 4Megabit, same data at 0x00000-0x1ffff, 0x20000-0x7ffff is 0xff filled */
|
ROM_LOAD( "gn1-spr0.5b", 0, 0x80000, CRC(71773811) SHA1(e482784d9b9ebf8c2e4a2a3f6f6c4dc8304d2251) ) /* 4Megabit, same data at 0x00000-0x1ffff, 0x20000-0x7ffff is 0xff filled */
|
||||||
|
|
||||||
ROM_REGION( 0x200000, "c352", 0 )
|
ROM_REGION( 0x200000, "c352", 0 )
|
||||||
@ -1119,7 +1119,7 @@ ROM_START( gunbuletw ) /* World set using 4Mb sound data rom (verified) */
|
|||||||
ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
|
ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
|
||||||
|
|
||||||
ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data - JP1 jumper selectable between 1Mb (27C1024) or 4Mb (27C4096) either rom is correct */
|
ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data - JP1 jumper selectable between 1Mb (27C1024) or 4Mb (27C4096) either rom is correct */
|
||||||
// ROM_LOAD( "gn1_spr0.5b", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) /* 1Megabit, same data as the 4Mb rom at 0x00000-0x1ffff */
|
// ROM_LOAD( "gn1_spr0.5b", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) /* 1Megabit, same data as the 4Mb rom at 0x00000-0x1ffff */
|
||||||
ROM_LOAD( "gn1-spr0.5b", 0, 0x80000, CRC(71773811) SHA1(e482784d9b9ebf8c2e4a2a3f6f6c4dc8304d2251) ) /* 4Megabit, same data at 0x00000-0x1ffff, 0x20000-0x7ffff is 0xff filled */
|
ROM_LOAD( "gn1-spr0.5b", 0, 0x80000, CRC(71773811) SHA1(e482784d9b9ebf8c2e4a2a3f6f6c4dc8304d2251) ) /* 4Megabit, same data at 0x00000-0x1ffff, 0x20000-0x7ffff is 0xff filled */
|
||||||
|
|
||||||
ROM_REGION( 0x200000, "c352", 0 )
|
ROM_REGION( 0x200000, "c352", 0 )
|
||||||
@ -1151,7 +1151,7 @@ ROM_START( gunbuletj ) /* Japanese set using 1Mb sound data rom (verified) */
|
|||||||
|
|
||||||
ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data - JP1 jumper selectable between 1Mb (27C1024) or 4Mb (27C4096) either rom is correct */
|
ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data - JP1 jumper selectable between 1Mb (27C1024) or 4Mb (27C4096) either rom is correct */
|
||||||
ROM_LOAD( "gn1_spr0.5b", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) /* 1Megabit, same data as the 4Mb rom at 0x00000-0x1ffff */
|
ROM_LOAD( "gn1_spr0.5b", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) ) /* 1Megabit, same data as the 4Mb rom at 0x00000-0x1ffff */
|
||||||
// ROM_LOAD( "gn1-spr0.5b", 0, 0x80000, CRC(71773811) SHA1(e482784d9b9ebf8c2e4a2a3f6f6c4dc8304d2251) ) /* 4Megabit, same data at 0x00000-0x1ffff, 0x20000-0x7ffff is 0xff filled */
|
// ROM_LOAD( "gn1-spr0.5b", 0, 0x80000, CRC(71773811) SHA1(e482784d9b9ebf8c2e4a2a3f6f6c4dc8304d2251) ) /* 4Megabit, same data at 0x00000-0x1ffff, 0x20000-0x7ffff is 0xff filled */
|
||||||
|
|
||||||
ROM_REGION( 0x200000, "c352", 0 )
|
ROM_REGION( 0x200000, "c352", 0 )
|
||||||
ROM_LOAD( "gn1-voi0.5j", 0, 0x200000, CRC(05477eb7) SHA1(f2eaacb5dbac06c37c56b9b131230c9cf6602221) )
|
ROM_LOAD( "gn1-voi0.5j", 0, 0x200000, CRC(05477eb7) SHA1(f2eaacb5dbac06c37c56b9b131230c9cf6602221) )
|
||||||
|
@ -158,7 +158,7 @@ static ADDRESS_MAP_START( pcat_map, ADDRESS_SPACE_PROGRAM, 32 )
|
|||||||
AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
|
AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
|
||||||
AM_RANGE(0x000a0000, 0x000bffff) AM_RAM
|
AM_RANGE(0x000a0000, 0x000bffff) AM_RAM
|
||||||
AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0)
|
AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0)
|
||||||
AM_RANGE(0x000d0000, 0x000d3fff) AM_RAM AM_REGION("disk_bios", 0)
|
AM_RANGE(0x000d0000, 0x000d3fff) AM_RAM AM_REGION("disk_bios", 0)
|
||||||
AM_RANGE(0x000d7000, 0x000d7003) AM_WRITE8(pcat_nit_rombank_w, 0xff)
|
AM_RANGE(0x000d7000, 0x000d7003) AM_WRITE8(pcat_nit_rombank_w, 0xff)
|
||||||
AM_RANGE(0x000d8000, 0x000dffff) AM_ROMBANK("rombank")
|
AM_RANGE(0x000d8000, 0x000dffff) AM_ROMBANK("rombank")
|
||||||
AM_RANGE(0x000f0000, 0x000fffff) AM_RAM AM_REGION("bios", 0 )
|
AM_RANGE(0x000f0000, 0x000fffff) AM_RAM AM_REGION("bios", 0 )
|
||||||
|
@ -73,7 +73,7 @@ protected:
|
|||||||
virtual void device_config_complete();
|
virtual void device_config_complete();
|
||||||
virtual bool device_validity_check(const game_driver &driver) const;
|
virtual bool device_validity_check(const game_driver &driver) const;
|
||||||
virtual const address_space_config *memory_space_config(int spacenum = 0) const;
|
virtual const address_space_config *memory_space_config(int spacenum = 0) const;
|
||||||
address_space_config m_space_config;
|
address_space_config m_space_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
class janshi_vdp_device : public device_t,
|
class janshi_vdp_device : public device_t,
|
||||||
@ -109,9 +109,9 @@ device_t *janshi_vdp_device_config::alloc_device(running_machine &machine) const
|
|||||||
|
|
||||||
void janshi_vdp_device_config::device_config_complete()
|
void janshi_vdp_device_config::device_config_complete()
|
||||||
{
|
{
|
||||||
// int address_bits = 24;
|
// int address_bits = 24;
|
||||||
|
|
||||||
// m_space_config = address_space_config("janshi_vdp", ENDIANNESS_BIG, 8, address_bits, 0, *ADDRESS_MAP_NAME(janshi_vdp_map8));
|
// m_space_config = address_space_config("janshi_vdp", ENDIANNESS_BIG, 8, address_bits, 0, *ADDRESS_MAP_NAME(janshi_vdp_map8));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool janshi_vdp_device_config::device_validity_check(const game_driver &driver) const
|
bool janshi_vdp_device_config::device_validity_check(const game_driver &driver) const
|
||||||
@ -204,16 +204,16 @@ static VIDEO_UPDATE( pinkiri8 )
|
|||||||
|
|
||||||
/* vram 1 (12000 - 12fff)
|
/* vram 1 (12000 - 12fff)
|
||||||
|
|
||||||
tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx |
|
tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx |
|
||||||
|
|
||||||
vram 2 (13800 - 13fff)
|
vram 2 (13800 - 13fff)
|
||||||
|
|
||||||
yyyy yyyy | ???? ???? |
|
yyyy yyyy | ???? ???? |
|
||||||
|
|
||||||
there is also some data at 13000 - 137ff
|
there is also some data at 13000 - 137ff
|
||||||
and a table at 20000..
|
and a table at 20000..
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
spr_offs = ((janshi_vram1[(i*4)+0] & 0xff) | (janshi_vram1[(i*4)+1]<<8)) & 0xffff;
|
spr_offs = ((janshi_vram1[(i*4)+0] & 0xff) | (janshi_vram1[(i*4)+1]<<8)) & 0xffff;
|
||||||
col = (janshi_vram1[(i*4)+2] & 0xf8) >> 3;
|
col = (janshi_vram1[(i*4)+2] & 0xf8) >> 3;
|
||||||
@ -229,7 +229,7 @@ static VIDEO_UPDATE( pinkiri8 )
|
|||||||
|
|
||||||
col|= col_bank<<5;
|
col|= col_bank<<5;
|
||||||
|
|
||||||
// width = 0; height = 0;
|
// width = 0; height = 0;
|
||||||
|
|
||||||
|
|
||||||
// hacks!
|
// hacks!
|
||||||
@ -342,7 +342,7 @@ static int prev_writes = 0;
|
|||||||
|
|
||||||
static WRITE8_HANDLER( pinkiri8_vram_w )
|
static WRITE8_HANDLER( pinkiri8_vram_w )
|
||||||
{
|
{
|
||||||
// static UINT8 *vram = memory_region(space->machine, "vram");
|
// static UINT8 *vram = memory_region(space->machine, "vram");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -386,22 +386,22 @@ static WRITE8_HANDLER( pinkiri8_vram_w )
|
|||||||
//vram[(vram_addr) | (vram_bank << 16)] = data;
|
//vram[(vram_addr) | (vram_bank << 16)] = data;
|
||||||
/*
|
/*
|
||||||
|
|
||||||
if(vram_addr <= 0xffff)
|
if(vram_addr <= 0xffff)
|
||||||
{
|
{
|
||||||
static UINT16 datax,pal_offs;
|
static UINT16 datax,pal_offs;
|
||||||
static UINT8 r,g,b;
|
static UINT8 r,g,b;
|
||||||
|
|
||||||
pal_offs = vram_addr;
|
pal_offs = vram_addr;
|
||||||
|
|
||||||
datax = (vram[pal_offs & 0x1fff]) + (vram[(pal_offs & 0x1fff) | (0x2000)]<<8);
|
datax = (vram[pal_offs & 0x1fff]) + (vram[(pal_offs & 0x1fff) | (0x2000)]<<8);
|
||||||
|
|
||||||
r = ((datax)&0x001f)>>0;
|
r = ((datax)&0x001f)>>0;
|
||||||
g = ((datax)&0x03e0)>>5;
|
g = ((datax)&0x03e0)>>5;
|
||||||
b = ((datax)&0x7c00)>>10;
|
b = ((datax)&0x7c00)>>10;
|
||||||
|
|
||||||
palette_set_color_rgb(space->machine, pal_offs & 0x1fff, pal5bit(r), pal5bit(g), pal5bit(b));
|
palette_set_color_rgb(space->machine, pal_offs & 0x1fff, pal5bit(r), pal5bit(g), pal5bit(b));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ static MACHINE_DRIVER_START( rgum )
|
|||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MDRV_CPU_ADD("maincpu", M65C02,24000000/16) /* ? MHz */
|
MDRV_CPU_ADD("maincpu", M65C02,24000000/16) /* ? MHz */
|
||||||
MDRV_CPU_PROGRAM_MAP(rgum_map)
|
MDRV_CPU_PROGRAM_MAP(rgum_map)
|
||||||
// MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
|
// MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
|
||||||
|
|
||||||
/* video hardware */
|
/* video hardware */
|
||||||
MDRV_SCREEN_ADD("screen", RASTER)
|
MDRV_SCREEN_ADD("screen", RASTER)
|
||||||
|
@ -2525,14 +2525,14 @@ static TIMER_CALLBACK(stv_rtc_increment)
|
|||||||
static int year_num, year_count;
|
static int year_num, year_count;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
smpc_ram[0x23] = DectoBCD(systime.local_time.year /100);
|
smpc_ram[0x23] = DectoBCD(systime.local_time.year /100);
|
||||||
smpc_ram[0x25] = DectoBCD(systime.local_time.year %100);
|
smpc_ram[0x25] = DectoBCD(systime.local_time.year %100);
|
||||||
smpc_ram[0x27] = (systime.local_time.weekday << 4) | (systime.local_time.month+1);
|
smpc_ram[0x27] = (systime.local_time.weekday << 4) | (systime.local_time.month+1);
|
||||||
smpc_ram[0x29] = DectoBCD(systime.local_time.mday);
|
smpc_ram[0x29] = DectoBCD(systime.local_time.mday);
|
||||||
smpc_ram[0x2b] = DectoBCD(systime.local_time.hour);
|
smpc_ram[0x2b] = DectoBCD(systime.local_time.hour);
|
||||||
smpc_ram[0x2d] = DectoBCD(systime.local_time.minute);
|
smpc_ram[0x2d] = DectoBCD(systime.local_time.minute);
|
||||||
smpc_ram[0x2f] = DectoBCD(systime.local_time.second);
|
smpc_ram[0x2f] = DectoBCD(systime.local_time.second);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
smpc_ram[0x2f]++;
|
smpc_ram[0x2f]++;
|
||||||
|
|
||||||
@ -2583,9 +2583,9 @@ static TIMER_CALLBACK(stv_rtc_increment)
|
|||||||
|
|
||||||
// probably not SO precise, here just for reference ...
|
// probably not SO precise, here just for reference ...
|
||||||
/* year from 999 -> 1000 */
|
/* year from 999 -> 1000 */
|
||||||
//if((smpc_ram[0x23] & 0x0f) >= 0x0a) { smpc_ram[0x23]+=0x10; smpc_ram[0x23]&=0xf0; }
|
//if((smpc_ram[0x23] & 0x0f) >= 0x0a) { smpc_ram[0x23]+=0x10; smpc_ram[0x23]&=0xf0; }
|
||||||
/* year from 9999 -> 0 */
|
/* year from 9999 -> 0 */
|
||||||
//if((smpc_ram[0x23] & 0xf0) >= 0xa0) { smpc_ram[0x23] = 0; } //roll over
|
//if((smpc_ram[0x23] & 0xf0) >= 0xa0) { smpc_ram[0x23] = 0; } //roll over
|
||||||
}
|
}
|
||||||
|
|
||||||
static MACHINE_START( stv )
|
static MACHINE_START( stv )
|
||||||
|
@ -123,7 +123,7 @@ MACHINE_DRIVER_END
|
|||||||
|
|
||||||
#define TAITOTZ_BIOS \
|
#define TAITOTZ_BIOS \
|
||||||
ROM_LOAD32_WORD_SWAP( "e68-05-1.ic6", 0x000000, 0x080000, CRC(6ad9b006) SHA1(f05a0ae26b6abaeda9c7944aee96c72b08fff7a5) ) \
|
ROM_LOAD32_WORD_SWAP( "e68-05-1.ic6", 0x000000, 0x080000, CRC(6ad9b006) SHA1(f05a0ae26b6abaeda9c7944aee96c72b08fff7a5) ) \
|
||||||
ROM_LOAD32_WORD_SWAP( "e68-04-1.ic5", 0x000002, 0x080000, CRC(c7c2dc6b) SHA1(bf88c818166c285130c5c73d6982f009da26e143) )
|
ROM_LOAD32_WORD_SWAP( "e68-04-1.ic5", 0x000002, 0x080000, CRC(c7c2dc6b) SHA1(bf88c818166c285130c5c73d6982f009da26e143) )
|
||||||
|
|
||||||
|
|
||||||
ROM_START( taitotz )
|
ROM_START( taitotz )
|
||||||
@ -160,8 +160,8 @@ ROM_START( batlgear )
|
|||||||
TAITOTZ_BIOS
|
TAITOTZ_BIOS
|
||||||
|
|
||||||
ROM_REGION( 0x40000, "io_cpu", 0 )
|
ROM_REGION( 0x40000, "io_cpu", 0 )
|
||||||
ROM_LOAD16_BYTE( "e68-07.ic14", 0x000000, 0x020000, CRC(554c6fd7) SHA1(9f203dead81c7ccf73d7fd462cab147cd17f890f) )
|
ROM_LOAD16_BYTE( "e68-07.ic14", 0x000000, 0x020000, CRC(554c6fd7) SHA1(9f203dead81c7ccf73d7fd462cab147cd17f890f) )
|
||||||
ROM_LOAD16_BYTE( "e68-08.ic15", 0x000001, 0x020000, CRC(f1932380) SHA1(64d12e858af15a9ba8254917da13863ac7c9c050) )
|
ROM_LOAD16_BYTE( "e68-08.ic15", 0x000001, 0x020000, CRC(f1932380) SHA1(64d12e858af15a9ba8254917da13863ac7c9c050) )
|
||||||
|
|
||||||
ROM_REGION( 0x10000, "sound_cpu", 0 ) /* Internal ROM :( */
|
ROM_REGION( 0x10000, "sound_cpu", 0 ) /* Internal ROM :( */
|
||||||
ROM_LOAD( "e68-01.ic7", 0x000000, 0x010000, NO_DUMP )
|
ROM_LOAD( "e68-01.ic7", 0x000000, 0x010000, NO_DUMP )
|
||||||
@ -175,8 +175,8 @@ ROM_START( batlgr2 )
|
|||||||
TAITOTZ_BIOS
|
TAITOTZ_BIOS
|
||||||
|
|
||||||
ROM_REGION( 0x40000, "io_cpu", 0 )
|
ROM_REGION( 0x40000, "io_cpu", 0 )
|
||||||
ROM_LOAD16_BYTE( "e87-03.ic14", 0x000000, 0x020000, CRC(49ae7cd0) SHA1(15f07a6bb2044a85a2139481f1dc95a44520c929) )
|
ROM_LOAD16_BYTE( "e87-03.ic14", 0x000000, 0x020000, CRC(49ae7cd0) SHA1(15f07a6bb2044a85a2139481f1dc95a44520c929) )
|
||||||
ROM_LOAD16_BYTE( "e87-04.ic15", 0x000001, 0x020000, CRC(59f8f75f) SHA1(f5595751b10c0033f460114c43f5e2c192fe61f1) )
|
ROM_LOAD16_BYTE( "e87-04.ic15", 0x000001, 0x020000, CRC(59f8f75f) SHA1(f5595751b10c0033f460114c43f5e2c192fe61f1) )
|
||||||
|
|
||||||
ROM_REGION( 0x10000, "sound_cpu", 0 ) /* Internal ROM :( */
|
ROM_REGION( 0x10000, "sound_cpu", 0 ) /* Internal ROM :( */
|
||||||
ROM_LOAD( "e68-01.ic7", 0x000000, 0x010000, NO_DUMP )
|
ROM_LOAD( "e68-01.ic7", 0x000000, 0x010000, NO_DUMP )
|
||||||
|
@ -1475,7 +1475,7 @@ ROM_END
|
|||||||
|
|
||||||
Mr. Kicker (c) SemiCom
|
Mr. Kicker (c) SemiCom
|
||||||
|
|
||||||
SEMICOM-003b
|
SEMICOM-003b
|
||||||
|
|
||||||
+---------------------------------------------+
|
+---------------------------------------------+
|
||||||
| +------+ |
|
| +------+ |
|
||||||
|
@ -465,7 +465,7 @@ ROM_START( unkmeyco )
|
|||||||
ROM_LOAD( "k3", 0x2800, 0x0800, CRC(9cd6b843) SHA1(fb9c5c5ba96ebb75dc42e7c891d6da2a8a1ea6c1) )
|
ROM_LOAD( "k3", 0x2800, 0x0800, CRC(9cd6b843) SHA1(fb9c5c5ba96ebb75dc42e7c891d6da2a8a1ea6c1) )
|
||||||
ROM_LOAD( "k2", 0x3000, 0x0800, CRC(5f82eafa) SHA1(4f5a4dc773ceae9a69ec532166047867db4ddadf) )
|
ROM_LOAD( "k2", 0x3000, 0x0800, CRC(5f82eafa) SHA1(4f5a4dc773ceae9a69ec532166047867db4ddadf) )
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
/*************************************
|
||||||
*
|
*
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user