-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bus/centronics: hookup The Adaptator DE-9 multitap device (#13341)
* bus/centronics: hookup The Adaptator DE-9 multitap device * bus/centronics/adaptator: register a possible DDR variable
- Loading branch information
Showing
6 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Angelo Salese | ||
/************************************************************************************************** | ||
"The Adaptator" a.k.a. DIY parallel port to 2x DE-9 Multitap adapter | ||
Originally bundled with the Amiga/ST/DOS/C=64 versions of Dyna Blaster as a sort of mandatory | ||
dongle (i.e. game menus needs joy 3 in Amiga version at least). | ||
List of known supported games: | ||
amigaocs_flop | ||
- dynabls; | ||
- kickoff2; | ||
- gauntlt2; | ||
- protent2; | ||
- sskid; | ||
TODO: | ||
- DOS ct486 dynablst doesn't work, BIOS shenanigans? | ||
- atarist (cracked only, loose) Dyna Blaster doesn't work either, needs select and data in routing; | ||
- Untested on C=64; | ||
- gauntlt2 seemingly requires a slightly different pinout according to the Super Skidmarks | ||
manual "connect pin 6 of joy 3 to pin 13 (?), pin 6 of joy 4 to pin 12"; | ||
- Anything that isn't Atari/Commodore single button joystick is uncharted waters at current time | ||
(read: no SW pretends to read a mouse or a MD pad with this); | ||
References: | ||
- https://www.aminet.net/package/util/misc/ControllerTest technical documentation; | ||
- https://www.aminet.net/package/util/misc/VATestprogram MouseJoy test; | ||
- Super Skidmarks manual, page 3; | ||
**************************************************************************************************/ | ||
|
||
#include "emu.h" | ||
#include "adaptator.h" | ||
|
||
DEFINE_DEVICE_TYPE(ADAPTATOR_MULTITAP, adaptator_multitap_device, "adaptator_multitap", "The Adaptator 2x DE-9 Multitap") | ||
|
||
adaptator_multitap_device::adaptator_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : | ||
device_t(mconfig, ADAPTATOR_MULTITAP, tag, owner, clock), | ||
device_centronics_peripheral_interface(mconfig, *this), | ||
m_joy(*this, "joy_p%u", 1U) | ||
{ } | ||
|
||
|
||
void adaptator_multitap_device::device_add_mconfig(machine_config &config) | ||
{ | ||
VCS_CONTROL_PORT(config, m_joy[0], vcs_control_port_devices, "joy"); | ||
VCS_CONTROL_PORT(config, m_joy[1], vcs_control_port_devices, "joy"); | ||
} | ||
|
||
void adaptator_multitap_device::device_start() | ||
{ | ||
save_item(NAME(m_ddr)); | ||
} | ||
|
||
void adaptator_multitap_device::input_strobe(int state) | ||
{ | ||
// assume 1 -> 0, assume writing to the data port causes pullup | ||
// i.e. ControllerTest just writes a 0xff, at init time. ct486 do the same at POST. | ||
if (state) | ||
return; | ||
|
||
u8 p1_in = m_joy[0]->read_joy(); | ||
u8 p2_in = m_joy[1]->read_joy(); | ||
|
||
// route pin 13 -> joy port 3 pin 6 | ||
output_select(BIT(p1_in, 5)); | ||
// route pin 11 -> joy port 4 pin 6 | ||
output_busy(BIT(p2_in, 5)); | ||
// pins 18-22 -> pin 8 ground for both | ||
|
||
// NOTE: 2nd button hooks are possible but ControllerTest warns that ACK | ||
// "is not easily available to software without some fancy interrupt trickery" | ||
// so it doesn't support it. | ||
// route pin 12 (pout) -> joy port 3 pin 9 | ||
//output_perror(BIT(p1_in, ?)); | ||
// route pin 10 (ack) -> joy port 4 pin 9 | ||
//output_ack(BIT(p2_in, ?)); | ||
|
||
// route pins 2-5 -> joy port 3 pins 1-4 | ||
output_data0(BIT(p1_in, 0)); | ||
output_data1(BIT(p1_in, 1)); | ||
output_data2(BIT(p1_in, 2)); | ||
output_data3(BIT(p1_in, 3)); | ||
// route pins 6-9 -> joy port 4 pins 1-4 | ||
output_data4(BIT(p2_in, 0)); | ||
output_data5(BIT(p2_in, 1)); | ||
output_data6(BIT(p2_in, 2)); | ||
output_data7(BIT(p2_in, 3)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Angelo Salese | ||
|
||
#ifndef MAME_BUS_CENTRONICS_ADAPTATOR_H | ||
#define MAME_BUS_CENTRONICS_ADAPTATOR_H | ||
|
||
#pragma once | ||
|
||
#include "ctronics.h" | ||
#include "bus/vcs_ctrl/ctrl.h" | ||
|
||
class adaptator_multitap_device : public device_t, | ||
public device_centronics_peripheral_interface | ||
{ | ||
public: | ||
// construction/destruction | ||
adaptator_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); | ||
|
||
virtual void input_strobe(int state) override; | ||
virtual void input_data0(int state) override { if (state) m_ddr |= 0x01; else m_ddr &= ~0x01; } | ||
virtual void input_data1(int state) override { if (state) m_ddr |= 0x02; else m_ddr &= ~0x02; } | ||
virtual void input_data2(int state) override { if (state) m_ddr |= 0x04; else m_ddr &= ~0x04; } | ||
virtual void input_data3(int state) override { if (state) m_ddr |= 0x08; else m_ddr &= ~0x08; } | ||
virtual void input_data4(int state) override { if (state) m_ddr |= 0x10; else m_ddr &= ~0x10; } | ||
virtual void input_data5(int state) override { if (state) m_ddr |= 0x20; else m_ddr &= ~0x20; } | ||
virtual void input_data6(int state) override { if (state) m_ddr |= 0x40; else m_ddr &= ~0x40; } | ||
virtual void input_data7(int state) override { if (state) m_ddr |= 0x80; else m_ddr &= ~0x80; } | ||
|
||
protected: | ||
// device-level overrides | ||
virtual void device_start() override ATTR_COLD; | ||
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; | ||
|
||
private: | ||
required_device_array<vcs_control_port_device, 2> m_joy; | ||
|
||
u8 m_ddr; | ||
}; | ||
|
||
// device type definition | ||
DECLARE_DEVICE_TYPE(ADAPTATOR_MULTITAP, adaptator_multitap_device) | ||
|
||
|
||
#endif // MAME_BUS_CENTRONICS_ADAPTATOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters