mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
(nw) ccs300: cleanup, fixed regression from 2018.
This commit is contained in:
parent
5986c7b80f
commit
b846a31d12
@ -2,9 +2,9 @@
|
||||
// copyright-holders:Robbbert
|
||||
/***************************************************************************
|
||||
|
||||
CCS Model 300
|
||||
CCS Model 300 / 400
|
||||
|
||||
2009-12-11 Skeleton driver.
|
||||
2009-12-11 Skeleton driver.
|
||||
|
||||
It requires a floppy disk to boot from.
|
||||
|
||||
@ -13,9 +13,13 @@ The bankswitching appears to be the same as CCS's other systems.
|
||||
Early on, it does a read from port F2. If bit 3 is low, the system becomes
|
||||
a Model 400.
|
||||
|
||||
The CPU board appears to be the 2820 System Processor, which has Z80A CTC,
|
||||
Z80A PIO, Z80A SIO/0 and Z80A DMA peripherals on board. Several features,
|
||||
including IEI/IEO daisy chain priority, are jumper-configurable.
|
||||
The CPU board appears to be similar to the 2820 System Processor, which has
|
||||
Z80A CTC, Z80A PIO, Z80A SIO/0 and Z80A DMA peripherals on board. Several
|
||||
features, including IEI/IEO daisy chain priority, are jumper-configurable.
|
||||
|
||||
However, the 2820 has the i/o ports rearranged slightly (even though the
|
||||
manual says it should work!), and no fdc support.
|
||||
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
@ -35,6 +39,8 @@ public:
|
||||
ccs300_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rom(*this, "maincpu")
|
||||
, m_ram(*this, "mainram")
|
||||
{ }
|
||||
|
||||
void ccs300(machine_config &config);
|
||||
@ -42,34 +48,34 @@ public:
|
||||
private:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
|
||||
required_device<z80_device> m_maincpu;
|
||||
|
||||
void ccs300_io(address_map &map);
|
||||
void ccs300_mem(address_map &map);
|
||||
|
||||
void port40_w(u8 data);
|
||||
bool m_rom_in_map;
|
||||
required_device<z80_device> m_maincpu;
|
||||
required_region_ptr<u8> m_rom;
|
||||
required_shared_ptr<u8> m_ram;
|
||||
};
|
||||
|
||||
void ccs300_state::ccs300_mem(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x0000, 0x07ff).bankr("bankr0").bankw("bankw0");
|
||||
map(0x0800, 0xffff).ram();
|
||||
map(0x0000, 0xffff).ram().share("mainram");
|
||||
map(0x0000, 0x07ff).lr8(NAME([this] (offs_t offset) { if (m_rom_in_map) return m_rom[offset]; else return m_ram[offset]; } ));
|
||||
}
|
||||
|
||||
void ccs300_state::ccs300_io(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map.global_mask(0xff);
|
||||
map(0x04, 0x04); // fdc related
|
||||
map(0x10, 0x13).rw("sio", FUNC(z80sio_device::ba_cd_r), FUNC(z80sio_device::ba_cd_w));
|
||||
map(0x14, 0x17).rw("pio", FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); // init bytes seem to be for a PIO
|
||||
map(0x18, 0x1b).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); // init bytes seem to be for a CTC
|
||||
map(0x14, 0x17).rw("pio", FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt));
|
||||
map(0x18, 0x1b).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write));
|
||||
map(0x30, 0x33); // fdc?
|
||||
map(0x34, 0x34); // motor control?
|
||||
map(0x40, 0x40).w(FUNC(ccs300_state::port40_w));
|
||||
map(0xf0, 0xf0).rw("dma", FUNC(z80dma_device::read), FUNC(z80dma_device::write)); // long sequence of init bytes
|
||||
map(0xf2, 0xf2); // dip or jumper?
|
||||
map(0xf0, 0xf0).rw("dma", FUNC(z80dma_device::read), FUNC(z80dma_device::write));
|
||||
map(0xf2, 0xf2); // dip or jumper? only used by CCS-400
|
||||
}
|
||||
|
||||
/* Input ports */
|
||||
@ -92,22 +98,17 @@ static const z80_daisy_config daisy_chain[] =
|
||||
//*************************************
|
||||
void ccs300_state::port40_w(u8 data)
|
||||
{
|
||||
membank("bankr0")->set_entry( (data) ? 1 : 0);
|
||||
m_rom_in_map = !BIT(data, 0);
|
||||
}
|
||||
|
||||
void ccs300_state::machine_reset()
|
||||
{
|
||||
membank("bankr0")->set_entry(0); // point at rom
|
||||
membank("bankw0")->set_entry(0); // always write to ram
|
||||
m_rom_in_map = true;
|
||||
}
|
||||
|
||||
void ccs300_state::machine_start()
|
||||
{
|
||||
u8 *main = memregion("maincpu")->base();
|
||||
|
||||
membank("bankr0")->configure_entry(1, &main[0x0000]);
|
||||
membank("bankr0")->configure_entry(0, &main[0x10000]);
|
||||
membank("bankw0")->configure_entry(0, &main[0x0000]);
|
||||
save_item(NAME(m_rom_in_map));
|
||||
}
|
||||
|
||||
static DEVICE_INPUT_DEFAULTS_START( terminal )
|
||||
@ -130,29 +131,29 @@ void ccs300_state::ccs300(machine_config & config)
|
||||
/* Devices */
|
||||
z80sio_device &sio(Z80SIO(config, "sio", 16_MHz_XTAL / 4));
|
||||
sio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
|
||||
sio.out_txda_callback().set("sioa", FUNC(rs232_port_device::write_txd));
|
||||
sio.out_dtra_callback().set("sioa", FUNC(rs232_port_device::write_dtr));
|
||||
sio.out_rtsa_callback().set("sioa", FUNC(rs232_port_device::write_rts));
|
||||
sio.out_txdb_callback().set("siob", FUNC(rs232_port_device::write_txd));
|
||||
sio.out_dtrb_callback().set("siob", FUNC(rs232_port_device::write_dtr));
|
||||
sio.out_rtsb_callback().set("siob", FUNC(rs232_port_device::write_rts));
|
||||
sio.out_txda_callback().set("rs232a", FUNC(rs232_port_device::write_txd));
|
||||
sio.out_dtra_callback().set("rs232a", FUNC(rs232_port_device::write_dtr));
|
||||
sio.out_rtsa_callback().set("rs232a", FUNC(rs232_port_device::write_rts));
|
||||
sio.out_txdb_callback().set("rs232b", FUNC(rs232_port_device::write_txd));
|
||||
sio.out_dtrb_callback().set("rs232b", FUNC(rs232_port_device::write_dtr));
|
||||
sio.out_rtsb_callback().set("rs232b", FUNC(rs232_port_device::write_rts));
|
||||
|
||||
rs232_port_device &sioa(RS232_PORT(config, "sioa", default_rs232_devices, "terminal"));
|
||||
sioa.rxd_handler().set("sio", FUNC(z80sio_device::rxa_w));
|
||||
sioa.cts_handler().set("sio", FUNC(z80sio_device::ctsa_w));
|
||||
sioa.dcd_handler().set("sio", FUNC(z80sio_device::dcda_w));
|
||||
sioa.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be exactly here
|
||||
rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, "terminal"));
|
||||
rs232a.rxd_handler().set("sio", FUNC(z80sio_device::rxa_w));
|
||||
rs232a.cts_handler().set("sio", FUNC(z80sio_device::ctsa_w));
|
||||
rs232a.dcd_handler().set("sio", FUNC(z80sio_device::dcda_w));
|
||||
rs232a.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be exactly here
|
||||
|
||||
rs232_port_device &siob(RS232_PORT(config, "siob", default_rs232_devices, nullptr));
|
||||
siob.rxd_handler().set("sio", FUNC(z80sio_device::rxa_w));
|
||||
siob.cts_handler().set("sio", FUNC(z80sio_device::ctsa_w));
|
||||
siob.dcd_handler().set("sio", FUNC(z80sio_device::dcda_w));
|
||||
rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr));
|
||||
rs232b.rxd_handler().set("sio", FUNC(z80sio_device::rxb_w));
|
||||
rs232b.cts_handler().set("sio", FUNC(z80sio_device::ctsb_w));
|
||||
rs232b.dcd_handler().set("sio", FUNC(z80sio_device::dcdb_w));
|
||||
|
||||
z80ctc_device &ctc(Z80CTC(config, "ctc", 16_MHz_XTAL / 4));
|
||||
ctc.set_clk<0>(16_MHz_XTAL / 8);
|
||||
ctc.set_clk<1>(16_MHz_XTAL / 8);
|
||||
ctc.set_clk<2>(16_MHz_XTAL / 8);
|
||||
//ctc.set_clk<3>(16_MHz_XTAL / 8); // this causes an IRQ storm, hanging the machine
|
||||
ctc.set_clk<0>(16_MHz_XTAL / 8); // 153'846
|
||||
//ctc.set_clk<1>(16_MHz_XTAL / 8); // not used
|
||||
ctc.set_clk<2>(16_MHz_XTAL / 8); // 9'615
|
||||
//ctc.set_clk<3>(16_MHz_XTAL / 8); // 2'000'000 - this causes an IRQ storm, hanging the machine
|
||||
ctc.zc_callback<0>().set("sio", FUNC(z80sio_device::txca_w));
|
||||
ctc.zc_callback<0>().append("sio", FUNC(z80sio_device::rxca_w));
|
||||
ctc.zc_callback<2>().append("sio", FUNC(z80sio_device::rxtxcb_w));
|
||||
@ -167,11 +168,11 @@ void ccs300_state::ccs300(machine_config & config)
|
||||
|
||||
/* ROM definition */
|
||||
ROM_START( ccs300 )
|
||||
ROM_REGION( 0x10800, "maincpu", ROMREGION_ERASEFF )
|
||||
ROM_LOAD( "ccs300.rom", 0x10000, 0x0800, CRC(6cf22e31) SHA1(9aa3327cd8c23d0eab82cb6519891aff13ebe1d0))
|
||||
ROM_REGION( 0x0800, "maincpu", 0 )
|
||||
ROM_LOAD( "ccs300.rom", 0x0000, 0x0800, CRC(6cf22e31) SHA1(9aa3327cd8c23d0eab82cb6519891aff13ebe1d0))
|
||||
ROM_END
|
||||
|
||||
/* Driver */
|
||||
|
||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
|
||||
COMP( 19??, ccs300, ccs2810, 0, ccs300, ccs300, ccs300_state, empty_init, "California Computer Systems", "CCS Model 300", MACHINE_IS_SKELETON )
|
||||
COMP( 19??, ccs300, ccs2810, 0, ccs300, ccs300, ccs300_state, empty_init, "California Computer Systems", "CCS Model 300", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE )
|
||||
|
Loading…
Reference in New Issue
Block a user