|
46 | 46 | #include "speaker.h" |
47 | 47 | #include "utf8.h" |
48 | 48 |
|
| 49 | + |
49 | 50 | void pc8001_base_state::crtc_reverse_w(int state) |
50 | 51 | { |
51 | 52 | // rvv acts as a global flip for reverse attribute meaning |
@@ -723,6 +724,31 @@ void pc8001mk2sr_state::machine_reset() |
723 | 724 | //membank("bank2")->set_entry(2); |
724 | 725 | } |
725 | 726 |
|
| 727 | +/* Snapquik */ |
| 728 | + |
| 729 | +SNAPSHOT_LOAD_MEMBER(pc8001_state::snapshot_cb) |
| 730 | +{ |
| 731 | + if (m_ram->size() < 0x10000) |
| 732 | + return std::make_pair(image_error::UNSUPPORTED, std::string("Configured RAM size must be 64K")); |
| 733 | + |
| 734 | + if (image.length() > 0x8000) |
| 735 | + return std::make_pair(image_error::INVALIDLENGTH, std::string()); |
| 736 | + |
| 737 | + uint8_t *ram = m_ram->pointer(); |
| 738 | + |
| 739 | + std::vector<u8> snapshot(image.length()); |
| 740 | + image.fread(&snapshot[0], image.length()); |
| 741 | + |
| 742 | + std::copy(std::begin(snapshot), std::end(snapshot), &ram[0x8000]); |
| 743 | + m_maincpu->set_state_int(Z80_SP, ram[0xff3e] | (ram[0xff3f] << 8)); |
| 744 | + m_maincpu->set_pc(0xff3d); |
| 745 | + |
| 746 | + //m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); |
| 747 | + |
| 748 | + return std::make_pair(std::error_condition(), std::string()); |
| 749 | +} |
| 750 | + |
| 751 | + |
726 | 752 | /* Machine Drivers */ |
727 | 753 |
|
728 | 754 | void pc8001_state::pc8001(machine_config &config) |
@@ -778,6 +804,9 @@ void pc8001_state::pc8001(machine_config &config) |
778 | 804 |
|
779 | 805 | RAM(config, RAM_TAG).set_default_size("16K").set_extra_options("32K,64K"); |
780 | 806 |
|
| 807 | + snapshot_image_device &snapshot(SNAPSHOT(config, "snapshot", "bin,n80", attotime::from_seconds(1))); |
| 808 | + snapshot.set_load_callback(FUNC(pc8001_state::snapshot_cb)); |
| 809 | + |
781 | 810 | SOFTWARE_LIST(config, "disk_n_list").set_original("pc8001_flop"); |
782 | 811 |
|
783 | 812 | /* sound hardware */ |
|
0 commit comments