(MESS) cd2650 : some more tidy up (nw)

This commit is contained in:
Robbbert 2013-10-23 15:09:30 +00:00
parent a31774ab7c
commit 47fc2d3989

View File

@ -2,22 +2,29 @@
// copyright-holders:Robbbert
/***************************************************************************
Central Data cd2650
Central Data cd2650
2010-04-08 Skeleton driver.
2010-04-08 Skeleton driver.
No info available on this computer apart from a few newsletters.
The system only uses 1000-14FF for videoram and 17F0-17FF for
scratch ram. All other ram is optional.
No info available on this computer apart from a few newsletters.
The system only uses 1000-14FF for videoram and 17F0-17FF for
scratch ram. All other ram is optional.
All commands must be in upper case. See the RAVENS2 driver for
a list of the monitor commands. Some commands have slightly different
numeric inputs, and the D command doesn't seem to work.
Commands (must be in uppercase):
A Examine memory; press C to alter memory
B Set breakpoint?
C View breakpoint?
D Dump to tape
E Execute
I ?
L Load
R ?
V Verify?
Press Esc to exit most commands.
TODO
- Lots, probably. The computer is a complete mystery. No pictures,
manuals or schematics exist.
- Cassette interface to be tested - no idea what the command syntax is for saving.
TODO
- Lots, probably. The computer is a complete mystery. No manuals or schematics exist.
- Cassette doesn't work.
****************************************************************************/
@ -34,11 +41,11 @@ class cd2650_state : public driver_device
{
public:
cd2650_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_p_videoram(*this, "videoram"),
m_beep(*this, "beeper"),
m_cass(*this, "cassette")
: driver_device(mconfig, type, tag)
, m_p_videoram(*this, "videoram")
, m_maincpu(*this, "maincpu")
, m_beep(*this, "beeper")
, m_cass(*this, "cassette")
{ }
DECLARE_READ8_MEMBER(keyin_r);
@ -46,14 +53,15 @@ public:
DECLARE_WRITE8_MEMBER(kbd_put);
DECLARE_READ8_MEMBER(cass_r);
DECLARE_WRITE8_MEMBER(cass_w);
DECLARE_QUICKLOAD_LOAD_MEMBER( cd2650 );
DECLARE_QUICKLOAD_LOAD_MEMBER(cd2650);
const UINT8 *m_p_chargen;
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_shared_ptr<UINT8> m_p_videoram;
private:
UINT8 m_term_data;
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_shared_ptr<const UINT8> m_p_videoram;
required_device<beep_device> m_beep;
required_device<cassette_image_device> m_cass;
};
@ -84,8 +92,7 @@ READ8_MEMBER( cd2650_state::keyin_r )
static ADDRESS_MAP_START(cd2650_mem, AS_PROGRAM, 8, cd2650_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x0000, 0x03ff) AM_ROM
AM_RANGE( 0x0400, 0x0fff) AM_RAM
AM_RANGE( 0x0000, 0x03ff) AM_ROM AM_REGION("roms", 0)
AM_RANGE( 0x1000, 0x7fff) AM_RAM AM_SHARE("videoram")
ADDRESS_MAP_END
@ -163,15 +170,15 @@ UINT32 cd2650_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
/* F4 Character Displayer */
static const gfx_layout cd2650_charlayout =
{
8, 8, /* 8 x 12 characters */
64, /* 256 characters */
8, 8, /* 8 x 8 characters */
192, /* 64 characters in char.rom + 128 characters in char2.rom */
1, /* 1 bits per pixel */
{ 0 }, /* no bitplanes */
/* x offsets */
{ 0, 1, 2, 3, 4, 5, 6, 7 },
/* y offsets */
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 /* every char takes 16 bytes */
8*8 /* every char takes 8 bytes */
};
static GFXDECODE_START( cd2650 )
@ -191,29 +198,23 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
QUICKLOAD_LOAD_MEMBER( cd2650_state, cd2650 )
{
address_space &space = m_maincpu->space(AS_PROGRAM);
int i;
int quick_addr = 0x440;
int exec_addr;
int quick_length;
UINT8 *quick_data;
int read_;
int result = IMAGE_INIT_FAIL;
int i, result = IMAGE_INIT_FAIL;
quick_length = image.length();
if (quick_length < 0x0444)
int quick_length = image.length();
if (quick_length < 0x1500)
{
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too short");
image.message(" File too short");
}
else if (quick_length > 0x8000)
else
if (quick_length > 0x8000)
{
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too long");
image.message(" File too long");
}
else
{
quick_data = (UINT8*)malloc(quick_length);
UINT8 *quick_data = (UINT8*)malloc(quick_length);
if (!quick_data)
{
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Cannot open file");
@ -221,20 +222,21 @@ QUICKLOAD_LOAD_MEMBER( cd2650_state, cd2650 )
}
else
{
read_ = image.fread( quick_data, quick_length);
int read_ = image.fread( quick_data, quick_length);
if (read_ != quick_length)
{
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Cannot read the file");
image.message(" Cannot read the file");
}
else if (quick_data[0] != 0x40)
else
if (quick_data[0] != 0x40)
{
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Invalid header");
image.message(" Invalid header");
}
else
{
exec_addr = quick_data[1] * 256 + quick_data[2];
int exec_addr = quick_data[1] * 256 + quick_data[2];
if (exec_addr >= quick_length)
{
@ -243,24 +245,17 @@ QUICKLOAD_LOAD_MEMBER( cd2650_state, cd2650 )
}
else
{
read_ = 0x1000;
if (quick_length < 0x1000)
read_ = quick_length;
for (i = quick_addr; i < read_; i++)
space.write_byte(i, quick_data[i]);
// do not overwite system area (17E0-17FF) otherwise chess3 has problems
read_ = 0x17e0;
if (quick_length < 0x17e0)
read_ = quick_length;
if (quick_length > 0x14ff)
for (i = 0x1500; i < read_; i++)
space.write_byte(i, quick_data[i]);
for (i = 0x1500; i < read_; i++)
m_p_videoram[i-0x1000] = quick_data[i];
if (quick_length > 0x17ff)
for (i = 0x1800; i < quick_length; i++)
space.write_byte(i, quick_data[i]);
m_p_videoram[i-0x1000] = quick_data[i];
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr);
@ -296,42 +291,40 @@ static MACHINE_CONFIG_START( cd2650, cd2650_state )
MCFG_PALETTE_LENGTH(2)
MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", cd2650_state, cd2650, "pgm", 1)
/* cassette */
MCFG_CASSETTE_ADD( "cassette", default_cassette_interface )
/* Sound */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("beeper", BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* Devices */
MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
MCFG_CASSETTE_ADD( "cassette", default_cassette_interface )
MACHINE_CONFIG_END
/* ROM definition */
ROM_START( cd2650 )
ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF )
ROM_REGION( 0x0400, "roms", 0 )
ROM_LOAD( "cd2650.rom", 0x0000, 0x0400, CRC(5397328e) SHA1(7106fdb60e1ad2bc5e8e45527f348c23296e8d6a))
ROM_REGION( 0x0200, "chargen", 0 )
ROM_REGION( 0x0600, "chargen", 0 )
ROM_LOAD( "char.rom", 0x0000, 0x0200, CRC(9b75db2a) SHA1(4367c01afa503d7cba0c38078fde0b95392c6c2c))
ROM_LOAD_OPTIONAL( "char2.rom", 0x0200, 0x0400, CRC(b450eea8) SHA1(c1bdba52c2dc5698cad03b6b884b942a083465ed)) // not used
// various unused roms found on Amigan site
ROM_REGION( 0xea00, "user1", 0 )
ROM_LOAD( "char2.rom", 0x0000, 0x0400, CRC(b450eea8) SHA1(c1bdba52c2dc5698cad03b6b884b942a083465ed))
ROM_LOAD( "supervisor.bin", 0x0400, 0x03ff, CRC(2bcbced4) SHA1(cec7582ba0a908d4ef39f9bd6bfa33a282b88c71))
ROM_LOAD( "01a_cd_boots.bin", 0x6c00, 0x0200, CRC(5336c62f) SHA1(e94cf7be01ea806ff7c7b90aee1a4e88f4f1ba9f))
ROM_LOAD( "01a_cd_dos.bin", 0x1000, 0x2000, CRC(3f177cdd) SHA1(01afd77ad2f065158cbe032aa26682cb20afe7d8))
ROM_LOAD( "01a_cd_pop.bin", 0x3000, 0x1000, CRC(d8f44f11) SHA1(605ab5a045290fa5b99ff4fc8fbfa2a3f202578f))
ROM_LOAD( "01b_cd_alp.bin", 0x4000, 0x2a00, CRC(b05568bb) SHA1(29e74633c0cd731c0be25313288cfffdae374236))
ROM_LOAD( "01b_cd_basic.bin", 0x7000, 0x3b00, CRC(0cf1e3d8) SHA1(3421e679c238aeea49cd170b34a6f344da4770a6))
ROM_LOAD( "01b_cd_mon_m.bin", 0x0800, 0x0400, CRC(f6f19c08) SHA1(1984d85d57fc2a6c5a3bd51fbc58540d7129a0ae))
ROM_LOAD( "01b_cd_mon_o.bin", 0x0c00, 0x0400, CRC(9d40b4dc) SHA1(35cffcbd983b7b37c878a15af44100568d0659d1))
ROM_LOAD( "02b_cd_alp.bin", 0xc000, 0x2a00, CRC(a66b7f32) SHA1(2588f9244b0ec6b861dcebe666d37d3fa88dd043))
ROM_REGION( 0xc900, "user1", 0 )
ROM_LOAD_OPTIONAL( "01a_cd_boots.bin", 0x0000, 0x0200, CRC(5336c62f) SHA1(e94cf7be01ea806ff7c7b90aee1a4e88f4f1ba9f))
ROM_LOAD_OPTIONAL( "01a_cd_dos.bin", 0x0200, 0x2000, CRC(3f177cdd) SHA1(01afd77ad2f065158cbe032aa26682cb20afe7d8))
ROM_LOAD_OPTIONAL( "01a_cd_pop.bin", 0x2200, 0x1000, CRC(d8f44f11) SHA1(605ab5a045290fa5b99ff4fc8fbfa2a3f202578f))
ROM_LOAD_OPTIONAL( "01b_cd_alp.bin", 0x3200, 0x2a00, CRC(b05568bb) SHA1(29e74633c0cd731c0be25313288cfffdae374236))
ROM_LOAD_OPTIONAL( "01b_cd_basic.bin", 0x5c00, 0x3b00, CRC(0cf1e3d8) SHA1(3421e679c238aeea49cd170b34a6f344da4770a6))
ROM_LOAD_OPTIONAL( "01b_cd_mon_m.bin", 0x9700, 0x0400, CRC(f6f19c08) SHA1(1984d85d57fc2a6c5a3bd51fbc58540d7129a0ae))
ROM_LOAD_OPTIONAL( "01b_cd_mon_o.bin", 0x9b00, 0x0400, CRC(9d40b4dc) SHA1(35cffcbd983b7b37c878a15af44100568d0659d1))
ROM_LOAD_OPTIONAL( "02b_cd_alp.bin", 0x9f00, 0x2a00, CRC(a66b7f32) SHA1(2588f9244b0ec6b861dcebe666d37d3fa88dd043))
ROM_END
/* Driver */