|
| 1 | +// license:BSD-3-Clause |
| 2 | +// copyright-holders:Angelo Salese |
| 3 | +/************************************************************************************************** |
| 4 | +
|
| 5 | +"The Adaptator" a.k.a. DIY parallel port to 2x DE-9 Multitap adapter |
| 6 | +
|
| 7 | +Originally bundled with the Amiga/ST/DOS/C=64 versions of Dyna Blaster as a sort of mandatory |
| 8 | +dongle (i.e. game menus needs joy 3 in Amiga version at least). |
| 9 | +
|
| 10 | +List of known supported games: |
| 11 | +amigaocs_flop |
| 12 | +- dynabls; |
| 13 | +- kickoff2; |
| 14 | +- gauntlt2; |
| 15 | +- protent2; |
| 16 | +- sskid; |
| 17 | +
|
| 18 | +TODO: |
| 19 | +- DOS ct486 dynablst doesn't work, BIOS shenanigans? |
| 20 | +- atarist (cracked only, loose) Dyna Blaster doesn't work either, needs select and data in routing; |
| 21 | +- Untested on C=64; |
| 22 | +- gauntlt2 seemingly requires a slightly different pinout according to the Super Skidmarks |
| 23 | + manual "connect pin 6 of joy 3 to pin 13 (?), pin 6 of joy 4 to pin 12"; |
| 24 | +- Anything that isn't Atari/Commodore single button joystick is uncharted waters at current time |
| 25 | + (read: no SW pretends to read a mouse or a MD pad with this); |
| 26 | +
|
| 27 | +References: |
| 28 | +- https://www.aminet.net/package/util/misc/ControllerTest technical documentation; |
| 29 | +- https://www.aminet.net/package/util/misc/VATestprogram MouseJoy test; |
| 30 | +- Super Skidmarks manual, page 3; |
| 31 | +
|
| 32 | +**************************************************************************************************/ |
| 33 | + |
| 34 | +#include "emu.h" |
| 35 | +#include "adaptator.h" |
| 36 | + |
| 37 | +DEFINE_DEVICE_TYPE(ADAPTATOR_MULTITAP, adaptator_multitap_device, "adaptator_multitap", "The Adaptator 2x DE-9 Multitap") |
| 38 | + |
| 39 | +adaptator_multitap_device::adaptator_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : |
| 40 | + device_t(mconfig, ADAPTATOR_MULTITAP, tag, owner, clock), |
| 41 | + device_centronics_peripheral_interface(mconfig, *this), |
| 42 | + m_joy(*this, "joy_p%u", 1U) |
| 43 | +{ } |
| 44 | + |
| 45 | + |
| 46 | +void adaptator_multitap_device::device_add_mconfig(machine_config &config) |
| 47 | +{ |
| 48 | + VCS_CONTROL_PORT(config, m_joy[0], vcs_control_port_devices, "joy"); |
| 49 | + VCS_CONTROL_PORT(config, m_joy[1], vcs_control_port_devices, "joy"); |
| 50 | +} |
| 51 | + |
| 52 | +void adaptator_multitap_device::device_start() |
| 53 | +{ |
| 54 | + save_item(NAME(m_ddr)); |
| 55 | +} |
| 56 | + |
| 57 | +void adaptator_multitap_device::input_strobe(int state) |
| 58 | +{ |
| 59 | + // assume 1 -> 0, assume writing to the data port causes pullup |
| 60 | + // i.e. ControllerTest just writes a 0xff, at init time. ct486 do the same at POST. |
| 61 | + if (state) |
| 62 | + return; |
| 63 | + |
| 64 | + u8 p1_in = m_joy[0]->read_joy(); |
| 65 | + u8 p2_in = m_joy[1]->read_joy(); |
| 66 | + |
| 67 | + // route pin 13 -> joy port 3 pin 6 |
| 68 | + output_select(BIT(p1_in, 5)); |
| 69 | + // route pin 11 -> joy port 4 pin 6 |
| 70 | + output_busy(BIT(p2_in, 5)); |
| 71 | + // pins 18-22 -> pin 8 ground for both |
| 72 | + |
| 73 | + // NOTE: 2nd button hooks are possible but ControllerTest warns that ACK |
| 74 | + // "is not easily available to software without some fancy interrupt trickery" |
| 75 | + // so it doesn't support it. |
| 76 | + // route pin 12 (pout) -> joy port 3 pin 9 |
| 77 | + //output_perror(BIT(p1_in, ?)); |
| 78 | + // route pin 10 (ack) -> joy port 4 pin 9 |
| 79 | + //output_ack(BIT(p2_in, ?)); |
| 80 | + |
| 81 | + // route pins 2-5 -> joy port 3 pins 1-4 |
| 82 | + output_data0(BIT(p1_in, 0)); |
| 83 | + output_data1(BIT(p1_in, 1)); |
| 84 | + output_data2(BIT(p1_in, 2)); |
| 85 | + output_data3(BIT(p1_in, 3)); |
| 86 | + // route pins 6-9 -> joy port 4 pins 1-4 |
| 87 | + output_data4(BIT(p2_in, 0)); |
| 88 | + output_data5(BIT(p2_in, 1)); |
| 89 | + output_data6(BIT(p2_in, 2)); |
| 90 | + output_data7(BIT(p2_in, 3)); |
| 91 | +} |
0 commit comments