mirror of
https://github.com/holub/mame
synced 2025-05-29 09:03:08 +03:00
store firmware in nvram (nw)
This commit is contained in:
parent
b4590c6aeb
commit
00d110d825
@ -6,7 +6,8 @@
|
||||
const device_type SCSI_CR589 = &device_creator<scsi_cr589_device>;
|
||||
|
||||
scsi_cr589_device::scsi_cr589_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: scsicd_device(mconfig, SCSI_CR589, "SCSI CR589", tag, owner, clock, "scsi_cr589", __FILE__)
|
||||
: scsicd_device(mconfig, SCSI_CR589, "SCSI CR589", tag, owner, clock, "scsi_cr589", __FILE__),
|
||||
device_nvram_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -18,13 +19,51 @@ void scsi_cr589_device::device_start()
|
||||
scsicd_device::device_start();
|
||||
|
||||
download = 0;
|
||||
memcpy( &buffer[ identity_offset ], "MATSHITACD-ROM CR-589 GS0N", 28 );
|
||||
|
||||
save_item(NAME(download));
|
||||
save_item(NAME(buffer));
|
||||
save_item(NAME(bufferOffset));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// nvram_default - called to initialize NVRAM to
|
||||
// its default state
|
||||
//-------------------------------------------------
|
||||
|
||||
void scsi_cr589_device::nvram_default()
|
||||
{
|
||||
memset( buffer, 0, sizeof(buffer));
|
||||
memcpy( &buffer[ identity_offset ], "MATSHITACD-ROM CR-589 GS0N", 28 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// nvram_read - called to read NVRAM from the
|
||||
// .nv file
|
||||
//-------------------------------------------------
|
||||
|
||||
void scsi_cr589_device::nvram_read(emu_file &file)
|
||||
{
|
||||
file.read(buffer, sizeof(buffer));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// nvram_write - called to write NVRAM to the
|
||||
// .nv file
|
||||
//-------------------------------------------------
|
||||
|
||||
void scsi_cr589_device::nvram_write(emu_file &file)
|
||||
{
|
||||
file.write(buffer, sizeof(buffer));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void scsi_cr589_device::ExecCommand( int *transferLength )
|
||||
{
|
||||
switch( command[ 0 ] )
|
||||
|
@ -17,7 +17,8 @@
|
||||
#include "atapihle.h"
|
||||
#include "scsicd.h"
|
||||
|
||||
class scsi_cr589_device : public scsicd_device
|
||||
class scsi_cr589_device : public scsicd_device,
|
||||
public device_nvram_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -31,6 +32,11 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_nvram_interface overrides
|
||||
virtual void nvram_default();
|
||||
virtual void nvram_read(emu_file &file);
|
||||
virtual void nvram_write(emu_file &file);
|
||||
|
||||
private:
|
||||
int download;
|
||||
UINT8 buffer[ 65536 ];
|
||||
|
Loading…
Reference in New Issue
Block a user