mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
bbc: Added Acorn Bitstik and Bitstik 2 analogue controllers.
This commit is contained in:
parent
cfde421f87
commit
282ebf014d
@ -298,6 +298,8 @@ if (BUSES["BBC_ANALOGUE"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/bbc/analogue/analogue.cpp",
|
||||
MAME_DIR .. "src/devices/bus/bbc/analogue/analogue.h",
|
||||
MAME_DIR .. "src/devices/bus/bbc/analogue/bitstik.cpp",
|
||||
MAME_DIR .. "src/devices/bus/bbc/analogue/bitstik.h",
|
||||
MAME_DIR .. "src/devices/bus/bbc/analogue/joystick.cpp",
|
||||
MAME_DIR .. "src/devices/bus/bbc/analogue/joystick.h",
|
||||
MAME_DIR .. "src/devices/bus/bbc/analogue/cfa3000a.cpp",
|
||||
|
@ -104,7 +104,7 @@ void bbc_analogue_slot_device::device_reset()
|
||||
|
||||
// slot devices
|
||||
#include "joystick.h"
|
||||
//#include "bitstik.h"
|
||||
#include "bitstik.h"
|
||||
//#include "lightpen.h"
|
||||
//#include "micromike.h"
|
||||
//#include "quinkey.h"
|
||||
@ -114,8 +114,8 @@ void bbc_analogue_slot_device::device_reset()
|
||||
void bbc_analogue_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("acornjoy", BBC_ACORNJOY); /* Acorn ANH01 Joysticks */
|
||||
//device.option_add("bitstik1", BBC_BITSTIK1); /* Acorn ANF04 Bitstik */
|
||||
//device.option_add("bitstik2", BBC_BITSTIK2); /* Robocom Bitstik 2 */
|
||||
device.option_add("bitstik1", BBC_BITSTIK1); /* Acorn ANF04 Bitstik */
|
||||
device.option_add("bitstik2", BBC_BITSTIK2); /* Robocom Bitstik 2 */
|
||||
//device.option_add("lightpen", BBC_LIGHTPEN); /* RH Electronics Lightpen */
|
||||
//device.option_add("micromike", BBC_MICROMIKE); /* Micro Mike */
|
||||
device.option_add("voltmace3b", BBC_VOLTMACE3B); /* Voltmace Delta 3b "Twin" Joysticks */
|
||||
|
143
src/devices/bus/bbc/analogue/bitstik.cpp
Normal file
143
src/devices/bus/bbc/analogue/bitstik.cpp
Normal file
@ -0,0 +1,143 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Acorn ANF04 Bitstik
|
||||
|
||||
http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_BitStik.html
|
||||
|
||||
Robocom Bitstik 2
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "bitstik.h"
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(BBC_BITSTIK1, bbc_bitstik1_device, "bbc_bitstik1", "Acorn Bitstik")
|
||||
DEFINE_DEVICE_TYPE(BBC_BITSTIK2, bbc_bitstik2_device, "bbc_bitstik2", "Robo Bitstik 2")
|
||||
|
||||
//-------------------------------------------------
|
||||
// ROM( bitstik )
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START(bitstik1)
|
||||
ROM_REGION(0x4000, "rom", 0)
|
||||
ROM_LOAD("bitstik1.rom", 0x0000, 0x2000, CRC(a3c539f8) SHA1(c6f2cf2f6d1e48819a8381c6a1c97ca8fa5ab117))
|
||||
ROM_RELOAD(0x2000, 0x2000)
|
||||
ROM_END
|
||||
|
||||
ROM_START(bitstik2)
|
||||
ROM_REGION(0x4000, "rom", 0)
|
||||
ROM_LOAD("bitstik2.rom", 0x0000, 0x2000, CRC(a2b5a743) SHA1(4d0040af6bdc6a587e42d4aa36d528b768cf9549))
|
||||
ROM_RELOAD(0x2000, 0x2000)
|
||||
ROM_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// INPUT_PORTS( bitstik )
|
||||
//-------------------------------------------------
|
||||
|
||||
static INPUT_PORTS_START(bitstik)
|
||||
PORT_START("CHANNEL0")
|
||||
PORT_BIT(0xff, 0x00, IPT_AD_STICK_X) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_NAME("AD Stick X") PORT_REVERSE
|
||||
|
||||
PORT_START("CHANNEL1")
|
||||
PORT_BIT(0xff, 0x00, IPT_AD_STICK_Y) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_NAME("AD Stick Y") PORT_REVERSE
|
||||
|
||||
PORT_START("CHANNEL2")
|
||||
PORT_BIT(0xff, 0x00, IPT_AD_STICK_Z) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_NAME("AD Stick Z") PORT_REVERSE
|
||||
|
||||
PORT_START("CHANNEL3")
|
||||
PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Right Button - Release")
|
||||
|
||||
PORT_START("BUTTONS")
|
||||
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Top Button - Execute")
|
||||
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Left Button - Confirm")
|
||||
INPUT_PORTS_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// input_ports - device-specific input ports
|
||||
//-------------------------------------------------
|
||||
|
||||
ioport_constructor bbc_bitstik_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME(bitstik);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
|
||||
const tiny_rom_entry *bbc_bitstik1_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME(bitstik1);
|
||||
}
|
||||
|
||||
const tiny_rom_entry *bbc_bitstik2_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME(bitstik2);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// bbc_bitstik_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
bbc_bitstik_device::bbc_bitstik_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
device_bbc_analogue_interface(mconfig, *this),
|
||||
m_channel(*this, "CHANNEL%u", 0),
|
||||
m_buttons(*this, "BUTTONS"),
|
||||
m_rom(*this, "rom")
|
||||
{
|
||||
}
|
||||
|
||||
bbc_bitstik1_device::bbc_bitstik1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
bbc_bitstik_device(mconfig, BBC_BITSTIK1, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
bbc_bitstik2_device::bbc_bitstik2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
bbc_bitstik_device(mconfig, BBC_BITSTIK2, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void bbc_bitstik_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void bbc_bitstik_device::device_reset()
|
||||
{
|
||||
machine().root_device().membank("bank4")->configure_entry(13, memregion("rom")->base());
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//**************************************************************************
|
||||
|
||||
uint8_t bbc_bitstik_device::ch_r(int channel)
|
||||
{
|
||||
return m_channel[channel]->read();
|
||||
}
|
||||
|
||||
uint8_t bbc_bitstik_device::pb_r()
|
||||
{
|
||||
return m_buttons->read() & 0x30;
|
||||
}
|
75
src/devices/bus/bbc/analogue/bitstik.h
Normal file
75
src/devices/bus/bbc/analogue/bitstik.h
Normal file
@ -0,0 +1,75 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nigel Barnes
|
||||
/**********************************************************************
|
||||
|
||||
Acorn ANF04 Bitstik
|
||||
|
||||
http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Acorn_BitStik.html
|
||||
|
||||
Robocom Bitstik 2
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef MAME_BUS_BBC_ANALOGUE_BITSTIK_H
|
||||
#define MAME_BUS_BBC_ANALOGUE_BITSTIK_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "analogue.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> bbc_bitstik_device
|
||||
|
||||
class bbc_bitstik_device :
|
||||
public device_t,
|
||||
public device_bbc_analogue_interface
|
||||
{
|
||||
protected:
|
||||
// construction/destruction
|
||||
bbc_bitstik_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
virtual uint8_t ch_r(int channel) override;
|
||||
virtual uint8_t pb_r() override;
|
||||
|
||||
private:
|
||||
required_ioport_array<4> m_channel;
|
||||
required_ioport m_buttons;
|
||||
required_memory_region m_rom;
|
||||
};
|
||||
|
||||
class bbc_bitstik1_device : public bbc_bitstik_device
|
||||
{
|
||||
public:
|
||||
bbc_bitstik1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
};
|
||||
|
||||
class bbc_bitstik2_device : public bbc_bitstik_device
|
||||
{
|
||||
public:
|
||||
bbc_bitstik2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(BBC_BITSTIK1, bbc_bitstik1_device)
|
||||
DECLARE_DEVICE_TYPE(BBC_BITSTIK2, bbc_bitstik2_device)
|
||||
|
||||
|
||||
#endif // MAME_BUS_BBC_ANALOGUE_BITSTIK_H
|
Loading…
Reference in New Issue
Block a user