mirror of
https://github.com/holub/mame
synced 2025-04-27 18:53:05 +03:00
modernized cybiko nvram and supported all models (nw)
This commit is contained in:
parent
7194d57dab
commit
3f4c65b8ee
@ -18,7 +18,6 @@ ToDo:
|
|||||||
|
|
||||||
#include "includes/cybiko.h"
|
#include "includes/cybiko.h"
|
||||||
#include "rendlay.h"
|
#include "rendlay.h"
|
||||||
#include "mcfglgcy.h"
|
|
||||||
|
|
||||||
// +------------------------------------------------------+
|
// +------------------------------------------------------+
|
||||||
// | Cybiko Classic (CY6411) | V2 |
|
// | Cybiko Classic (CY6411) | V2 |
|
||||||
@ -308,6 +307,8 @@ static MACHINE_CONFIG_START( cybikov1, cybiko_state )
|
|||||||
MCFG_PCF8593_ADD("rtc")
|
MCFG_PCF8593_ADD("rtc")
|
||||||
MCFG_AT45DB041_ADD("flash1")
|
MCFG_AT45DB041_ADD("flash1")
|
||||||
|
|
||||||
|
MCFG_NVRAM_ADD_0FILL("nvram")
|
||||||
|
|
||||||
/* internal ram */
|
/* internal ram */
|
||||||
MCFG_RAM_ADD(RAM_TAG)
|
MCFG_RAM_ADD(RAM_TAG)
|
||||||
MCFG_RAM_DEFAULT_SIZE("512K")
|
MCFG_RAM_DEFAULT_SIZE("512K")
|
||||||
@ -340,8 +341,6 @@ static MACHINE_CONFIG_DERIVED( cybikoxt, cybikov1)
|
|||||||
MCFG_DEVICE_REMOVE("flash1")
|
MCFG_DEVICE_REMOVE("flash1")
|
||||||
MCFG_SST_39VF400A_ADD("flashxt")
|
MCFG_SST_39VF400A_ADD("flashxt")
|
||||||
|
|
||||||
MCFG_NVRAM_HANDLER( cybikoxt )
|
|
||||||
|
|
||||||
/* internal ram */
|
/* internal ram */
|
||||||
MCFG_RAM_MODIFY(RAM_TAG)
|
MCFG_RAM_MODIFY(RAM_TAG)
|
||||||
MCFG_RAM_DEFAULT_SIZE("2M")
|
MCFG_RAM_DEFAULT_SIZE("2M")
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "machine/intelfsh.h"
|
#include "machine/intelfsh.h"
|
||||||
#include "machine/ram.h"
|
#include "machine/ram.h"
|
||||||
#include "imagedev/snapquik.h"
|
#include "imagedev/snapquik.h"
|
||||||
|
#include "machine/nvram.h"
|
||||||
|
|
||||||
struct CYBIKO_RS232_PINS
|
struct CYBIKO_RS232_PINS
|
||||||
{
|
{
|
||||||
@ -53,7 +54,8 @@ public:
|
|||||||
m_speaker(*this, "speaker"),
|
m_speaker(*this, "speaker"),
|
||||||
m_rtc(*this, "rtc"),
|
m_rtc(*this, "rtc"),
|
||||||
m_ram(*this, RAM_TAG),
|
m_ram(*this, RAM_TAG),
|
||||||
m_flash1(*this, "flash1")
|
m_flash1(*this, "flash1"),
|
||||||
|
m_nvram(*this, "nvram")
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
CYBIKO_RS232 m_rs232;
|
CYBIKO_RS232 m_rs232;
|
||||||
@ -85,6 +87,7 @@ public:
|
|||||||
required_device<pcf8593_device> m_rtc;
|
required_device<pcf8593_device> m_rtc;
|
||||||
required_device<ram_device> m_ram;
|
required_device<ram_device> m_ram;
|
||||||
optional_device<at45db041_device> m_flash1;
|
optional_device<at45db041_device> m_flash1;
|
||||||
|
required_device<nvram_device> m_nvram;
|
||||||
DECLARE_DRIVER_INIT(cybikoxt);
|
DECLARE_DRIVER_INIT(cybikoxt);
|
||||||
DECLARE_DRIVER_INIT(cybiko);
|
DECLARE_DRIVER_INIT(cybiko);
|
||||||
virtual void machine_start();
|
virtual void machine_start();
|
||||||
@ -94,6 +97,4 @@ public:
|
|||||||
DECLARE_QUICKLOAD_LOAD_MEMBER( cybikoxt );
|
DECLARE_QUICKLOAD_LOAD_MEMBER( cybikoxt );
|
||||||
};
|
};
|
||||||
|
|
||||||
NVRAM_HANDLER( cybikoxt );
|
|
||||||
|
|
||||||
#endif /* CYBIKO_H_ */
|
#endif /* CYBIKO_H_ */
|
||||||
|
@ -58,30 +58,6 @@ QUICKLOAD_LOAD_MEMBER( cybiko_state, cybikoxt )
|
|||||||
// MACHINE START //
|
// 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()
|
void cybiko_state::machine_start()
|
||||||
{
|
{
|
||||||
_logerror( 0, ("machine_start_cybikov1\n"));
|
_logerror( 0, ("machine_start_cybikov1\n"));
|
||||||
@ -89,6 +65,7 @@ void cybiko_state::machine_start()
|
|||||||
cybiko_rs232_init();
|
cybiko_rs232_init();
|
||||||
// other
|
// other
|
||||||
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(cybiko_state::machine_stop_cybiko),this));
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user