mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
QuikLoad option on CP/M-80 machines (#3368)
* QuickLoad option for the Decisionmate Loads .COM programs in memory if CPM-80 is loaded. Similar to the QuickLoad option for the Kaypro. * QuikLoad on Aussie Byte * QuikLoad on Aussie Byte * Safer QuikLoad on the DMV * Safer QuikLoad on Kaypro * Quikload on the QX-10 * Reverting to resolve conflicts with mamedev * Safer QuikLoad on the DecisionMate V * QuikLoad for the Aussie Byte * QuikLoad for the Epson QX-10 * QuikLoad for the Altos 5 * QuikLoad option for the Xerox 820 * Safer QuikLoad for the KayPro models * QuikLoad for the NCR DecisionMate * QuikLoad option for the Aussie Byte * QuikLoad for the QX-10 * QuikLoad for the Altos 5 * QuikLoad for the Xerox 820 * QuikLoad for the Aussie Byte * QuikLoad for the QX-10 * QuikLoad for the Altos 5 * QuikLoad for the Xerox820 + #3375
This commit is contained in:
parent
dbe56e3113
commit
8354ed9be3
@ -22,6 +22,9 @@
|
||||
#include "machine/clock.h"
|
||||
#include "softlist.h"
|
||||
|
||||
#include "imagedev/snapquik.h"
|
||||
|
||||
|
||||
class altos5_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -38,6 +41,8 @@ public:
|
||||
DECLARE_DRIVER_INIT(altos5);
|
||||
void altos5(machine_config &config);
|
||||
|
||||
DECLARE_QUICKLOAD_LOAD_MEMBER(altos5);
|
||||
|
||||
protected:
|
||||
DECLARE_READ8_MEMBER(memory_read_byte);
|
||||
DECLARE_WRITE8_MEMBER(memory_write_byte);
|
||||
@ -303,6 +308,55 @@ WRITE8_MEMBER( altos5_state::port09_w )
|
||||
setup_banks(2);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************
|
||||
|
||||
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( altos5_state, altos5 )
|
||||
{
|
||||
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
|
||||
|
||||
if (quickload_size >= 0xfd00)
|
||||
return image_init_result::FAIL;
|
||||
|
||||
setup_banks(2);
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
||||
static SLOT_INTERFACE_START( altos5_floppies )
|
||||
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
|
||||
SLOT_INTERFACE_END
|
||||
@ -422,6 +476,7 @@ MACHINE_CONFIG_START(altos5_state::altos5)
|
||||
MCFG_FLOPPY_DRIVE_SOUND(true)
|
||||
|
||||
MCFG_SOFTWARE_LIST_ADD("flop_list", "altos5")
|
||||
MCFG_QUICKLOAD_ADD("quickload", altos5_state, altos5, "com,cpm", 3)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -423,6 +423,57 @@ static SLOT_INTERFACE_START( aussiebyte_floppies )
|
||||
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
|
||||
/***********************************************************
|
||||
|
||||
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( aussiebyte_state, aussiebyte )
|
||||
{
|
||||
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
|
||||
|
||||
if (quickload_size >= 0xfd00)
|
||||
return image_init_result::FAIL;
|
||||
|
||||
/* RAM must be banked in */
|
||||
m_port15 = true; // disable boot rom
|
||||
m_port1a = 4;
|
||||
membank("bankr0")->set_entry(m_port1a); /* enable correct program bank */
|
||||
membank("bankw0")->set_entry(m_port1a);
|
||||
|
||||
/* 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) - 0x400);
|
||||
m_maincpu->set_pc(0x100); // start program
|
||||
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
|
||||
/***********************************************************
|
||||
|
||||
Machine Driver
|
||||
@ -540,6 +591,10 @@ MACHINE_CONFIG_START(aussiebyte_state::aussiebyte)
|
||||
MCFG_MC6845_ADDR_CHANGED_CB(aussiebyte_state, crtc_update_addr)
|
||||
|
||||
MCFG_MSM5832_ADD("rtc", XTAL(32'768))
|
||||
|
||||
/* quickload */
|
||||
MCFG_QUICKLOAD_ADD("quickload", aussiebyte_state, aussiebyte, "com,cpm", 3)
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -387,25 +387,27 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( dmv_state::hgdc_draw_text )
|
||||
|
||||
QUICKLOAD_LOAD_MEMBER( dmv_state, dmv )
|
||||
{
|
||||
uint16_t i;
|
||||
uint8_t data;
|
||||
|
||||
/* Avoid loading a program if CP/M-80 is not in memory */
|
||||
if ((m_ram->base()[0] != 0xc3) && (m_ram->base()[5] != 0xc3)) return image_init_result::FAIL;
|
||||
if ((m_ram->base()[0] != 0xc3) || (m_ram->base()[5] != 0xc3))
|
||||
return image_init_result::FAIL;
|
||||
|
||||
if (quickload_size >= 0xfd00)
|
||||
return image_init_result::FAIL;
|
||||
|
||||
/* Load image to the TPA (Transient Program Area) */
|
||||
for (i = 0; i < quickload_size; i++)
|
||||
for (uint16_t i = 0; i < quickload_size; i++)
|
||||
{
|
||||
if (image.fread( &data, 1) != 1) return image_init_result::FAIL;
|
||||
uint8_t data;
|
||||
if (image.fread( &data, 1) != 1)
|
||||
return image_init_result::FAIL;
|
||||
m_ram->base()[i+0x100] = data;
|
||||
}
|
||||
|
||||
m_ram->base()[0x80] = m_ram->base()[0x81] = 0; // clear out command tail
|
||||
|
||||
m_maincpu->set_pc(0x100); // start program
|
||||
m_maincpu->set_state_int(Z80_SP, 256 * m_ram->base()[7] - 300); // put the stack a bit before BDOS
|
||||
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
#include "video/mc6845.h"
|
||||
|
||||
#include "imagedev/snapquik.h"
|
||||
|
||||
|
||||
/***********************************************************
|
||||
|
||||
@ -62,6 +64,8 @@ public:
|
||||
|
||||
void aussiebyte(machine_config &config);
|
||||
|
||||
DECLARE_QUICKLOAD_LOAD_MEMBER(aussiebyte);
|
||||
|
||||
protected:
|
||||
DECLARE_READ8_MEMBER(memory_read_byte);
|
||||
DECLARE_WRITE8_MEMBER(memory_write_byte);
|
||||
|
@ -252,21 +252,30 @@ MACHINE_RESET_MEMBER( kaypro_state,kaypro )
|
||||
QUICKLOAD_LOAD_MEMBER( kaypro_state, kaypro )
|
||||
{
|
||||
uint8_t *RAM = memregion("rambank")->base();
|
||||
uint16_t i;
|
||||
uint8_t data;
|
||||
|
||||
/* Avoid loading a program if CP/M-80 is not in memory */
|
||||
if ((RAM[0] != 0xc3) || (RAM[5] != 0xc3))
|
||||
return image_init_result::FAIL;
|
||||
|
||||
if (quickload_size >= 0xfd00)
|
||||
return image_init_result::FAIL;
|
||||
|
||||
/* Load image to the TPA (Transient Program Area) */
|
||||
for (i = 0; i < quickload_size; i++)
|
||||
for (uint16_t i = 0; i < quickload_size; i++)
|
||||
{
|
||||
if (image.fread( &data, 1) != 1) return image_init_result::FAIL;
|
||||
|
||||
uint8_t data;
|
||||
if (image.fread( &data, 1) != 1)
|
||||
return image_init_result::FAIL;
|
||||
RAM[i+0x100] = data;
|
||||
}
|
||||
|
||||
|
||||
membank("bankr0")->set_entry(0);
|
||||
membank("bank3")->set_entry(0);
|
||||
RAM[0x80]=0; // clear out command tail
|
||||
RAM[0x81]=0;
|
||||
m_maincpu->set_pc(0x100); // start program
|
||||
RAM[0x80]=0; RAM[0x81]=0; // clear out command tail
|
||||
|
||||
m_maincpu->set_pc(0x100); // start program
|
||||
m_maincpu->set_state_int(Z80_SP, 256 * RAM[7] - 300); // put the stack a bit before BDOS
|
||||
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user