summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/qx10.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/qx10.cpp')
-rw-r--r--src/mame/drivers/qx10.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp
index e52a0bfc346..d08236ce272 100644
--- a/src/mame/drivers/qx10.cpp
+++ b/src/mame/drivers/qx10.cpp
@@ -48,6 +48,7 @@
#include "screen.h"
#include "softlist.h"
+#include "imagedev/snapquik.h"
#define MAIN_CLK 15974400
@@ -131,6 +132,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(keyboard_clk);
DECLARE_WRITE_LINE_MEMBER(keyboard_irq);
+ DECLARE_QUICKLOAD_LOAD_MEMBER(qx10);
+
uint8_t *m_char_rom;
/* FDD */
@@ -326,6 +329,54 @@ WRITE8_MEMBER( qx10_state::cmos_sel_w )
update_memory_mapping();
}
+/***********************************************************
+
+ 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( qx10_state, qx10 )
+{
+ address_space& prog_space = m_maincpu->space(AS_PROGRAM);
+
+ if (quickload_size >= 0xfd00)
+ return image_init_result::FAIL;
+
+ /* The right RAM bank must be active */
+ m_membank = 0;
+ update_memory_mapping();
+
+ /* 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;
+}
+
/*
FDD
*/
@@ -780,6 +831,9 @@ MACHINE_CONFIG_START(qx10_state::qx10)
// software lists
MCFG_SOFTWARE_LIST_ADD("flop_list", "qx10_flop")
+
+ MCFG_QUICKLOAD_ADD("quickload", qx10_state, qx10, "com,cpm", 3)
+
MACHINE_CONFIG_END
/* ROM definition */