mirror of
https://github.com/holub/mame
synced 2025-07-07 10:58:41 +03:00
intellec4: add high-speed paper tape reader card (installed in slot j7 by default, select with J command for loading BNPF/HEX)
This commit is contained in:
parent
080f48d522
commit
f1b30abacf
@ -869,6 +869,8 @@ if (BUSES["INTELLEC4"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/intellec4/intellec4.cpp",
|
||||
MAME_DIR .. "src/devices/bus/intellec4/intellec4.h",
|
||||
MAME_DIR .. "src/devices/bus/intellec4/tapereader.cpp",
|
||||
MAME_DIR .. "src/devices/bus/intellec4/tapereader.h",
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -248,5 +248,8 @@ void device_univ_card_interface::set_bus(univ_bus_device &bus)
|
||||
|
||||
|
||||
|
||||
#include "tapereader.h"
|
||||
|
||||
SLOT_INTERFACE_START(intellec4_univ_cards)
|
||||
SLOT_INTERFACE("ptreader", INTELLEC4_TAPE_READER)
|
||||
SLOT_INTERFACE_END
|
||||
|
70
src/devices/bus/intellec4/tapereader.cpp
Normal file
70
src/devices/bus/intellec4/tapereader.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Vas Crabb
|
||||
|
||||
#include "emu.h"
|
||||
#include "tapereader.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE_NS(INTELLEC4_TAPE_READER, bus::intellec4, tape_reader_device, "intlc4ptr", "INTELLEC 4 paper tape reader")
|
||||
|
||||
|
||||
namespace bus { namespace intellec4 {
|
||||
|
||||
tape_reader_device::tape_reader_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, INTELLEC4_TAPE_READER, tag, owner, clock)
|
||||
, device_univ_card_interface(mconfig, *this)
|
||||
, device_image_interface(mconfig, *this)
|
||||
, m_data(0xffU)
|
||||
, m_ready(false)
|
||||
, m_advance(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
image_init_result tape_reader_device::call_load()
|
||||
{
|
||||
m_data = 0x00U;
|
||||
m_ready = false;
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
|
||||
void tape_reader_device::call_unload()
|
||||
{
|
||||
m_data = 0xffU;
|
||||
m_ready = false;
|
||||
}
|
||||
|
||||
|
||||
void tape_reader_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_data));
|
||||
save_item(NAME(m_ready));
|
||||
save_item(NAME(m_advance));
|
||||
|
||||
rom_ports_space().install_read_handler(0x0040U, 0x004fU, read8_delegate(FUNC(tape_reader_device::rom4_in), this));
|
||||
rom_ports_space().install_read_handler(0x0060U, 0x006fU, read8_delegate(FUNC(tape_reader_device::rom6_in), this));
|
||||
rom_ports_space().install_read_handler(0x0070U, 0x007fU, read8_delegate(FUNC(tape_reader_device::rom7_in), this));
|
||||
rom_ports_space().install_write_handler(0x0040U, 0x004fU, write8_delegate(FUNC(tape_reader_device::rom4_out), this));
|
||||
}
|
||||
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(tape_reader_device::advance)
|
||||
{
|
||||
// this is edge-sensitive - CPU sends the narrowest pulse it can
|
||||
if (!m_advance && !bool(state))
|
||||
{
|
||||
// FIXME: it probably shouldn't be quite this fast
|
||||
if (is_loaded() && fread(&m_data, 1U))
|
||||
{
|
||||
m_ready = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_data = 0xffU;
|
||||
m_ready = false;
|
||||
}
|
||||
}
|
||||
m_advance = !bool(state);
|
||||
}
|
||||
|
||||
} } // namespace bus::intellec4
|
54
src/devices/bus/intellec4/tapereader.h
Normal file
54
src/devices/bus/intellec4/tapereader.h
Normal file
@ -0,0 +1,54 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Vas Crabb
|
||||
/*
|
||||
High-speed paper tape reader
|
||||
|
||||
The monitor PROM has support for loading BNPF or Intel HEX from this
|
||||
device (use J command to select it), but it doesn't appear in any
|
||||
catalogues or manuals I've seen.
|
||||
*/
|
||||
#ifndef MAME_BUS_INTELLEC4_TAPEREADER_H
|
||||
#define MAME_BUS_INTELLEC4_TAPEREADER_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "intellec4.h"
|
||||
|
||||
namespace bus { namespace intellec4 {
|
||||
|
||||
class tape_reader_device : public device_t, public device_univ_card_interface, public device_image_interface
|
||||
{
|
||||
public:
|
||||
tape_reader_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual image_init_result call_load() override;
|
||||
virtual void call_unload() override;
|
||||
|
||||
virtual iodevice_t image_type() const override { return IO_PUNCHTAPE; }
|
||||
virtual bool is_readable() const override { return true; }
|
||||
virtual bool is_writeable() const override { return false; }
|
||||
virtual bool is_creatable() const override { return false; }
|
||||
virtual bool must_be_loaded() const override { return false; }
|
||||
virtual bool is_reset_on_load() const override { return false; }
|
||||
virtual char const *file_extensions() const override { return "bnpf,hex,lst,txt"; }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
DECLARE_READ8_MEMBER(rom4_in) { return m_ready ? 0x07U : 0x0fU; }
|
||||
DECLARE_READ8_MEMBER(rom6_in) { return ~m_data & 0x0fU; }
|
||||
DECLARE_READ8_MEMBER(rom7_in) { return (~m_data >> 4) & 0x0fU; }
|
||||
DECLARE_WRITE8_MEMBER(rom4_out) { advance(BIT(data, 3)); }
|
||||
DECLARE_WRITE_LINE_MEMBER(advance);
|
||||
|
||||
u8 m_data;
|
||||
bool m_ready;
|
||||
bool m_advance;
|
||||
};
|
||||
|
||||
} } // namespace bus::intellec4
|
||||
|
||||
DECLARE_DEVICE_TYPE_NS(INTELLEC4_TAPE_READER, bus::intellec4, tape_reader_device)
|
||||
|
||||
#endif // MAME_BUS_INTELLEC4_TAPEREADER_H
|
@ -39,7 +39,6 @@
|
||||
TODO:
|
||||
* Default terminal serial settings
|
||||
* Universal slot cards
|
||||
* Image device for paper tape reader?
|
||||
* Expose general-purpose I/O?
|
||||
*/
|
||||
#include "emu.h"
|
||||
@ -232,7 +231,7 @@ ADDRESS_MAP_START(intellec4_program_banks, mcs40_cpu_device_base::AS_ROM, 8, int
|
||||
ADDRESS_MAP_END
|
||||
|
||||
ADDRESS_MAP_START(intellec4_rom_port_banks, mcs40_cpu_device_base::AS_ROM_PORTS, 8, intellec4_state)
|
||||
ADDRESS_MAP_UNMAP_LOW
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
|
||||
// 0x0000...0x07ff MON
|
||||
AM_RANGE(0x0000, 0x000f) AM_MIRROR(0x1f00) AM_READWRITE(rom0_in, rom0_out)
|
||||
@ -265,7 +264,7 @@ ADDRESS_MAP_START(intellec4_ram_memory, mcs40_cpu_device_base::AS_RAM_MEMORY, 8,
|
||||
ADDRESS_MAP_END
|
||||
|
||||
ADDRESS_MAP_START(intellec4_rom_ports, mcs40_cpu_device_base::AS_ROM_PORTS, 8, intellec4_state)
|
||||
ADDRESS_MAP_UNMAP_LOW
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x07ff) AM_DEVICE("rpbank", address_map_bank_device, amap8)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -316,7 +315,7 @@ MACHINE_CONFIG_START(intellec4)
|
||||
MCFG_INTELLEC4_UNIV_BUS_RAM_PORTS_SPACE("maincpu", mcs40_cpu_device_base::AS_RAM_PORTS)
|
||||
MCFG_INTELLEC4_UNIV_BUS_RESET_4002_CB(WRITELINE(intellec4_state, bus_reset_4002))
|
||||
MCFG_INTELLEC4_UNIV_BUS_USER_RESET_CB(WRITELINE(intellec4_state, bus_user_reset))
|
||||
MCFG_INTELLEC4_UNIV_SLOT_ADD("bus", "j7", 518000. / 7, intellec4_univ_cards, nullptr)
|
||||
MCFG_INTELLEC4_UNIV_SLOT_ADD("bus", "j7", 518000. / 7, intellec4_univ_cards, "ptreader")
|
||||
MCFG_INTELLEC4_UNIV_SLOT_ADD("bus", "j8", 518000. / 7, intellec4_univ_cards, nullptr)
|
||||
MCFG_INTELLEC4_UNIV_SLOT_ADD("bus", "j9", 518000. / 7, intellec4_univ_cards, nullptr)
|
||||
MCFG_INTELLEC4_UNIV_SLOT_ADD("bus", "j10", 518000. / 7, intellec4_univ_cards, nullptr)
|
||||
@ -500,7 +499,7 @@ WRITE8_MEMBER(intellec4_state::pm_write)
|
||||
READ8_MEMBER(intellec4_state::rom0_in)
|
||||
{
|
||||
// bit 0 of this port is ANDed with the TTY input
|
||||
return m_tty->rxd_r() ? 0x00U : 0x01U;
|
||||
return m_tty->rxd_r() ? 0x0eU : 0x0fU;
|
||||
}
|
||||
|
||||
READ8_MEMBER(intellec4_state::rom2_in)
|
||||
@ -1045,7 +1044,7 @@ private:
|
||||
// current state of signals from bus
|
||||
bool m_bus_test = false;
|
||||
|
||||
// current state of front panel switches
|
||||
// current state of front panel switches
|
||||
bool m_sw_hold = false;
|
||||
};
|
||||
|
||||
@ -1443,6 +1442,11 @@ ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
Machine definitions
|
||||
***********************************************************************/
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS
|
||||
COMP( 1973?, intlc44, 0, 0, mod4, mod4, mod4_state, 0, "Intel", "INTELLEC 4/MOD 4", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW | MACHINE_CLICKABLE_ARTWORK | MACHINE_SUPPORTS_SAVE )
|
||||
COMP( 1974?, intlc440, 0, 0, mod40, mod40, mod40_state, 0, "Intel", "INTELLEC 4/MOD 40", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW | MACHINE_CLICKABLE_ARTWORK | MACHINE_SUPPORTS_SAVE )
|
||||
|
Loading…
Reference in New Issue
Block a user