src/mess/drivers/mbee.c
| r2446 | r2447 | |
| 349 | 349 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 350 | 350 | |
| 351 | 351 | /* devices */ |
| 352 | | MDRV_SNAPSHOT_ADD(mbee, "mwb", 0.5) |
| 352 | MDRV_SNAPSHOT_ADD(mbee, "mwb,com", 0.5) |
| 353 | 353 | MDRV_Z80BIN_QUICKLOAD_ADD(mbee, 0) |
| 354 | 354 | MACHINE_DRIVER_END |
| 355 | 355 | |
| r2446 | r2447 | |
| 467 | 467 | UINT16 i, j; |
| 468 | 468 | UINT8 data, sw = input_port_read(image->machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 469 | 469 | |
| 470 | | for (i = 0; i < snapshot_size; i++) |
| 470 | /* mwb files - standard basic files */ |
| 471 | |
| 472 | if ((!(strcmp(image_filetype(image),"mwb"))) || (!(strcmp(image_filetype(image),"MWB")))) |
| 471 | 473 | { |
| 472 | | j = (0x8c0 + i) & 0xffff; |
| 474 | for (i = 0; i < snapshot_size; i++) |
| 475 | { |
| 476 | j = 0x8c0 + i; |
| 473 | 477 | |
| 474 | | if (image_fread(image, &data, 1) != 1) return INIT_FAIL; |
| 478 | if (image_fread(image, &data, 1) != 1) return INIT_FAIL; |
| 475 | 479 | |
| 476 | | if ((j < mbee_size) || (j > 0xefff)) program_write_byte(j, data); |
| 480 | if ((j < mbee_size) || (j > 0xefff)) |
| 481 | program_write_byte(j, data); |
| 482 | else |
| 483 | return INIT_FAIL; |
| 484 | } |
| 485 | |
| 486 | if (sw) |
| 487 | { |
| 488 | program_write_word_16le(0xa2,0x801e); /* fix warm-start vector to get around some copy-protections */ |
| 489 | cpunum_set_reg(0, REG_PC, 0x801e); |
| 490 | } |
| 491 | else |
| 492 | program_write_word_16le(0xa2,0x8517); |
| 477 | 493 | } |
| 494 | else |
| 478 | 495 | |
| 479 | | if (sw) |
| 496 | /* com files - most com files are just machine-language games with a wrapper and don't need cp/m to be present */ |
| 497 | |
| 498 | if ((!(strcmp(image_filetype(image),"com"))) || (!(strcmp(image_filetype(image),"COM")))) |
| 480 | 499 | { |
| 481 | | program_write_word_16le(0xa2,0x801e); /* fix warm-start vector to get around some copy-protections */ |
| 482 | | cpunum_set_reg(0, REG_PC, 0x801e); |
| 500 | for (i = 0; i < snapshot_size; i++) |
| 501 | { |
| 502 | j = 0x100 + i; |
| 503 | |
| 504 | if (image_fread(image, &data, 1) != 1) return INIT_FAIL; |
| 505 | |
| 506 | if ((j < mbee_size) || (j > 0xefff)) |
| 507 | program_write_byte(j, data); |
| 508 | else |
| 509 | return INIT_FAIL; |
| 510 | } |
| 511 | |
| 512 | if (sw) cpunum_set_reg(0, REG_PC, 0x100); |
| 483 | 513 | } |
| 484 | | else |
| 485 | | program_write_word_16le(0xa2,0x8517); |
| 486 | 514 | |
| 487 | 515 | return INIT_PASS; |
| 488 | 516 | } |
| 489 | 517 | |
| 518 | |
| 490 | 519 | static void mbee_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 491 | 520 | { |
| 492 | 521 | /* cassette */ |