trunk/src/mess/drivers/cp1.c
| r22676 | r22677 | |
| 14 | 14 | #include "cpu/mcs48/mcs48.h" |
| 15 | 15 | #include "machine/i8155.h" |
| 16 | 16 | #include "imagedev/cassette.h" |
| 17 | #include "imagedev/snapquik.h" |
| 17 | 18 | #include "cp1.lh" |
| 18 | 19 | |
| 19 | 20 | class cp1_state : public driver_device |
| r22676 | r22677 | |
| 53 | 54 | DECLARE_WRITE8_MEMBER(port1_w); |
| 54 | 55 | DECLARE_WRITE8_MEMBER(port2_w); |
| 55 | 56 | DECLARE_WRITE8_MEMBER(putbus); |
| 57 | DECLARE_QUICKLOAD_LOAD_MEMBER(quickload); |
| 56 | 58 | |
| 57 | 59 | DECLARE_READ8_MEMBER(i8155_read); |
| 58 | 60 | DECLARE_WRITE8_MEMBER(i8155_write); |
| r22676 | r22677 | |
| 266 | 268 | m_cassette->change_state(CASSETTE_STOPPED, CASSETTE_MASK_UISTATE); |
| 267 | 269 | } |
| 268 | 270 | |
| 271 | QUICKLOAD_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 | |
| 269 | 293 | static I8155_INTERFACE( i8155_intf ) |
| 270 | 294 | { |
| 271 | 295 | DEVCB_NULL, // port A read |
| r22676 | r22677 | |
| 299 | 323 | MCFG_DEFAULT_LAYOUT(layout_cp1) |
| 300 | 324 | |
| 301 | 325 | MCFG_CASSETTE_ADD("cassette", default_cassette_interface) |
| 326 | |
| 327 | MCFG_QUICKLOAD_ADD("quickload", cp1_state, quickload, "obj", 1) |
| 302 | 328 | MACHINE_CONFIG_END |
| 303 | 329 | |
| 304 | 330 | /* ROM definition */ |