diff options
Diffstat (limited to 'src/mame/drivers/xerox820.cpp')
-rw-r--r-- | src/mame/drivers/xerox820.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/src/mame/drivers/xerox820.cpp b/src/mame/drivers/xerox820.cpp index 340ff5a3afc..a83089253ad 100644 --- a/src/mame/drivers/xerox820.cpp +++ b/src/mame/drivers/xerox820.cpp @@ -386,10 +386,60 @@ static const z80_daisy_config xerox820_daisy_chain[] = { nullptr } }; + + +/*********************************************************** + + Quickload + + This loads a .COM file to address 0x100 then jumps + there. Sometimes .COM has been renamed to .CPM to + prevent windows going ballistic. These can be loaded + as well. + +************************************************************/ + +QUICKLOAD_LOAD_MEMBER( xerox820_state, xerox820 ) +{ + address_space& prog_space = m_maincpu->space(AS_PROGRAM); + + if (quickload_size >= 0xfd00) + return image_init_result::FAIL; + + bankswitch(0); + + /* Avoid loading a program if CP/M-80 is not in memory */ + if ((prog_space.read_byte(0) != 0xc3) || (prog_space.read_byte(5) != 0xc3)) + { + machine_reset(); + return image_init_result::FAIL; + } + + /* Load image to the TPA (Transient Program Area) */ + for (uint16_t i = 0; i < quickload_size; i++) + { + uint8_t data; + if (image.fread( &data, 1) != 1) + return image_init_result::FAIL; + prog_space.write_byte(i+0x100, data); + } + + /* clear out command tail */ + prog_space.write_byte(0x80, 0); prog_space.write_byte(0x81, 0); + + /* Roughly set SP basing on the BDOS position */ + m_maincpu->set_state_int(Z80_SP, 256 * prog_space.read_byte(7) - 300); + m_maincpu->set_pc(0x100); // start program + + return image_init_result::PASS; +} + + + /* WD1771 Interface */ static SLOT_INTERFACE_START( xerox820_floppies ) - SLOT_INTERFACE( "sa400", FLOPPY_525_SSSD_35T ) // Shugart SA-400 + SLOT_INTERFACE( "sa400", FLOPPY_525_SSSD ) // Shugart SA-400 SLOT_INTERFACE( "sa450", FLOPPY_525_DD ) // Shugart SA-450 SLOT_INTERFACE( "sa800", FLOPPY_8_SSDD ) // Shugart SA-800 SLOT_INTERFACE( "sa850", FLOPPY_8_DSDD ) // Shugart SA-850 @@ -616,6 +666,7 @@ MACHINE_CONFIG_START(xerox820_state::xerox820) // software lists MCFG_SOFTWARE_LIST_ADD("flop_list", "xerox820") + MCFG_QUICKLOAD_ADD("quickload", xerox820_state, xerox820, "com,cpm", 3) MACHINE_CONFIG_END MACHINE_CONFIG_START(bigboard_state::bigboard) @@ -719,6 +770,7 @@ MACHINE_CONFIG_START(xerox820ii_state::xerox820ii) // software lists MCFG_SOFTWARE_LIST_ADD("flop_list", "xerox820ii") + MCFG_QUICKLOAD_ADD("quickload", xerox820_state, xerox820, "com,cpm", 3) MACHINE_CONFIG_END MACHINE_CONFIG_START(xerox820ii_state::xerox168) |