diff --git a/src/mess/drivers/cybiko.c b/src/mess/drivers/cybiko.c index 18b3e795ddc..39d2762a28c 100644 --- a/src/mess/drivers/cybiko.c +++ b/src/mess/drivers/cybiko.c @@ -328,6 +328,9 @@ static MACHINE_CONFIG_START( cybikov1, cybiko_state ) MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("512K") MCFG_RAM_EXTRA_OPTIONS("1M") + + /* quickload */ + MCFG_QUICKLOAD_ADD("quickload", cybiko, "bin,nv", 0) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( cybikov2, cybikov1) @@ -358,6 +361,10 @@ static MACHINE_CONFIG_DERIVED( cybikoxt, cybikov1) /* internal ram */ MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("2M") + + /* quickload */ + MCFG_DEVICE_REMOVE("quickload") + MCFG_QUICKLOAD_ADD("quickload", cybikoxt, "bin,nv", 0) MACHINE_CONFIG_END diff --git a/src/mess/includes/cybiko.h b/src/mess/includes/cybiko.h index 4d375abee53..be7abdd01e9 100644 --- a/src/mess/includes/cybiko.h +++ b/src/mess/includes/cybiko.h @@ -27,6 +27,7 @@ #include "machine/at45dbxx.h" #include "machine/intelfsh.h" #include "machine/ram.h" +#include "imagedev/snapquik.h" struct CYBIKO_RS232_PINS { @@ -98,5 +99,7 @@ public: }; NVRAM_HANDLER( cybikoxt ); +QUICKLOAD_LOAD( cybiko ); +QUICKLOAD_LOAD( cybikoxt ); #endif /* CYBIKO_H_ */ diff --git a/src/mess/machine/at45dbxx.h b/src/mess/machine/at45dbxx.h index 31b47d9be44..1cc85cccadd 100644 --- a/src/mess/machine/at45dbxx.h +++ b/src/mess/machine/at45dbxx.h @@ -44,6 +44,8 @@ public: DECLARE_WRITE_LINE_MEMBER(si_w); DECLARE_READ_LINE_MEMBER(so_r); + UINT8 *get_ptr() { return m_data; } + protected: // device-level overrides virtual void device_start(); diff --git a/src/mess/machine/cybiko.c b/src/mess/machine/cybiko.c index 3aa75bed7ae..6c89289533b 100644 --- a/src/mess/machine/cybiko.c +++ b/src/mess/machine/cybiko.c @@ -34,6 +34,32 @@ DRIVER_INIT_MEMBER(cybiko_state,cybikoxt) m_maincpu->space(AS_PROGRAM).install_ram(0x400000, 0x400000 + m_ram->size() - 1, 0, 0x200000 - m_ram->size(), m_ram->pointer()); } +QUICKLOAD_LOAD( cybiko ) +{ + running_machine &machine = image.device().machine(); + cybiko_state *state = machine.driver_data(); + + image.fread(state->m_flash1->get_ptr(), MIN(image.length(), 0x84000)); + + return IMAGE_INIT_PASS; +} + +QUICKLOAD_LOAD( cybikoxt ) +{ + running_machine &machine = image.device().machine(); + cybiko_state *state = machine.driver_data(); + address_space &dest = state->m_maincpu->space(AS_PROGRAM); + UINT32 size = MIN(image.length(), 0x84000); + + UINT8 *buffer = global_alloc_array(UINT8, size); + image.fread(buffer, size); + for (int byte = 0; byte < size; byte++) + dest.write_byte(0x400000 + byte, buffer[byte]); + global_free(buffer); + + return IMAGE_INIT_PASS; +} + /////////////////// // MACHINE START // ///////////////////