modernized cybiko nvram and supported all models (nw)

This commit is contained in:
Miodrag Milanovic 2014-04-17 08:16:51 +00:00
parent 7194d57dab
commit 3f4c65b8ee
3 changed files with 8 additions and 31 deletions

View File

@ -18,7 +18,6 @@ ToDo:
#include "includes/cybiko.h"
#include "rendlay.h"
#include "mcfglgcy.h"
// +------------------------------------------------------+
// | Cybiko Classic (CY6411) | V2 |
@ -308,6 +307,8 @@ static MACHINE_CONFIG_START( cybikov1, cybiko_state )
MCFG_PCF8593_ADD("rtc")
MCFG_AT45DB041_ADD("flash1")
MCFG_NVRAM_ADD_0FILL("nvram")
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("512K")
@ -338,9 +339,7 @@ static MACHINE_CONFIG_DERIVED( cybikoxt, cybikov1)
MCFG_CPU_IO_MAP(cybikoxt_io )
// machine
MCFG_DEVICE_REMOVE("flash1")
MCFG_SST_39VF400A_ADD("flashxt")
MCFG_NVRAM_HANDLER( cybikoxt )
MCFG_SST_39VF400A_ADD("flashxt")
/* internal ram */
MCFG_RAM_MODIFY(RAM_TAG)

View File

@ -29,6 +29,7 @@
#include "machine/intelfsh.h"
#include "machine/ram.h"
#include "imagedev/snapquik.h"
#include "machine/nvram.h"
struct CYBIKO_RS232_PINS
{
@ -53,7 +54,8 @@ public:
m_speaker(*this, "speaker"),
m_rtc(*this, "rtc"),
m_ram(*this, RAM_TAG),
m_flash1(*this, "flash1")
m_flash1(*this, "flash1"),
m_nvram(*this, "nvram")
{ }
CYBIKO_RS232 m_rs232;
@ -85,6 +87,7 @@ public:
required_device<pcf8593_device> m_rtc;
required_device<ram_device> m_ram;
optional_device<at45db041_device> m_flash1;
required_device<nvram_device> m_nvram;
DECLARE_DRIVER_INIT(cybikoxt);
DECLARE_DRIVER_INIT(cybiko);
virtual void machine_start();
@ -94,6 +97,4 @@ public:
DECLARE_QUICKLOAD_LOAD_MEMBER( cybikoxt );
};
NVRAM_HANDLER( cybikoxt );
#endif /* CYBIKO_H_ */

View File

@ -58,30 +58,6 @@ QUICKLOAD_LOAD_MEMBER( cybiko_state, cybikoxt )
// MACHINE START //
///////////////////
NVRAM_HANDLER( cybikoxt )
{
address_space &space = machine.driver_data<cybiko_state>()->m_maincpu->space(AS_PROGRAM);
dynamic_buffer buffer(RAMDISK_SIZE);
if (read_or_write)
{
for (offs_t offs = 0; offs < RAMDISK_SIZE; offs++)
buffer[offs] = space.read_byte(0x400000 + offs);
file->write(buffer, RAMDISK_SIZE);
}
else
{
if (file)
file->read(buffer, RAMDISK_SIZE);
else
memset(buffer, 0, RAMDISK_SIZE);
for (offs_t offs = 0; offs < RAMDISK_SIZE; offs++)
space.write_byte(0x400000 + offs, buffer[offs]);
}
}
void cybiko_state::machine_start()
{
_logerror( 0, ("machine_start_cybikov1\n"));
@ -89,6 +65,7 @@ void cybiko_state::machine_start()
cybiko_rs232_init();
// other
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(cybiko_state::machine_stop_cybiko),this));
m_nvram->set_base(m_ram->pointer(), RAMDISK_SIZE);
}
///////////////////