Previous 199869 Revisions Next

r21106 Friday 15th February, 2013 at 22:02:15 UTC by Sandro Ronco
(MESS) cybiko: added quickload support. (nw)
[src/mess/drivers]cybiko.c
[src/mess/includes]cybiko.h
[src/mess/machine]at45dbxx.h cybiko.c

trunk/src/mess/drivers/cybiko.c
r21105r21106
328328   MCFG_RAM_ADD(RAM_TAG)
329329   MCFG_RAM_DEFAULT_SIZE("512K")
330330   MCFG_RAM_EXTRA_OPTIONS("1M")
331
332   /* quickload */
333   MCFG_QUICKLOAD_ADD("quickload", cybiko, "bin,nv", 0)
331334MACHINE_CONFIG_END
332335
333336static MACHINE_CONFIG_DERIVED( cybikov2, cybikov1)
r21105r21106
358361   /* internal ram */
359362   MCFG_RAM_MODIFY(RAM_TAG)
360363   MCFG_RAM_DEFAULT_SIZE("2M")
364
365   /* quickload */
366   MCFG_DEVICE_REMOVE("quickload")
367   MCFG_QUICKLOAD_ADD("quickload", cybikoxt, "bin,nv", 0)
361368MACHINE_CONFIG_END
362369
363370
trunk/src/mess/machine/at45dbxx.h
r21105r21106
4444   DECLARE_WRITE_LINE_MEMBER(si_w);
4545   DECLARE_READ_LINE_MEMBER(so_r);
4646
47   UINT8 *get_ptr() {  return m_data;  }
48
4749protected:
4850   // device-level overrides
4951   virtual void device_start();
trunk/src/mess/machine/cybiko.c
r21105r21106
3434   m_maincpu->space(AS_PROGRAM).install_ram(0x400000, 0x400000 + m_ram->size() - 1, 0, 0x200000 - m_ram->size(), m_ram->pointer());
3535}
3636
37QUICKLOAD_LOAD( cybiko )
38{
39   running_machine &machine = image.device().machine();
40   cybiko_state *state = machine.driver_data<cybiko_state>();
41
42   image.fread(state->m_flash1->get_ptr(), MIN(image.length(), 0x84000));
43
44   return IMAGE_INIT_PASS;
45}
46
47QUICKLOAD_LOAD( cybikoxt )
48{
49   running_machine &machine = image.device().machine();
50   cybiko_state *state = machine.driver_data<cybiko_state>();
51   address_space &dest = state->m_maincpu->space(AS_PROGRAM);
52   UINT32 size = MIN(image.length(), 0x84000);
53
54   UINT8 *buffer = global_alloc_array(UINT8, size);
55   image.fread(buffer, size);
56   for (int byte = 0; byte < size; byte++)
57      dest.write_byte(0x400000 + byte, buffer[byte]);
58   global_free(buffer);
59
60   return IMAGE_INIT_PASS;
61}
62
3763///////////////////
3864// MACHINE START //
3965///////////////////
trunk/src/mess/includes/cybiko.h
r21105r21106
2727#include "machine/at45dbxx.h"
2828#include "machine/intelfsh.h"
2929#include "machine/ram.h"
30#include "imagedev/snapquik.h"
3031
3132struct CYBIKO_RS232_PINS
3233{
r21105r21106
9899};
99100
100101NVRAM_HANDLER( cybikoxt );
102QUICKLOAD_LOAD( cybiko );
103QUICKLOAD_LOAD( cybikoxt );
101104
102105#endif /* CYBIKO_H_ */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team