Previous 199869 Revisions Next

r22677 Sunday 5th May, 2013 at 08:36:32 UTC by Sandro Ronco
(MESS) cp1: added quickload. (nw)
[src/mess/drivers]cp1.c

trunk/src/mess/drivers/cp1.c
r22676r22677
1414#include "cpu/mcs48/mcs48.h"
1515#include "machine/i8155.h"
1616#include "imagedev/cassette.h"
17#include "imagedev/snapquik.h"
1718#include "cp1.lh"
1819
1920class cp1_state : public driver_device
r22676r22677
5354   DECLARE_WRITE8_MEMBER(port1_w);
5455   DECLARE_WRITE8_MEMBER(port2_w);
5556   DECLARE_WRITE8_MEMBER(putbus);
57   DECLARE_QUICKLOAD_LOAD_MEMBER(quickload);
5658
5759   DECLARE_READ8_MEMBER(i8155_read);
5860   DECLARE_WRITE8_MEMBER(i8155_write);
r22676r22677
266268   m_cassette->change_state(CASSETTE_STOPPED, CASSETTE_MASK_UISTATE);
267269}
268270
271QUICKLOAD_LOAD_MEMBER( cp1_state, quickload )
272{
273   UINT8 *dest = (UINT8*)m_i8155->space().get_read_ptr(0);
274   char line[0x10];
275   int addr = 0;
276   while (image.fgets(line, 10) && addr < 0x100)
277   {
278      int op = 0, arg = 0;
279      if (sscanf(line, "%d.%d", &op, &arg) == 2)
280      {
281         dest[addr++] = op;
282         dest[addr++] = arg;
283      }
284      else
285      {
286         return IMAGE_INIT_FAIL;
287      }
288   }
289
290   return IMAGE_INIT_PASS;
291}
292
269293static I8155_INTERFACE( i8155_intf )
270294{
271295   DEVCB_NULL,                                       // port A read
r22676r22677
299323   MCFG_DEFAULT_LAYOUT(layout_cp1)
300324
301325   MCFG_CASSETTE_ADD("cassette", default_cassette_interface)
326
327   MCFG_QUICKLOAD_ADD("quickload", cp1_state, quickload, "obj", 1)
302328MACHINE_CONFIG_END
303329
304330/* ROM definition */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team