summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/ds2401.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/machine/ds2401.c')
-rw-r--r--src/emu/machine/ds2401.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/emu/machine/ds2401.c b/src/emu/machine/ds2401.c
index cd3ebd52274..0d61bad2243 100644
--- a/src/emu/machine/ds2401.c
+++ b/src/emu/machine/ds2401.c
@@ -41,7 +41,7 @@ struct ds2401_chip
int shift;
int rx;
int tx;
- UINT8 *data;
+ const UINT8 *data;
emu_timer *timer;
emu_timer *reset_timer;
attotime t_samp;
@@ -138,15 +138,10 @@ static TIMER_CALLBACK( ds2401_tick )
}
}
-void ds2401_init( int which, UINT8 *data )
+void ds2401_init( int which, const UINT8 *data )
{
struct ds2401_chip *c = &ds2401[ which ];
- if( data == NULL )
- {
- data = auto_malloc( SIZE_DATA );
- }
-
c->state = STATE_IDLE;
c->bit = 0;
c->byte = 0;
@@ -166,7 +161,7 @@ void ds2401_init( int which, UINT8 *data )
state_save_register_item( "ds2401", which, c->shift );
state_save_register_item( "ds2401", which, c->rx );
state_save_register_item( "ds2401", which, c->tx );
- state_save_register_item_pointer( "ds2401", which, data, SIZE_DATA );
+ state_save_register_generic( "ds2401", which, "data", (UINT8 *)&data[0], data[0], SIZE_DATA );
c->timer = timer_alloc( ds2401_tick , NULL);
c->reset_timer = timer_alloc( ds2401_reset , NULL);