mirror of
https://github.com/holub/mame
synced 2025-05-28 16:43:04 +03:00
(MESS) cybiko: added quickload support. (nw)
This commit is contained in:
parent
6bc5e8a3d6
commit
89ddd7a69e
@ -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
|
||||
|
||||
|
||||
|
@ -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_ */
|
||||
|
@ -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();
|
||||
|
@ -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<cybiko_state>();
|
||||
|
||||
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<cybiko_state>();
|
||||
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 //
|
||||
///////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user