示例#1
0
void TTL74123_config(int which, const TTL74123_interface *intf)
{
	TTL74123_state *chip;

	assert_always(which < MAX_TTL74123, "Exceeded maximum number of 74123 chips");
	assert_always(intf, "No interface specified");
	assert_always((intf->connection_type == TTL74123_GROUNDED) && (intf->cap >= CAP_U(0.01)), "Only capacitors >= 0.01uF supported for GROUNDED type");
	assert_always(intf->cap >= CAP_P(1000), "Only capacitors >= 1000pF supported ");

	chip = &chips[which];

	chip->intf = intf;
	chip->which = which;
	chip->timer = timer_alloc(clear_callback, chip);

	/* start with the defaults */
	chip->A = intf->A;
    chip->B = intf->B;
	chip->clear = intf->clear;

	/* register for state saving */
	state_save_register_item("TTL74123", which, chip->A);
	state_save_register_item("TTL74123", which, chip->B);
	state_save_register_item("TTL74123", which, chip->clear);
}
示例#2
0
void timer_init(running_machine *machine)
{
	timer_private *global;
	int i;

	/* allocate global data */
	global = machine->timer_data = auto_alloc_clear(machine, timer_private);

	/* we need to wait until the first call to timer_cyclestorun before using real CPU times */
	global->exec.basetime = attotime_zero;
	global->exec.nextfire = attotime_never;
	global->exec.curquantum = DEFAULT_MINIMUM_QUANTUM;
	global->callback_timer = NULL;
	global->callback_timer_modified = FALSE;

	/* register with the save state system */
	state_save_register_item(machine, "timer", NULL, 0, global->exec.basetime.seconds);
	state_save_register_item(machine, "timer", NULL, 0, global->exec.basetime.attoseconds);
	state_save_register_postload(machine, timer_postload, NULL);

	/* initialize the lists */
	global->activelist = NULL;
	global->freelist = &global->timers[0];
	for (i = 0; i < MAX_TIMERS-1; i++)
		global->timers[i].next = &global->timers[i+1];
	global->timers[MAX_TIMERS-1].next = NULL;
	global->freelist_tail = &global->timers[MAX_TIMERS-1];

	/* reset the quanta */
	global->quantum_list[0].requested = DEFAULT_MINIMUM_QUANTUM;
	global->quantum_list[0].actual = DEFAULT_MINIMUM_QUANTUM;
	global->quantum_list[0].expire = attotime_never;
	global->quantum_current = &global->quantum_list[0];
	global->quantum_minimum = ATTOSECONDS_IN_NSEC(1) / 1000;
}
示例#3
0
void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb)
{
	memset(&microtouch, 0, sizeof(microtouch));

	microtouch.last_touch_state = -1;
	microtouch.tx_callback = tx_cb;
	microtouch.touch_callback = touch_cb;

	microtouch.timer = timer_alloc(machine, microtouch_timer_callback, NULL);
	timer_adjust_periodic(microtouch.timer, ATTOTIME_IN_HZ(167*5), 0, ATTOTIME_IN_HZ(167*5));

	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.reset_done);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.format_tablet);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.mode_inactive);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.mode_stream);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_touch_state);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_x);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_y);
	state_save_register_item_array(machine, "microtouch", NULL, 0, microtouch.rx_buffer);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.rx_buffer_ptr);
	state_save_register_item_array(machine, "microtouch", NULL, 0, microtouch.tx_buffer);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.tx_buffer_num);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.tx_buffer_ptr);

};
示例#4
0
void timer_init(running_machine *machine)
{
	int i;

	/* we need to wait until the first call to timer_cyclestorun before using real CPU times */
	global_basetime = attotime_zero;
	callback_timer = NULL;
	callback_timer_modified = FALSE;

	/* register with the save state system */
	state_save_push_tag(0);
	state_save_register_item("timer", 0, global_basetime.seconds);
	state_save_register_item("timer", 0, global_basetime.attoseconds);
	state_save_register_postload(machine, timer_postload, NULL);
	state_save_pop_tag();

	/* reset the timers */
	memset(timers, 0, sizeof(timers));

	/* initialize the lists */
	timer_head = NULL;
	timer_free_head = &timers[0];
	for (i = 0; i < MAX_TIMERS-1; i++)
		timers[i].next = &timers[i+1];
	timers[MAX_TIMERS-1].next = NULL;
	timer_free_tail = &timers[MAX_TIMERS-1];
}
示例#5
0
void x76f100_init( running_machine *machine, int chip, UINT8 *data )
{
    int offset;
    struct x76f100_chip *c;

    if( chip >= X76F100_MAXCHIP )
    {
        verboselog( machine, 0, "x76f100_init( %d ) chip out of range\n", chip );
        return;
    }

    c = &x76f100[ chip ];

    if( data == NULL )
    {
        data = auto_alloc_array( machine, UINT8,
                                 SIZE_RESPONSE_TO_RESET +
                                 SIZE_READ_PASSWORD +
                                 SIZE_WRITE_PASSWORD +
                                 SIZE_DATA );
    }

    c->cs = 0;
    c->rst = 0;
    c->scl = 0;
    c->sdaw = 0;
    c->sdar = 0;
    c->state = STATE_STOP;
    c->shift = 0;
    c->bit = 0;
    c->byte = 0;
    c->command = 0;
    memset( c->write_buffer, 0, SIZE_WRITE_BUFFER );

    offset = 0;
    c->response_to_reset = &data[ offset ];
    offset += SIZE_RESPONSE_TO_RESET;
    c->write_password = &data[ offset ];
    offset += SIZE_WRITE_PASSWORD;
    c->read_password = &data[ offset ];
    offset += SIZE_READ_PASSWORD;
    c->data = &data[ offset ];
    offset += SIZE_DATA;

    state_save_register_item( machine, "x76f100", NULL, chip, c->cs );
    state_save_register_item( machine, "x76f100", NULL, chip, c->rst );
    state_save_register_item( machine, "x76f100", NULL, chip, c->scl );
    state_save_register_item( machine, "x76f100", NULL, chip, c->sdaw );
    state_save_register_item( machine, "x76f100", NULL, chip, c->sdar );
    state_save_register_item( machine, "x76f100", NULL, chip, c->state );
    state_save_register_item( machine, "x76f100", NULL, chip, c->shift );
    state_save_register_item( machine, "x76f100", NULL, chip, c->bit );
    state_save_register_item( machine, "x76f100", NULL, chip, c->byte );
    state_save_register_item( machine, "x76f100", NULL, chip, c->command );
    state_save_register_item_array( machine, "x76f100", NULL, chip, c->write_buffer );
    state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->response_to_reset, SIZE_RESPONSE_TO_RESET );
    state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->write_password, SIZE_WRITE_PASSWORD );
    state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->read_password, SIZE_READ_PASSWORD );
    state_save_register_item_pointer( machine, "x76f100", NULL, chip, c->data, SIZE_DATA );
}
示例#6
0
文件: bsx.c 项目: jiangzhonghui/mame
BSX_base::BSX_base(running_machine &machine)
			: m_machine(machine)
{
	state_save_register_item(machine, "SNES_BSX", NULL, 0, regs);
	state_save_register_item(machine, "SNES_BSX", NULL, 0, r2192_counter);
	state_save_register_item(machine, "SNES_BSX", NULL, 0, r2192_hour);
	state_save_register_item(machine, "SNES_BSX", NULL, 0, r2192_second);
}
示例#7
0
void intelflash_init(int chip, int type, void *data)
{
	struct flash_chip *c;
	if( chip >= FLASH_CHIPS_MAX )
	{
		logerror( "intelflash_init: invalid chip %d\n", chip );
		return;
	}
	c = &chips[ chip ];

	c->type = type;
	switch( c->type )
	{
	case FLASH_INTEL_28F016S5:
		c->bits = 8;
		c->size = 0x200000;
		c->maker_id = 0x89;
		c->device_id = 0xaa;
		break;
	case FLASH_SHARP_LH28F400:
		c->bits = 16;
		c->size = 0x80000;
		c->maker_id = 0xb0;
		c->device_id = 0xed;
		break;
	case FLASH_FUJITSU_29F016A:
		c->bits = 8;
		c->size = 0x200000;
		c->maker_id = 0x04;
		c->device_id = 0xad;
		break;
	case FLASH_INTEL_E28F008SA:
		c->bits = 8;
		c->size = 0x100000;
		c->maker_id = 0x89;
		c->device_id = 0xa2;
		break;
	case FLASH_INTEL_TE28F160:
		c->bits = 16;
		c->size = 0x200000;
		c->maker_id = 0xb0;
		c->device_id = 0xd0;
		break;
	}
	if( data == NULL )
	{
		data = auto_malloc( c->size );
		memset( data, 0xff, c->size );
	}

	c->flash_mode = FM_NORMAL;
	c->flash_master_lock = 0;
	c->flash_memory = data;

	state_save_register_item( "intelfsh", chip, c->flash_mode );
	state_save_register_item( "intelfsh", chip, c->flash_master_lock );
	state_save_register_memory( "intelfsh", chip, "flash_memory", c->flash_memory, c->bits/8, c->size / (c->bits/8) );
}
示例#8
0
static void arm_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
	arm.irq_callback = irqcallback;

	state_save_register_item_array("arm", index, arm.sArmRegister);
	state_save_register_item_array("arm", index, arm.coproRegister);
	state_save_register_item("arm", index, arm.pendingIrq);
	state_save_register_item("arm", index, arm.pendingFiq);
}
示例#9
0
static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
	running_machine *machine = scsiInstance->machine;
	SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );

	state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
	state_save_register_item( machine, "scsidev", diskregion, 0, our_this->commandLength );
	state_save_register_item( machine, "scsidev", diskregion, 0, our_this->phase );
}
示例#10
0
void microtouch_init(running_machine &machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb)
{
	memset(&microtouch, 0, sizeof(microtouch));

	microtouch.last_touch_state = -1;
	microtouch.tx_callback = tx_cb;
	microtouch.touch_callback = touch_cb;

	microtouch.timer = machine.scheduler().timer_alloc(FUNC(microtouch_timer_callback));
	microtouch.timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5));

	microtouch.format = FORMAT_UNKNOWN;
	microtouch.mode = MODE_INACTIVE;

	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.reset_done);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_touch_state);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_x);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.last_y);
	state_save_register_item_array(machine, "microtouch", NULL, 0, microtouch.rx_buffer);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.rx_buffer_ptr);
	state_save_register_item_array(machine, "microtouch", NULL, 0, microtouch.tx_buffer);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.tx_buffer_num);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.tx_buffer_ptr);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.format);
	state_save_register_item(machine, "microtouch", NULL, 0, microtouch.mode);
};
示例#11
0
文件: 7474.c 项目: nitrologic/emu
void TTL7474_config(running_machine *machine, int which, const struct TTL7474_interface *intf)
{
	if (which >= MAX_TTL7474)
	{
		logerror("Only %d 7474's are supported at this time.\n", MAX_TTL7474);
		return;
	}


    chips[which].output_cb = (intf ? intf->output_cb : 0);

	/* all inputs are open first */
    chips[which].clear = 1;
    chips[which].preset = 1;
    chips[which].clock = 1;
    chips[which].d = 1;

    chips[which].last_clock = 1;
    chips[which].last_output = -1;
    chips[which].last_output_comp = -1;

    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].clear);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].preset);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].clock);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].d);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].output);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].output_comp);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].last_clock);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].last_output);
    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].last_output_comp);
}
示例#12
0
void watchdog_init(running_machine *machine)
{
	/* allocate a timer for the watchdog */
	watchdog_timer = timer_alloc(machine, watchdog_callback, NULL);

	add_reset_callback(machine, watchdog_internal_reset);

	/* save some stuff in the default tag */
	state_save_register_item(machine, "watchdog", NULL, 0, watchdog_enabled);
	state_save_register_item(machine, "watchdog", NULL, 0, watchdog_counter);
}
示例#13
0
static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
	running_machine *machine = scsiInstance->machine;
	SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );

	our_this->download = 0;
	memcpy( &our_this->buffer[ identity_offset ], "MATSHITACD-ROM CR-589   GS0N", 28 );

	state_save_register_item( machine,  "cr589", diskregion, 0, our_this->download );
	state_save_register_item_array( machine,  "cr589", diskregion, 0, our_this->buffer );
	state_save_register_item( machine,  "cr589", diskregion, 0, our_this->bufferOffset );
}
示例#14
0
void v810_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
	v810.irq_line = CLEAR_LINE;
	v810.nmi_line = CLEAR_LINE;
	v810.irq_cb = irqcallback;

	state_save_register_item_array("v810", index, v810.reg);
	state_save_register_item("v810", index, v810.irq_line);
	state_save_register_item("v810", index, v810.nmi_line);
	state_save_register_item("v810", index, v810.PPC);

}
示例#15
0
void psxrcnt_device::device_start()
{
	int n;

	for( n = 0; n < 3; n++ )
	{
		root_counter[ n ].timer = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( psxrcnt_device::root_finished ), this ) );
		state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_count );
		state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_mode );
		state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_target );
		state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_start );
	}
}
示例#16
0
void taitoair_state::machine_start()
{
	membank("z80bank")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);

	save_item(NAME(m_q.col));
	save_item(NAME(m_q.pcount));

	for (int i = 0; i < TAITOAIR_POLY_MAX_PT; i++)
	{
		state_save_register_item(machine(), "globals", NULL, i, m_q.p[i].x);
		state_save_register_item(machine(), "globals", NULL, i, m_q.p[i].y);
	}
}
示例#17
0
void sam_init(const sam6883_interface *intf)
{
	sam.state = 0;
	sam.old_state = ~0;
	sam.intf = intf;

	add_reset_callback(sam_reset);

	/* save state registration */
	state_save_register_item("6883sam", 0, sam.state);
	state_save_register_item("6883sam", 0, sam.video_position);
	state_save_register_func_postload(update_sam);
}
示例#18
0
void Stepper_init(int id, int type)
{
	if ( id < MAX_STEPPERS )
	{
		steppers[id].index_pos   = 16;
		steppers[id].index_len   = 8;
		steppers[id].index_patt  = 0x09;
		steppers[id].pattern     = 0;
		steppers[id].old_pattern = 0;
		steppers[id].step_pos    = 0;
		steppers[id].max_steps   = (48*2);
		steppers[id].type		 = type;

		switch ( steppers[id].type )
		{
			case STARPOINT_48STEP_REEL :  // STARPOINT RMxxx
			break;
			case BARCREST_48STEP_REEL :	  // Barcrest reel units have different coil windings and optic tabs
			Stepper_set_index(id,0,16,0x09);
			break;
			case STARPOINT_144STEPS_DICE :// STARPOINT 1DCU DICE mechanism
			steppers[id].max_steps = (144*2);
			break;
		}
		state_save_register_item("Stepper", id, steppers[id].index_pos);
		state_save_register_item("Stepper", id, steppers[id].index_len);
		state_save_register_item("Stepper", id, steppers[id].index_patt);
		state_save_register_item("Stepper", id, steppers[id].pattern);
		state_save_register_item("Stepper", id, steppers[id].old_pattern);
		state_save_register_item("Stepper", id, steppers[id].step_pos);
		state_save_register_item("Stepper", id, steppers[id].max_steps);
		state_save_register_item("Stepper", id, steppers[id].type);
	}
}
示例#19
0
文件: adc080x.c 项目: cdenix/psmame
static DEVICE_START( adc080x )
{
	adc080x_t *adc080x = get_safe_token(device);

	/* validate arguments */
	assert(device != NULL);
	assert(device->tag() != NULL);

	adc080x->intf = (const adc080x_interface*)device->baseconfig().static_config();

	assert(adc080x->intf != NULL);
	assert(device->clock() > 0);

	/* set initial values */
	adc080x->eoc = 1;

	/* allocate cycle timer */
	adc080x->cycle_timer = device->machine().scheduler().timer_alloc(FUNC(cycle_tick), (void *)device);
	adc080x->cycle_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock()));

	/* register for state saving */
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->address);
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->ale);
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->start);
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->eoc);
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->next_eoc);
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->sar);
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->cycle);
	state_save_register_item(device->machine(), "adc080x", device->tag(), 0, adc080x->bit);
}
示例#20
0
static void timer_register_save(emu_timer *timer)
{
	char buf[256];
	int count = 0;
	emu_timer *t;

	/* find other timers that match our func name */
	for (t = timer_head; t; t = t->next)
		if (!strcmp(t->func, timer->func))
			count++;

	/* make up a name */
	sprintf(buf, "timer.%s", timer->func);

	/* use different instances to differentiate the bits */
	state_save_push_tag(0);
	state_save_register_item(buf, count, timer->param);
	state_save_register_item(buf, count, timer->enabled);
	state_save_register_item(buf, count, timer->period.seconds);
	state_save_register_item(buf, count, timer->period.attoseconds);
	state_save_register_item(buf, count, timer->start.seconds);
	state_save_register_item(buf, count, timer->start.attoseconds);
	state_save_register_item(buf, count, timer->expire.seconds);
	state_save_register_item(buf, count, timer->expire.attoseconds);
	state_save_pop_tag();
}
示例#21
0
void z80ctc_init(int which, z80ctc_interface *intf)
{
	z80ctc *ctc = &ctcs[which];

	assert(which < MAX_CTC);

	memset(ctc, 0, sizeof(*ctc));

	ctc->clock = intf->baseclock;
	ctc->invclock16 = 16.0 / (double)intf->baseclock;
	ctc->invclock256 = 256.0 / (double)intf->baseclock;
	ctc->notimer = intf->notimer;
	ctc->intr = intf->intr;
	ctc->timer[0] = timer_alloc(timercallback);
	ctc->timer[1] = timer_alloc(timercallback);
	ctc->timer[2] = timer_alloc(timercallback);
	ctc->timer[3] = timer_alloc(timercallback);
	ctc->zc[0] = intf->zc0;
	ctc->zc[1] = intf->zc1;
	ctc->zc[2] = intf->zc2;
	ctc->zc[3] = 0;
	z80ctc_reset(which);

    state_save_register_item("z80ctc", which, ctc->vector);
    state_save_register_item_array("z80ctc", which, ctc->mode);
    state_save_register_item_array("z80ctc", which, ctc->tconst);
    state_save_register_item_array("z80ctc", which, ctc->down);
    state_save_register_item_array("z80ctc", which, ctc->extclk);
    state_save_register_item_array("z80ctc", which, ctc->int_state);
}
示例#22
0
sound_stream *stream_create(device_t *device, int inputs, int outputs, int sample_rate, void *param, stream_update_func callback)
{
	running_machine *machine = device->machine;
	streams_private *strdata = machine->streams_data;
	int inputnum, outputnum;
	sound_stream *stream;
	char statetag[30];

	/* allocate memory */
	stream = auto_alloc_clear(device->machine, sound_stream);

	VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream));

	/* fill in the data */
	stream->device = device;
	stream->index = strdata->stream_index++;
	stream->sample_rate = sample_rate;
	stream->inputs = inputs;
	stream->outputs = outputs;
	stream->callback = callback;
	stream->param = param;

	/* create a unique tag for saving */
	sprintf(statetag, "%d", stream->index);
	state_save_register_item(machine, "stream", statetag, 0, stream->sample_rate);

	/* allocate space for the inputs */
	if (inputs > 0)
	{
		stream->input = auto_alloc_array_clear(device->machine, stream_input, inputs);
		stream->input_array = auto_alloc_array_clear(device->machine, stream_sample_t *, inputs);
	}
