summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--hash/tx0_ptp.xml43
-rw-r--r--src/mame/drivers/tx0.cpp117
2 files changed, 114 insertions, 46 deletions
diff --git a/hash/tx0_ptp.xml b/hash/tx0_ptp.xml
new file mode 100644
index 00000000000..ad60cbb1650
--- /dev/null
+++ b/hash/tx0_ptp.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
+<!--
+license:CC0
+-->
+
+<softwarelist name="tx0_ptp" description="TX-0 Paper Tape Reader images">
+ <!-- The "NEWCODE" compatibility tag is used for programs written or reassembled after 1960, using the revised instruction code.
+ The encoding of "OLDCODE" programs is incompatible with the tx0_8kw system. These two categories may receive separate lists in the future.
+ -->
+
+ <software name="munching">
+ <description>Munching Squares</description>
+ <year>196?</year>
+ <publisher>MIT</publisher>
+ <info name="usage" value="Press read in switch, then restart after loader halts at 17777. Use TAC switches to vary display."/>
+ <sharedfeat name="compatibility" value="NEWCODE"/>
+ <part name="ptp" interface="tx0_ptp">
+ <dataarea name="ptap" size="327">
+ <rom name="bin_munchingSquares.bin" size="327" crc="54afd9a3" sha1="a7fc6d62ea1cef21f1563cb8b86a5e63198af0ae"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="punchy">
+ <description>Punchy</description>
+ <year>195?</year>
+ <publisher>MIT</publisher>
+ <info name="author" value="John T. Gilmore, Jr."/>
+ <info name="usage" value="Create file for punch device. Press read in switch, then restart after loader halts at 7777."/>
+ <!-- For detailed usage instructions, see memorandum M-5001-1. -->
+ <sharedfeat name="compatibility" value="OLDCODE"/>
+ <part name="ptp" interface="tx0_ptp">
+ <!-- Reconstructed from assembly listing dated "3 FEB" in handwriting, together with the standard tape input routine from M-5001-1.
+ This version is independent of UT-3, but does require that the aforementioned input routine remain in memory. -->
+ <feature name="blocks_used" value="6547-7610, 7741-7777"/>
+ <dataarea name="ptap" size="1821">
+ <rom name="punchy.bin" size="1821" crc="3a0ead7e" sha1="6fb6f072251712cab2e614d1a80a626b9a27f1f2"/>
+ </dataarea>
+ </part>
+ </software>
+
+</softwarelist>
diff --git a/src/mame/drivers/tx0.cpp b/src/mame/drivers/tx0.cpp
index 3f7ab4e7d27..fcbf223a12e 100644
--- a/src/mame/drivers/tx0.cpp
+++ b/src/mame/drivers/tx0.cpp
@@ -416,6 +416,7 @@ public:
virtual const char *file_extensions() const noexcept override { return "tap,rim"; }
virtual image_init_result call_load() override;
+ virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override;
virtual void call_unload() override;
protected:
@@ -517,27 +518,30 @@ tx0_magtape_image_device::tx0_magtape_image_device(const machine_config &mconfig
*/
image_init_result tx0_readtape_image_device::call_load()
{
- /* reader unit */
- m_tx0->m_tape_reader.fd = this;
+ if (m_tx0)
+ {
+ /* reader unit */
+ m_tx0->m_tape_reader.fd = this;
- /* start motor */
- m_tx0->m_tape_reader.motor_on = 1;
+ /* start motor */
+ m_tx0->m_tape_reader.motor_on = 1;
/* restart reader IO when necessary */
/* note that this function may be called before tx0_init_machine, therefore
before tape_reader.timer is allocated. It does not matter, as the clutch is never
down at power-up, but we must not call timer_enable with a nullptr parameter! */
- if (m_tx0->m_tape_reader.timer)
- {
- if (m_tx0->m_tape_reader.motor_on && m_tx0->m_tape_reader.rcl)
- {
- /* delay is approximately 1/400s */
- m_tx0->m_tape_reader.timer->adjust(attotime::from_usec(2500));
- }
- else
+ if (m_tx0->m_tape_reader.timer)
{
- m_tx0->m_tape_reader.timer->enable(0);
+ if (m_tx0->m_tape_reader.motor_on && m_tx0->m_tape_reader.rcl)
+ {
+ /* delay is approximately 1/400s */
+ m_tx0->m_tape_reader.timer->adjust(attotime::from_usec(2500));
+ }
+ else
+ {
+ m_tx0->m_tape_reader.timer->enable(0);
+ }
}
}
@@ -547,13 +551,16 @@ image_init_result tx0_readtape_image_device::call_load()
void tx0_readtape_image_device::call_unload()
{
/* reader unit */
- m_tx0->m_tape_reader.fd = nullptr;
+ if (m_tx0)
+ {
+ m_tx0->m_tape_reader.fd = nullptr;
- /* stop motor */
- m_tx0->m_tape_reader.motor_on = 0;
+ /* stop motor */
+ m_tx0->m_tape_reader.motor_on = 0;
- if (m_tx0->m_tape_reader.timer)
- m_tx0->m_tape_reader.timer->enable(0);
+ if (m_tx0->m_tape_reader.timer)
+ m_tx0->m_tape_reader.timer->enable(0);
+ }
}
/*
@@ -573,7 +580,10 @@ int tx0_state::tape_read(uint8_t *reply)
void tx0_state::tape_write(uint8_t data)
{
if (m_tape_puncher.fd)
+ {
+ data |= 0200;
m_tape_puncher.fd->fwrite(& data, 1);
+ }
}
/*
@@ -650,15 +660,22 @@ TIMER_CALLBACK_MEMBER(tx0_state::reader_callback)
image_init_result tx0_punchtape_image_device::call_load()
{
/* punch unit */
- m_tx0->m_tape_puncher.fd = this;
+ if (m_tx0)
+ m_tx0->m_tape_puncher.fd = this;
return image_init_result::PASS;
}
+image_init_result tx0_punchtape_image_device::call_create(int format_type, util::option_resolution *format_options)
+{
+ return call_load();
+}
+
void tx0_punchtape_image_device::call_unload()
{
/* punch unit */
- m_tx0->m_tape_puncher.fd = nullptr;
+ if (m_tx0)
+ m_tx0->m_tape_puncher.fd = nullptr;
}
TIMER_CALLBACK_MEMBER(tx0_state::puncher_callback)
@@ -726,14 +743,16 @@ WRITE_LINE_MEMBER( tx0_state::tx0_io_p7h )
image_init_result tx0_printer_image_device::call_load()
{
/* open file */
- m_tx0->m_typewriter.fd = this;
+ if (m_tx0)
+ m_tx0->m_typewriter.fd = this;
return image_init_result::PASS;
}
void tx0_printer_image_device::call_unload()
{
- m_tx0->m_typewriter.fd = nullptr;
+ if (m_tx0)
+ m_tx0->m_typewriter.fd = nullptr;
}
/*
@@ -743,7 +762,7 @@ void tx0_state::typewriter_out(uint8_t data)
{
tx0_typewriter_drawchar(data);
if (m_typewriter.fd)
- m_typewriter.fd->fwrite(& data, 1);
+ m_typewriter.fd->fwrite(&data, 1);
}
/*
@@ -862,18 +881,21 @@ void tx0_magtape_image_device::device_start()
*/
image_init_result tx0_magtape_image_device::call_load()
{
- m_tx0->m_magtape.img = this;
+ if (m_tx0)
+ {
+ m_tx0->m_magtape.img = this;
- m_tx0->m_magtape.irg_pos = MTIRGP_END;
+ m_tx0->m_magtape.irg_pos = MTIRGP_END;
- /* restart IO when necessary */
- /* note that this function may be called before tx0_init_machine, therefore
- before magtape.timer is allocated. We must not call timer_enable with a
- nullptr parameter! */
- if (m_tx0->m_magtape.timer)
- {
- if (m_tx0->m_magtape.state == MTS_SELECTING)
- m_tx0->schedule_select();
+ /* restart IO when necessary */
+ /* note that this function may be called before tx0_init_machine, therefore
+ before magtape.timer is allocated. We must not call timer_enable with a
+ nullptr parameter! */
+ if (m_tx0->m_magtape.timer)
+ {
+ if (m_tx0->m_magtape.state == MTS_SELECTING)
+ m_tx0->schedule_select();
+ }
}
return image_init_result::PASS;
@@ -881,18 +903,21 @@ image_init_result tx0_magtape_image_device::call_load()
void tx0_magtape_image_device::call_unload()
{
- m_tx0->m_magtape.img = nullptr;
-
- if (m_tx0->m_magtape.timer)
+ if (m_tx0)
{
- if (m_tx0->m_magtape.state == MTS_SELECTING)
- /* I/O has not actually started, we can cancel the selection */
- m_tx0->m_tape_reader.timer->enable(0);
- if ((m_tx0->m_magtape.state == MTS_SELECTED) || ((m_tx0->m_magtape.state == MTS_SELECTING) && (m_tx0->m_magtape.command == 2)))
- { /* unit has become unavailable */
- m_tx0->m_magtape.state = MTS_UNSELECTING;
- m_tx0->m_maincpu->set_state_int(TX0_PF, m_tx0->m_maincpu->state_int(TX0_PF) | PF_RWC);
- m_tx0->schedule_unselect();
+ m_tx0->m_magtape.img = nullptr;
+
+ if (m_tx0->m_magtape.timer)
+ {
+ if (m_tx0->m_magtape.state == MTS_SELECTING)
+ /* I/O has not actually started, we can cancel the selection */
+ m_tx0->m_tape_reader.timer->enable(0);
+ if ((m_tx0->m_magtape.state == MTS_SELECTED) || ((m_tx0->m_magtape.state == MTS_SELECTING) && (m_tx0->m_magtape.command == 2)))
+ { /* unit has become unavailable */
+ m_tx0->m_magtape.state = MTS_UNSELECTING;
+ m_tx0->m_maincpu->set_state_int(TX0_PF, m_tx0->m_maincpu->state_int(TX0_PF) | PF_RWC);
+ m_tx0->schedule_unselect();
+ }
}
}
}
@@ -1584,7 +1609,7 @@ void tx0_state::tx0_64kw(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_tx0);
PALETTE(config, m_palette, FUNC(tx0_state::tx0_palette), total_colors_needed + sizeof(tx0_pens), total_colors_needed);
- SOFTWARE_LIST(config, "ptp_list").set_original("tx0_ptp").set_filter("64");
+ SOFTWARE_LIST(config, "ptp_list").set_original("tx0_ptp").set_filter("64,OLDCODE");
}
void tx0_state::tx0_8kw(machine_config &config)
@@ -1609,7 +1634,7 @@ void tx0_state::tx0_8kw(machine_config &config)
/* dummy interrupt: handles input */
m_maincpu->set_vblank_int("screen", FUNC(tx0_state::tx0_interrupt));
- SOFTWARE_LIST(config.replace(), "ptp_list").set_original("tx0_ptp").set_filter("8");
+ SOFTWARE_LIST(config.replace(), "ptp_list").set_original("tx0_ptp").set_filter("8,NEWCODE");
}
ROM_START(tx0_64kw)