示例#23
0
struct crtc6845 *crtc6845_init(const struct crtc6845_config *config)
{
	struct crtc6845 *crtc;
	int idx;

	crtc = auto_malloc(sizeof(struct crtc6845));
	memset(crtc, 0, sizeof(*crtc));
	crtc->cursor_time = timer_get_time();
	crtc->config = *config;
	crtc6845 = crtc;

	/* Hardwire the values which can't be changed in the PC1512 version */
	if (config->personality == M6845_PERSONALITY_PC1512)
	{
		for (idx = 0; idx < sizeof(pc1512_defaults); idx++)
		{
			crtc->reg[idx] = pc1512_defaults[idx];
		}
	}

	state_save_register_item_array("crtc6845", 0, crtc->reg);
	state_save_register_item("crtc6845", 0, crtc->idx);
	state_save_register_func_postload(crtc6845_state_postload);
	return crtc;
}
示例#24
0
void at28c16_init( int chip, UINT8 *data, UINT8 *id )
{
	struct at28c16_chip *c;
	if( chip >= MAX_AT28C16_CHIPS )
	{
		logerror( "at28c16_init: invalid chip %d\n", chip );
		return;
	}
	c = &at28c16[ chip ];

	c->a9_12v = 0;

	if( data == NULL )
	{
		data = auto_malloc( SIZE_DATA );
	}

	if( id == NULL )
	{
		id = auto_malloc( SIZE_ID );
	}

	c->data = data;
	c->id = id;

	state_save_register_item_pointer( "at28c16", chip, c->data, SIZE_DATA );
	state_save_register_item_pointer( "at28c16", chip, c->id, SIZE_ID );
	state_save_register_item( "at28c16", chip, c->a9_12v );
}
示例#25
0
static DEVICE_START( ttl74145 )
{
	const ttl74145_interface *intf = (const ttl74145_interface *)device->static_config();
	ttl74145_t *ttl74145 = get_safe_token(device);

	/* validate arguments */
	assert(device->static_config() != NULL);

	/* initialize with 0 */
	ttl74145->number = 0;

	/* resolve callbacks */
	ttl74145->output_line_0.resolve(intf->output_line_0, *device);
	ttl74145->output_line_1.resolve(intf->output_line_1, *device);
	ttl74145->output_line_2.resolve(intf->output_line_2, *device);
	ttl74145->output_line_3.resolve(intf->output_line_3, *device);
	ttl74145->output_line_4.resolve(intf->output_line_4, *device);
	ttl74145->output_line_5.resolve(intf->output_line_5, *device);
	ttl74145->output_line_6.resolve(intf->output_line_6, *device);
	ttl74145->output_line_7.resolve(intf->output_line_7, *device);
	ttl74145->output_line_8.resolve(intf->output_line_8, *device);
	ttl74145->output_line_9.resolve(intf->output_line_9, *device);

	/* register for state saving */
	state_save_register_item(device->machine(), "ttl74145", device->tag(), 0, ttl74145->number);
}
示例#26
0
static void tms7000_init(int index, int clock, const void *config, int (*irqcallback)(int))
{
	int cpu = cpu_getactivecpu();

	tms7000.irq_callback = irqcallback;

	memset(tms7000.pf, 0, 0x100);
	memset(tms7000.rf, 0, 0x80);

	/* Save register state */
	state_save_register_item("tms7000", cpu, pPC);
	state_save_register_item("tms7000", cpu, pSP);
	state_save_register_item("tms7000", cpu, pSR);

	/* Save Interrupt state */
	state_save_register_item_array("tms7000", cpu, tms7000.irq_state);

	/* Save register and perpherial file state */
	state_save_register_item_array("tms7000", cpu, tms7000.rf);
	state_save_register_item_array("tms7000", cpu, tms7000.pf);

	/* Save timer state */
	state_save_register_item("tms7000", cpu, tms7000.t1_prescaler);
	state_save_register_item("tms7000", cpu, tms7000.t1_capture_latch);
	state_save_register_item("tms7000", cpu, tms7000.t1_decrementer);

	state_save_register_item("tms7000", cpu, tms7000.idle_state);

	tms7000.irq_callback = irqcallback;
}
示例#27
0
void init_konami_cgboard(running_machine *machine, int num_boards, int type)
{
	int i;
	num_cgboards = num_boards;

	for (i=0; i < num_boards; i++)
	{
		dsp_comm_ppc[i][0] = 0x00;
		dsp_shared_ram[i] = auto_alloc_array(machine, UINT32, DSP_BANK_SIZE * 2/4);
		dsp_shared_ram_bank[i] = 0;

		dsp_state[i] = 0x80;
		texture_bank[i] = -1;

		pci_bridge_enable[i] = 0;
		nwk_device_sel[i] = 0;
		nwk_fifo_read_ptr[i] = 0;
		nwk_fifo_write_ptr[i] = 0;

		nwk_fifo[i] = auto_alloc_array(machine, UINT32, 0x800);
		nwk_ram[i] = auto_alloc_array(machine, UINT32, 0x2000);

		state_save_register_item_array(machine, "konppc", NULL, i, dsp_comm_ppc[i]);
		state_save_register_item_array(machine, "konppc", NULL, i, dsp_comm_sharc[i]);
		state_save_register_item(machine, "konppc", NULL, i, dsp_shared_ram_bank[i]);
		state_save_register_item_pointer(machine, "konppc", NULL, i, dsp_shared_ram[i], DSP_BANK_SIZE * 2 / sizeof(dsp_shared_ram[i][0]));
		state_save_register_item(machine, "konppc", NULL, i, dsp_state[i]);
		state_save_register_item(machine, "konppc", NULL, i, texture_bank[i]);
		state_save_register_item(machine, "konppc", NULL, i, pci_bridge_enable[i]);
		state_save_register_item(machine, "konppc", NULL, i, nwk_device_sel[i]);
		state_save_register_item(machine, "konppc", NULL, i, nwk_fifo_read_ptr[i]);
		state_save_register_item(machine, "konppc", NULL, i, nwk_fifo_write_ptr[i]);
		state_save_register_item_pointer(machine, "konppc", NULL, i, nwk_fifo[i], 0x800);
		state_save_register_item_pointer(machine, "konppc", NULL, i, nwk_ram[i], 0x2000);
	}
	state_save_register_item(machine, "konppc", NULL, 0, cgboard_id);
	cgboard_type = type;

	if (type == CGBOARD_TYPE_NWKTR)
	{
		nwk_fifo_half_full_r = 0x100;
		nwk_fifo_half_full_w = 0xff;
		nwk_fifo_full = 0x1ff;
		nwk_fifo_mask = 0x1ff;
	}
	if (type == CGBOARD_TYPE_HANGPLT)
	{
		nwk_fifo_half_full_r = 0x3ff;
		nwk_fifo_half_full_w = 0x400;
		nwk_fifo_full = 0x7ff;
		nwk_fifo_mask = 0x7ff;
	}
}
示例#28
0
void taitoair_state::machine_start()
{
	UINT8 *ROM = memregion("audiocpu")->base();
	int i;

	membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);

	save_item(NAME(m_banknum));
	save_item(NAME(m_q.col));
	save_item(NAME(m_q.pcount));

	for (i = 0; i < TAITOAIR_POLY_MAX_PT; i++)
	{
		state_save_register_item(machine(), "globals", NULL, i, m_q.p[i].x);
		state_save_register_item(machine(), "globals", NULL, i, m_q.p[i].y);
	}

	machine().save().register_postload(save_prepost_delegate(FUNC(taitoair_state::reset_sound_region), this));
}
示例#29
0
void stepper_config(running_machine &machine, int which, const stepper_interface *intf)
{
	assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call stepper_config at init time!");
	assert_always((which >= 0) && (which < MAX_STEPPERS), "stepper_config called on an invalid stepper motor!");
	assert_always(intf, "stepper_config called with an invalid interface!");

	step[which].intf = intf;

	step[which].type = intf->type;
	step[which].index_start = intf->index_start;/* location of first index value in half steps */
	step[which].index_end	= intf->index_end;	/* location of last index value in half steps */
	step[which].index_patt	= intf->index_patt; /* hex value of coil pattern (0 if not needed)*/
	step[which].reverse     = intf->reverse;
	step[which].phase       = 0;
	step[which].pattern     = 0;
	step[which].old_pattern = 0;
	step[which].step_pos    = 0;


	switch ( step[which].type )
	{	default:
		case STARPOINT_48STEP_REEL:  /* STARPOINT RMxxx */
		case BARCREST_48STEP_REEL :  /* Barcrest Reel unit */
		case MPU3_48STEP_REEL :
		step[which].max_steps = (48*2);
		break;
		case STARPOINT_144STEPS_DICE :/* STARPOINT 1DCU DICE mechanism */
		step[which].max_steps = (144*2);
		break;
	}

	state_save_register_item(machine, "stepper", NULL, which, step[which].index_start);
	state_save_register_item(machine, "stepper", NULL, which, step[which].index_end);
	state_save_register_item(machine, "stepper", NULL, which, step[which].index_patt);
	state_save_register_item(machine, "stepper", NULL, which, step[which].phase);
	state_save_register_item(machine, "stepper", NULL, which, step[which].pattern);
	state_save_register_item(machine, "stepper", NULL, which, step[which].old_pattern);
	state_save_register_item(machine, "stepper", NULL, which, step[which].step_pos);
	state_save_register_item(machine, "stepper", NULL, which, step[which].max_steps);
	state_save_register_item(machine, "stepper", NULL, which, step[which].type);
	state_save_register_item(machine, "stepper", NULL, which, step[which].reverse);
}
示例#30
0
/***************************************************************************
  ticket_dispenser_init

***************************************************************************/
void ticket_dispenser_init(int msec, int motoronhigh, int statusactivehigh)
{
	int i;

	time_msec			= msec;
	motoron				= motoronhigh  ? active_bit : 0;
	ticketdispensed		= statusactivehigh ? active_bit : 0;
	ticketnotdispensed	= ticketdispensed ^ active_bit;
	dispensed_tickets	= 0;

	for (i = 0; i < MAX_DISPENSERS; i++)
	{
		dispenser[i].status	= ticketnotdispensed;
		dispenser[i].power 	= 0x00;
		dispenser[i].timer 	= timer_alloc(ticket_dispenser_toggle);

		state_save_register_item("ticket", i, dispenser[i].status);
		state_save_register_item("ticket", i, dispenser[i].power);
	}
}