mirror of
https://github.com/holub/mame
synced 2025-07-06 02:18:09 +03:00
Allow vic20/c64/c128 to share user port devices, removed c64 version of vic1011 and moved protovision 4 player adapter from bus/c64 to bus/vic20. Tried to test with http://code.google.com/p/commodore-multi-player/ as it supports protovision 4 player adapter, but it currently crashes. I have had to disable 1541 as it prevents quick loading from working. [smf]
This commit is contained in:
parent
9a6c91f3d4
commit
1eeab03497
6
.gitattributes
vendored
6
.gitattributes
vendored
@ -471,8 +471,6 @@ src/emu/bus/bw2/ramcard.c svneol=native#text/plain
|
||||
src/emu/bus/bw2/ramcard.h svneol=native#text/plain
|
||||
src/emu/bus/c64/16kb.c svneol=native#text/plain
|
||||
src/emu/bus/c64/16kb.h svneol=native#text/plain
|
||||
src/emu/bus/c64/4cga.c svneol=native#text/plain
|
||||
src/emu/bus/c64/4cga.h svneol=native#text/plain
|
||||
src/emu/bus/c64/4dxh.c svneol=native#text/plain
|
||||
src/emu/bus/c64/4dxh.h svneol=native#text/plain
|
||||
src/emu/bus/c64/4ksa.c svneol=native#text/plain
|
||||
@ -601,8 +599,6 @@ src/emu/bus/c64/turbo232.c svneol=native#text/plain
|
||||
src/emu/bus/c64/turbo232.h svneol=native#text/plain
|
||||
src/emu/bus/c64/user.c svneol=native#text/plain
|
||||
src/emu/bus/c64/user.h svneol=native#text/plain
|
||||
src/emu/bus/c64/vic1011.c svneol=native#text/plain
|
||||
src/emu/bus/c64/vic1011.h svneol=native#text/plain
|
||||
src/emu/bus/c64/vizastar.c svneol=native#text/plain
|
||||
src/emu/bus/c64/vizastar.h svneol=native#text/plain
|
||||
src/emu/bus/c64/vw64.c svneol=native#text/plain
|
||||
@ -845,6 +841,8 @@ src/emu/bus/vic10/exp.c svneol=native#text/plain
|
||||
src/emu/bus/vic10/exp.h svneol=native#text/plain
|
||||
src/emu/bus/vic10/std.c svneol=native#text/plain
|
||||
src/emu/bus/vic10/std.h svneol=native#text/plain
|
||||
src/emu/bus/vic20/4cga.c svneol=native#text/plain
|
||||
src/emu/bus/vic20/4cga.h svneol=native#text/plain
|
||||
src/emu/bus/vic20/exp.c svneol=native#text/plain
|
||||
src/emu/bus/vic20/exp.h svneol=native#text/plain
|
||||
src/emu/bus/vic20/megacart.c svneol=native#text/plain
|
||||
|
@ -147,14 +147,12 @@ BUSOBJS += $(BUSOBJ)/c64/westermann.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/xl80.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/zaxxon.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/user.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/4cga.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/4dxh.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/4ksa.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/4tba.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/16kb.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/bn1541.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/geocable.o
|
||||
BUSOBJS += $(BUSOBJ)/c64/vic1011.o
|
||||
endif
|
||||
|
||||
|
||||
@ -426,6 +424,7 @@ BUSOBJS += $(BUSOBJ)/vic20/vic1111.o
|
||||
BUSOBJS += $(BUSOBJ)/vic20/vic1112.o
|
||||
BUSOBJS += $(BUSOBJ)/vic20/vic1210.o
|
||||
BUSOBJS += $(BUSOBJ)/vic20/user.o
|
||||
BUSOBJS += $(BUSOBJ)/vic20/4cga.o
|
||||
BUSOBJS += $(BUSOBJ)/vic20/vic1011.o
|
||||
endif
|
||||
|
||||
|
@ -1,60 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder
|
||||
/**********************************************************************
|
||||
|
||||
Classical Games/Protovision 4 Player Interface emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_4CGA__
|
||||
#define __C64_4CGA__
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "user.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_4cga_device
|
||||
|
||||
class c64_4cga_device : public device_t,
|
||||
public device_c64_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual ioport_constructor device_input_ports() const;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_c64_user_port_interface overrides
|
||||
virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
|
||||
virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
|
||||
|
||||
private:
|
||||
required_ioport m_fire;
|
||||
required_ioport m_joy3;
|
||||
required_ioport m_joy4;
|
||||
|
||||
int m_port;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_4CGA;
|
||||
|
||||
|
||||
#endif
|
@ -28,20 +28,20 @@ const device_type C64_4DXH = &device_creator<c64_4dxh_device>;
|
||||
|
||||
static INPUT_PORTS_START( c64_4dxh )
|
||||
PORT_START("SP2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, cia_sp2_w)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7)
|
||||
|
||||
PORT_START("PB")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l)
|
||||
|
||||
PORT_START("PA2")
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -66,9 +66,7 @@ ioport_constructor c64_4dxh_device::device_input_ports() const
|
||||
|
||||
c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_4DXH, "C64 DXH 4-Player Adapter", tag, owner, clock, "c64_4dxh", __FILE__),
|
||||
device_c64_user_port_interface(mconfig, *this),
|
||||
m_pb(*this, "PB"),
|
||||
m_pa2(*this, "PA2")
|
||||
device_vic20_user_port_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -80,33 +78,3 @@ c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag,
|
||||
void c64_4dxh_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_r - port B read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_4dxh_device::c64_pb_r(address_space &space, offs_t offset)
|
||||
{
|
||||
return m_pb->read();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_w - port B write
|
||||
//-------------------------------------------------
|
||||
|
||||
int c64_4dxh_device::c64_pa2_r()
|
||||
{
|
||||
return BIT(m_pa2->read(), 0);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cnt1_w - CNT 1 write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_4dxh_device::c64_cnt1_w(int level)
|
||||
{
|
||||
m_slot->cia_cnt2_w(level);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
// ======================> c64_4dxh_device
|
||||
|
||||
class c64_4dxh_device : public device_t,
|
||||
public device_c64_user_port_interface
|
||||
public device_vic20_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -39,15 +39,6 @@ public:
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_c64_user_port_interface overrides
|
||||
virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
|
||||
virtual int c64_pa2_r();
|
||||
virtual void c64_cnt1_w(int level);
|
||||
|
||||
private:
|
||||
required_ioport m_pb;
|
||||
required_ioport m_pa2;
|
||||
};
|
||||
|
||||
|
||||
|
@ -28,20 +28,20 @@ const device_type C64_4KSA = &device_creator<c64_4ksa_device>;
|
||||
|
||||
static INPUT_PORTS_START( c64_4ksa )
|
||||
PORT_START("SP2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, cia_sp2_w)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7)
|
||||
|
||||
PORT_START("PB")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l)
|
||||
|
||||
PORT_START("PA2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -66,9 +66,7 @@ ioport_constructor c64_4ksa_device::device_input_ports() const
|
||||
|
||||
c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_4KSA, "C64 Kingsoft 4-Player Adapter", tag, owner, clock, "c64_4ksa", __FILE__),
|
||||
device_c64_user_port_interface(mconfig, *this),
|
||||
m_pb(*this, "PB"),
|
||||
m_pa2(*this, "PA2")
|
||||
device_vic20_user_port_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -80,33 +78,3 @@ c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag,
|
||||
void c64_4ksa_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_r - port B read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_4ksa_device::c64_pb_r(address_space &space, offs_t offset)
|
||||
{
|
||||
return m_pb->read();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_w - port B write
|
||||
//-------------------------------------------------
|
||||
|
||||
int c64_4ksa_device::c64_pa2_r()
|
||||
{
|
||||
return BIT(m_pa2->read(), 0);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cnt1_w - CNT 1 write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_4ksa_device::c64_cnt1_w(int level)
|
||||
{
|
||||
m_slot->cia_cnt2_w(level);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
// ======================> c64_4ksa_device
|
||||
|
||||
class c64_4ksa_device : public device_t,
|
||||
public device_c64_user_port_interface
|
||||
public device_vic20_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -39,15 +39,6 @@ public:
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_c64_user_port_interface overrides
|
||||
virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
|
||||
virtual int c64_pa2_r();
|
||||
virtual void c64_cnt1_w(int level);
|
||||
|
||||
private:
|
||||
required_ioport m_pb;
|
||||
required_ioport m_pa2;
|
||||
};
|
||||
|
||||
|
||||
|
@ -28,20 +28,20 @@ const device_type C64_4TBA = &device_creator<c64_4tba_device>;
|
||||
|
||||
static INPUT_PORTS_START( c64_4tba )
|
||||
PORT_START("SP2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_user_port_device, cia_sp2_w)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_7)
|
||||
|
||||
PORT_START("PB")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_c)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_d)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_e)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_f)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_h)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_j)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_k)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_l)
|
||||
|
||||
PORT_START("PA2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_vic20_user_port_interface, output_m)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -66,9 +66,7 @@ ioport_constructor c64_4tba_device::device_input_ports() const
|
||||
|
||||
c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_4TBA, "C64 Tie Break Adapter", tag, owner, clock, "c64_4tba", __FILE__),
|
||||
device_c64_user_port_interface(mconfig, *this),
|
||||
m_pb(*this, "PB"),
|
||||
m_pa2(*this, "PA2")
|
||||
device_vic20_user_port_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -80,33 +78,3 @@ c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag,
|
||||
void c64_4tba_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_r - port B read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_4tba_device::c64_pb_r(address_space &space, offs_t offset)
|
||||
{
|
||||
return m_pb->read();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_w - port B write
|
||||
//-------------------------------------------------
|
||||
|
||||
int c64_4tba_device::c64_pa2_r()
|
||||
{
|
||||
return BIT(m_pa2->read(), 0);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_cnt1_w - CNT 1 write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_4tba_device::c64_cnt1_w(int level)
|
||||
{
|
||||
m_slot->cia_cnt2_w(level);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
// ======================> c64_4tba_device
|
||||
|
||||
class c64_4tba_device : public device_t,
|
||||
public device_c64_user_port_interface
|
||||
public device_vic20_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -39,15 +39,6 @@ public:
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_c64_user_port_interface overrides
|
||||
virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
|
||||
virtual int c64_pa2_r();
|
||||
virtual void c64_cnt1_w(int level);
|
||||
|
||||
private:
|
||||
required_ioport m_pb;
|
||||
required_ioport m_pa2;
|
||||
};
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ device_c64_floppy_parallel_interface::~device_c64_floppy_parallel_interface()
|
||||
|
||||
c64_bn1541_device::c64_bn1541_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_BN1541, "C64 Burst Nibbler 1541/1571 Parallel Cable", tag, owner, clock, "c64_bn1541", __FILE__),
|
||||
device_c64_user_port_interface(mconfig, *this),
|
||||
device_vic20_user_port_interface(mconfig, *this),
|
||||
device_c64_floppy_parallel_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
@ -106,7 +106,14 @@ void c64_bn1541_device::parallel_data_w(UINT8 data)
|
||||
{
|
||||
if (LOG) logerror("1541 parallel data %02x\n", data);
|
||||
|
||||
m_parallel_data = data;
|
||||
output_c((data>>0)&1);
|
||||
output_d((data>>1)&1);
|
||||
output_e((data>>2)&1);
|
||||
output_f((data>>3)&1);
|
||||
output_h((data>>4)&1);
|
||||
output_j((data>>5)&1);
|
||||
output_k((data>>6)&1);
|
||||
output_l((data>>7)&1);
|
||||
}
|
||||
|
||||
|
||||
@ -118,40 +125,28 @@ void c64_bn1541_device::parallel_strobe_w(int state)
|
||||
{
|
||||
if (LOG) logerror("1541 parallel strobe %u\n", state);
|
||||
|
||||
m_slot->cia_flag2_w(state);
|
||||
output_b(state);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_r - port B read
|
||||
// update_output
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_bn1541_device::c64_pb_r(address_space &space, offs_t offset)
|
||||
void c64_bn1541_device::update_output()
|
||||
{
|
||||
return m_parallel_data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_w - port B write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_bn1541_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
|
||||
{
|
||||
if (LOG) logerror("C64 parallel data %02x\n", data);
|
||||
|
||||
if (m_other != NULL)
|
||||
{
|
||||
m_other->parallel_data_w(data);
|
||||
m_other->parallel_data_w(m_parallel_output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pc2_w - CIA2 PC write
|
||||
// input_8 - CIA2 PC write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_bn1541_device::c64_pc2_w(int state)
|
||||
WRITE_LINE_MEMBER(c64_bn1541_device::input_8)
|
||||
{
|
||||
if (LOG) logerror("C64 parallel strobe %u\n", state);
|
||||
|
||||
|
@ -46,8 +46,8 @@ protected:
|
||||
// ======================> c64_bn1541_device
|
||||
|
||||
class c64_bn1541_device : public device_t,
|
||||
public device_c64_user_port_interface,
|
||||
public device_c64_floppy_parallel_interface
|
||||
public device_vic20_user_port_interface,
|
||||
public device_c64_floppy_parallel_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -57,14 +57,23 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_c64_user_port_interface overrides
|
||||
virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
|
||||
virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
|
||||
virtual void c64_pc2_w(int level);
|
||||
|
||||
// device_c64_floppy_parallel_interface overrides
|
||||
virtual void parallel_data_w(UINT8 data);
|
||||
virtual void parallel_strobe_w(int state);
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER(input_8);
|
||||
virtual WRITE_LINE_MEMBER(input_c) { if (state) m_parallel_output |= 1; else m_parallel_output &= ~1; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_d) { if (state) m_parallel_output |= 2; else m_parallel_output &= ~2; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_e) { if (state) m_parallel_output |= 4; else m_parallel_output &= ~4; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_f) { if (state) m_parallel_output |= 8; else m_parallel_output &= ~8; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_h) { if (state) m_parallel_output |= 16; else m_parallel_output &= ~16; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_j) { if (state) m_parallel_output |= 32; else m_parallel_output &= ~32; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_k) { if (state) m_parallel_output |= 64; else m_parallel_output &= ~64; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_l) { if (state) m_parallel_output |= 128; else m_parallel_output &= ~128; update_output(); }
|
||||
|
||||
private:
|
||||
void update_output();
|
||||
UINT8 m_parallel_output;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// license:BSD-3-Clause
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder
|
||||
/**********************************************************************
|
||||
|
||||
@ -34,7 +34,7 @@ const device_type C64_GEOCABLE = &device_creator<c64_geocable_device>;
|
||||
|
||||
WRITE_LINE_MEMBER( c64_geocable_device::busy_w )
|
||||
{
|
||||
m_slot->cia_flag2_w(state);
|
||||
output_b(state);
|
||||
}
|
||||
|
||||
static const centronics_interface centronics_intf =
|
||||
@ -76,7 +76,7 @@ machine_config_constructor c64_geocable_device::device_mconfig_additions() const
|
||||
|
||||
c64_geocable_device::c64_geocable_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_GEOCABLE, "C64 geoCable", tag, owner, clock, "c64_geocable", __FILE__),
|
||||
device_c64_user_port_interface(mconfig, *this),
|
||||
device_vic20_user_port_interface(mconfig, *this),
|
||||
m_centronics(*this, CENTRONICS_TAG)
|
||||
{
|
||||
}
|
||||
@ -92,20 +92,20 @@ void c64_geocable_device::device_start()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_w - port B write
|
||||
// update_output
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_geocable_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
|
||||
void c64_geocable_device::update_output()
|
||||
{
|
||||
m_centronics->write(space, 0, data);
|
||||
m_centronics->write(m_parallel_output);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_w - port B write
|
||||
// input_8 - CIA2 PC write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_geocable_device::c64_pa2_w(int level)
|
||||
WRITE_LINE_MEMBER(c64_geocable_device::input_8)
|
||||
{
|
||||
m_centronics->strobe_w(level);
|
||||
m_centronics->strobe_w(state);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
// ======================> c64_geocable_device
|
||||
|
||||
class c64_geocable_device : public device_t,
|
||||
public device_c64_user_port_interface
|
||||
public device_vic20_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -44,12 +44,23 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_c64_user_port_interface overrides
|
||||
virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
|
||||
virtual void c64_pa2_w(int level);
|
||||
// device_vic20_user_port_interface overrides
|
||||
virtual DECLARE_WRITE_LINE_MEMBER(input_8);
|
||||
virtual WRITE_LINE_MEMBER(input_c) { if (state) m_parallel_output |= 1; else m_parallel_output &= ~1; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_d) { if (state) m_parallel_output |= 2; else m_parallel_output &= ~2; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_e) { if (state) m_parallel_output |= 4; else m_parallel_output &= ~4; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_f) { if (state) m_parallel_output |= 8; else m_parallel_output &= ~8; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_h) { if (state) m_parallel_output |= 16; else m_parallel_output &= ~16; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_j) { if (state) m_parallel_output |= 32; else m_parallel_output &= ~32; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_k) { if (state) m_parallel_output |= 64; else m_parallel_output &= ~64; update_output(); }
|
||||
virtual WRITE_LINE_MEMBER(input_l) { if (state) m_parallel_output |= 128; else m_parallel_output &= ~128; update_output(); }
|
||||
|
||||
private:
|
||||
required_device<centronics_device> m_centronics;
|
||||
|
||||
void update_output();
|
||||
|
||||
UINT8 m_parallel_output;
|
||||
};
|
||||
|
||||
|
||||
|
@ -11,109 +11,19 @@
|
||||
|
||||
#include "user.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
const device_type C64_USER_PORT = &device_creator<c64_user_port_device>;
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CARD INTERFACE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_c64_user_port_interface - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
device_c64_user_port_interface::device_c64_user_port_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig,device)
|
||||
{
|
||||
m_slot = dynamic_cast<c64_user_port_device *>(device.owner());
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ~device_c64_user_port_interface - destructor
|
||||
//-------------------------------------------------
|
||||
|
||||
device_c64_user_port_interface::~device_c64_user_port_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_user_port_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
c64_user_port_device::c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_USER_PORT, "C64 user port", tag, owner, clock, "c64_user_port", __FILE__),
|
||||
device_slot_interface(mconfig, *this),
|
||||
m_write_cnt1(*this),
|
||||
m_write_sp1(*this),
|
||||
m_write_cnt2(*this),
|
||||
m_write_sp2(*this),
|
||||
m_write_flag2(*this),
|
||||
m_write_reset(*this)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_user_port_device::device_start()
|
||||
{
|
||||
m_card = dynamic_cast<device_c64_user_port_interface *>(get_card_device());
|
||||
|
||||
// resolve callbacks
|
||||
m_write_cnt1.resolve_safe();
|
||||
m_write_sp1.resolve_safe();
|
||||
m_write_cnt2.resolve_safe();
|
||||
m_write_sp2.resolve_safe();
|
||||
m_write_flag2.resolve_safe();
|
||||
m_write_reset.resolve_safe();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_user_port_device::device_reset()
|
||||
{
|
||||
if (get_card_device())
|
||||
{
|
||||
get_card_device()->reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER( c64_user_port_device::pb_r ) { UINT8 data = 0xff; if (m_card != NULL) data = m_card->c64_pb_r(space, offset); return data; }
|
||||
WRITE8_MEMBER( c64_user_port_device::pb_w ) { if (m_card != NULL) m_card->c64_pb_w(space, offset, data); }
|
||||
READ_LINE_MEMBER( c64_user_port_device::pa2_r ) { int state = 1; if (m_card != NULL) state = m_card->c64_pa2_r(); return state; }
|
||||
WRITE_LINE_MEMBER( c64_user_port_device::pa2_w ) { if (m_card != NULL) m_card->c64_pa2_w(state); }
|
||||
WRITE_LINE_MEMBER( c64_user_port_device::pc2_w ) { if (m_card != NULL) m_card->c64_pc2_w(state); }
|
||||
WRITE_LINE_MEMBER( c64_user_port_device::atn_w ) { if (m_card != NULL) m_card->c64_atn_w(state); }
|
||||
WRITE_LINE_MEMBER( c64_user_port_device::cnt1_w ) { if (m_card != NULL) m_card->c64_cnt1_w(state); }
|
||||
WRITE_LINE_MEMBER( c64_user_port_device::sp1_w ) { if (m_card != NULL) m_card->c64_sp1_w(state); }
|
||||
WRITE_LINE_MEMBER( c64_user_port_device::cnt2_w ) { if (m_card != NULL) m_card->c64_cnt2_w(state); }
|
||||
WRITE_LINE_MEMBER( c64_user_port_device::sp2_w ) { if (m_card != NULL) m_card->c64_sp2_w(state); }
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( c64_user_port_cards )
|
||||
//-------------------------------------------------
|
||||
|
||||
// slot devices
|
||||
#include "bus/vic20/4cga.h"
|
||||
#include "4dxh.h"
|
||||
#include "4ksa.h"
|
||||
#include "4tba.h"
|
||||
#include "bn1541.h"
|
||||
#include "geocable.h"
|
||||
#include "bus/vic20/vic1011.h"
|
||||
|
||||
SLOT_INTERFACE_START( c64_user_port_cards )
|
||||
SLOT_INTERFACE("4cga", C64_4CGA)
|
||||
SLOT_INTERFACE("4dxh", C64_4DXH)
|
||||
@ -121,5 +31,5 @@ SLOT_INTERFACE_START( c64_user_port_cards )
|
||||
SLOT_INTERFACE("4tba", C64_4TBA)
|
||||
SLOT_INTERFACE("bn1541", C64_BN1541)
|
||||
SLOT_INTERFACE("geocable", C64_GEOCABLE)
|
||||
SLOT_INTERFACE("rs232", C64_VIC1011)
|
||||
SLOT_INTERFACE("rs232", VIC1011)
|
||||
SLOT_INTERFACE_END
|
||||
|
@ -29,142 +29,8 @@
|
||||
#ifndef __C64_USER_PORT__
|
||||
#define __C64_USER_PORT__
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define C64_USER_PORT_TAG "user"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_C64_USER_PORT_ADD(_tag, _slot_intf, _def_slot, _reset) \
|
||||
MCFG_DEVICE_ADD(_tag, C64_USER_PORT, 0) \
|
||||
downcast<c64_user_port_device *>(device)->set_reset_callback(DEVCB2_##_reset); \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
||||
|
||||
#define MCFG_C64_USER_PORT_CIA1_CALLBACKS(_cnt, _sp) \
|
||||
downcast<c64_user_port_device *>(device)->set_cia1_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp);
|
||||
|
||||
#define MCFG_C64_USER_PORT_CIA2_CALLBACKS(_cnt, _sp, _flag) \
|
||||
downcast<c64_user_port_device *>(device)->set_cia2_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp, DEVCB2_##_flag);
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_user_port_device
|
||||
|
||||
class device_c64_user_port_interface;
|
||||
|
||||
class c64_user_port_device : public device_t,
|
||||
public device_slot_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
template<class _reset> void set_reset_callback(_reset reset) { m_write_reset.set_callback(reset); }
|
||||
|
||||
template<class _cnt, class _sp> void set_cia1_callbacks(_cnt cnt, _sp sp) {
|
||||
m_write_cnt1.set_callback(cnt);
|
||||
m_write_sp1.set_callback(sp);
|
||||
}
|
||||
|
||||
template<class _cnt, class _sp, class _flag> void set_cia2_callbacks(_cnt cnt, _sp sp, _flag flag) {
|
||||
m_write_cnt2.set_callback(cnt);
|
||||
m_write_sp2.set_callback(sp);
|
||||
m_write_flag2.set_callback(flag);
|
||||
}
|
||||
|
||||
// computer interface
|
||||
DECLARE_READ8_MEMBER( pb_r );
|
||||
DECLARE_WRITE8_MEMBER( pb_w );
|
||||
DECLARE_READ_LINE_MEMBER( pa2_r );
|
||||
DECLARE_WRITE_LINE_MEMBER( pa2_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( pc2_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( atn_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( cnt1_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( sp1_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( cnt2_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( sp2_w );
|
||||
|
||||
// cartridge interface
|
||||
DECLARE_WRITE_LINE_MEMBER( cia_cnt1_w ) { m_write_cnt1(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( cia_sp1_w ) { m_write_sp1(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( cia_cnt2_w ) { m_write_cnt2(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( cia_sp2_w ) { m_write_sp2(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( cia_flag2_w ) { m_write_flag2(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_write_reset(state); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
devcb2_write_line m_write_cnt1;
|
||||
devcb2_write_line m_write_sp1;
|
||||
devcb2_write_line m_write_cnt2;
|
||||
devcb2_write_line m_write_sp2;
|
||||
devcb2_write_line m_write_flag2;
|
||||
devcb2_write_line m_write_reset;
|
||||
|
||||
device_c64_user_port_interface *m_card;
|
||||
};
|
||||
|
||||
|
||||
// ======================> device_c64_user_port_interface
|
||||
|
||||
// class representing interface-specific live c64_expansion card
|
||||
class device_c64_user_port_interface : public device_slot_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
device_c64_user_port_interface(const machine_config &mconfig, device_t &device);
|
||||
virtual ~device_c64_user_port_interface();
|
||||
|
||||
virtual UINT8 c64_pb_r(address_space &space, offs_t offset) { return 0xff; };
|
||||
virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data) { };
|
||||
|
||||
virtual int c64_pa2_r() { return 1; };
|
||||
virtual void c64_pa2_w(int state) { };
|
||||
virtual void c64_cnt1_w(int state) { };
|
||||
virtual void c64_sp1_w(int state) { };
|
||||
virtual void c64_pc2_w(int state) { };
|
||||
virtual void c64_cnt2_w(int state) { };
|
||||
virtual void c64_sp2_w(int state) { };
|
||||
virtual void c64_atn_w(int state) { };
|
||||
|
||||
protected:
|
||||
c64_user_port_device *m_slot;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_USER_PORT;
|
||||
|
||||
|
||||
// slot devices
|
||||
#include "4cga.h"
|
||||
#include "4dxh.h"
|
||||
#include "4ksa.h"
|
||||
#include "4tba.h"
|
||||
#include "bn1541.h"
|
||||
#include "geocable.h"
|
||||
#include "vic1011.h"
|
||||
#include "bus/vic20/user.h"
|
||||
|
||||
SLOT_INTERFACE_EXTERN( c64_user_port_cards );
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,153 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder
|
||||
/**********************************************************************
|
||||
|
||||
Commodore VIC-1011A/B RS-232C Adapter emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "vic1011.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MACROS/CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define RS232_TAG "rs232"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type C64_VIC1011 = &device_creator<c64_vic1011_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// MACHINE_DRIVER( vic1011 )
|
||||
//-------------------------------------------------
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( vic1011 )
|
||||
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL)
|
||||
MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(DEVICE_SELF, c64_vic1011_device, rxd_w))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor c64_vic1011_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( vic1011 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_vic1011_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
c64_vic1011_device::c64_vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, C64_VIC1011, "C64 VIC1011", tag, owner, clock, "c64_vic1011", __FILE__),
|
||||
device_c64_user_port_interface(mconfig, *this),
|
||||
m_rs232(*this, RS232_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_vic1011_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_r - port B read
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_vic1011_device::c64_pb_r(address_space &space, offs_t offset)
|
||||
{
|
||||
/*
|
||||
|
||||
bit description
|
||||
|
||||
0 Sin
|
||||
1
|
||||
2
|
||||
3
|
||||
4 DCDin
|
||||
5
|
||||
6 CTS
|
||||
7 DSR
|
||||
|
||||
*/
|
||||
|
||||
UINT8 data = 0;
|
||||
|
||||
data |= !m_rs232->rx();
|
||||
data |= m_rs232->dcd_r() << 4;
|
||||
data |= m_rs232->cts_r() << 6;
|
||||
data |= m_rs232->dsr_r() << 7;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_w - port B write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_vic1011_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
|
||||
{
|
||||
/*
|
||||
|
||||
bit description
|
||||
|
||||
0
|
||||
1 RTS
|
||||
2 DTR
|
||||
3
|
||||
4
|
||||
5 DCDout
|
||||
6
|
||||
7
|
||||
|
||||
*/
|
||||
|
||||
m_rs232->rts_w(BIT(data, 1));
|
||||
m_rs232->dtr_w(BIT(data, 2));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pa2_w - PA2 write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_vic1011_device::c64_pa2_w(int state)
|
||||
{
|
||||
m_rs232->tx(!state);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// rxd_w -
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( c64_vic1011_device::rxd_w )
|
||||
{
|
||||
m_slot->cia_flag2_w(!state);
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder
|
||||
/**********************************************************************
|
||||
|
||||
Commodore VIC-1011A/B RS-232C Adapter emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_VIC1011__
|
||||
#define __C64_VIC1011__
|
||||
|
||||
#include "emu.h"
|
||||
#include "user.h"
|
||||
#include "machine/serial.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_vic1011_device
|
||||
|
||||
class c64_vic1011_device : public device_t,
|
||||
public device_c64_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( rxd_w );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_c64_user_port_interface overrides
|
||||
virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
|
||||
virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
|
||||
virtual void c64_pa2_w(int state);
|
||||
|
||||
private:
|
||||
required_device<rs232_port_device> m_rs232;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_VIC1011;
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -25,23 +25,20 @@ const device_type C64_4CGA = &device_creator<c64_4cga_device>;
|
||||
|
||||
static INPUT_PORTS_START( c64_4player )
|
||||
PORT_START("JOY3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_0)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_3)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy3_4)
|
||||
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("JOY4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("FIRE")
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0xcf, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_0)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_3)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, c64_4cga_device, write_joy4_4)
|
||||
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -66,10 +63,7 @@ ioport_constructor c64_4cga_device::device_input_ports() const
|
||||
|
||||
c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__),
|
||||
device_c64_user_port_interface(mconfig, *this),
|
||||
m_fire(*this, "FIRE"),
|
||||
m_joy3(*this, "JOY3"),
|
||||
m_joy4(*this, "JOY4"),
|
||||
device_vic20_user_port_interface(mconfig, *this),
|
||||
m_port(0)
|
||||
{
|
||||
}
|
||||
@ -85,25 +79,29 @@ void c64_4cga_device::device_start()
|
||||
save_item(NAME(m_port));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// c64_pb_r - port B read
|
||||
// update_output
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 c64_4cga_device::c64_pb_r(address_space &space, offs_t offset)
|
||||
void c64_4cga_device::update_output()
|
||||
{
|
||||
UINT8 data = m_fire->read();
|
||||
UINT8 data;
|
||||
|
||||
if (m_port)
|
||||
{
|
||||
data &= m_joy3->read();
|
||||
data = m_joy3;
|
||||
}
|
||||
else
|
||||
{
|
||||
data &= m_joy4->read();
|
||||
data = m_joy4;
|
||||
}
|
||||
|
||||
return data;
|
||||
output_c((data>>0)&1);
|
||||
output_d((data>>1)&1);
|
||||
output_e((data>>2)&1);
|
||||
output_f((data>>3)&1);
|
||||
output_h((data>>4)&1);
|
||||
output_j((data>>5)&1);
|
||||
}
|
||||
|
||||
|
||||
@ -111,7 +109,8 @@ UINT8 c64_4cga_device::c64_pb_r(address_space &space, offs_t offset)
|
||||
// c64_pb_w - port B write
|
||||
//-------------------------------------------------
|
||||
|
||||
void c64_4cga_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
|
||||
WRITE_LINE_MEMBER( c64_4cga_device::input_l )
|
||||
{
|
||||
m_port = BIT(data, 7);
|
||||
m_port = state;
|
||||
update_output();
|
||||
}
|
73
src/emu/bus/vic20/4cga.h
Normal file
73
src/emu/bus/vic20/4cga.h
Normal file
@ -0,0 +1,73 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder
|
||||
/**********************************************************************
|
||||
|
||||
Classical Games/Protovision 4 Player Interface emulation
|
||||
|
||||
Copyright MESS Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __C64_4CGA__
|
||||
#define __C64_4CGA__
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "user.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> c64_4cga_device
|
||||
|
||||
class c64_4cga_device : public device_t,
|
||||
public device_vic20_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual ioport_constructor device_input_ports() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy3_0) { if (state) m_joy3 |= 1; else m_joy3 &= ~1; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy3_1) { if (state) m_joy3 |= 2; else m_joy3 &= ~2; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy3_2) { if (state) m_joy3 |= 4; else m_joy3 &= ~4; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy3_3) { if (state) m_joy3 |= 8; else m_joy3 &= ~8; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy3_4) { if (state) m_joy3 |= 16; else m_joy3 &= ~16; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy3_5) { if (state) m_joy3 |= 32; else m_joy3 &= ~32; update_output(); }
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy4_0) { if (state) m_joy4 |= 1; else m_joy4 &= ~1; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy4_1) { if (state) m_joy4 |= 2; else m_joy4 &= ~2; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy4_2) { if (state) m_joy4 |= 4; else m_joy4 &= ~4; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy4_3) { if (state) m_joy4 |= 8; else m_joy4 &= ~8; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy4_4) { if (state) m_joy4 |= 16; else m_joy4 &= ~16; update_output(); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_joy4_5) { if (state) m_joy4 |= 32; else m_joy4 &= ~32; update_output(); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
// device_vic20_user_port_interface overrides
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_l );
|
||||
|
||||
private:
|
||||
void update_output();
|
||||
|
||||
int m_port;
|
||||
UINT8 m_joy3;
|
||||
UINT8 m_joy4;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type C64_4CGA;
|
||||
|
||||
|
||||
#endif
|
@ -139,23 +139,23 @@ void vic20_user_port_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_3 ) { if (m_card != NULL) m_card->write_3(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_4 ) { if (m_card != NULL) m_card->write_4(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_5 ) { if (m_card != NULL) m_card->write_5(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_6 ) { if (m_card != NULL) m_card->write_6(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_7 ) { if (m_card != NULL) m_card->write_7(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_8 ) { if (m_card != NULL) m_card->write_8(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_9 ) { if (m_card != NULL) m_card->write_9(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_b ) { if (m_card != NULL) m_card->write_b(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_c ) { if (m_card != NULL) m_card->write_c(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_d ) { if (m_card != NULL) m_card->write_d(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_e ) { if (m_card != NULL) m_card->write_e(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_f ) { if (m_card != NULL) m_card->write_f(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_h ) { if (m_card != NULL) m_card->write_h(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_j ) { if (m_card != NULL) m_card->write_j(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_k ) { if (m_card != NULL) m_card->write_k(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_l ) { if (m_card != NULL) m_card->write_l(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_m ) { if (m_card != NULL) m_card->write_m(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_3 ) { if (m_card != NULL) m_card->input_3(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_4 ) { if (m_card != NULL) m_card->input_4(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_5 ) { if (m_card != NULL) m_card->input_5(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_6 ) { if (m_card != NULL) m_card->input_6(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_7 ) { if (m_card != NULL) m_card->input_7(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_8 ) { if (m_card != NULL) m_card->input_8(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_9 ) { if (m_card != NULL) m_card->input_9(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_b ) { if (m_card != NULL) m_card->input_b(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_c ) { if (m_card != NULL) m_card->input_c(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_d ) { if (m_card != NULL) m_card->input_d(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_e ) { if (m_card != NULL) m_card->input_e(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_f ) { if (m_card != NULL) m_card->input_f(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_h ) { if (m_card != NULL) m_card->input_h(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_j ) { if (m_card != NULL) m_card->input_j(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_k ) { if (m_card != NULL) m_card->input_k(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_l ) { if (m_card != NULL) m_card->input_l(state); }
|
||||
WRITE_LINE_MEMBER( vic20_user_port_device::write_m ) { if (m_card != NULL) m_card->input_m(state); }
|
||||
|
||||
|
||||
|
||||
@ -164,8 +164,10 @@ WRITE_LINE_MEMBER( vic20_user_port_device::write_m ) { if (m_card != NULL) m_car
|
||||
//-------------------------------------------------
|
||||
|
||||
// slot devices
|
||||
#include "4cga.h"
|
||||
#include "vic1011.h"
|
||||
|
||||
SLOT_INTERFACE_START( vic20_user_port_cards )
|
||||
SLOT_INTERFACE("4cga", C64_4CGA)
|
||||
SLOT_INTERFACE("rs232", VIC1011)
|
||||
SLOT_INTERFACE_END
|
||||
|
@ -175,30 +175,48 @@ protected:
|
||||
|
||||
// ======================> device_vic20_user_port_interface
|
||||
|
||||
// class representing interface-specific live vic20_expansion card
|
||||
// class representing interface-specific vic20_expansion card
|
||||
class device_vic20_user_port_interface : public device_slot_card_interface
|
||||
{
|
||||
public:
|
||||
device_vic20_user_port_interface(const machine_config &mconfig, device_t &device);
|
||||
virtual ~device_vic20_user_port_interface();
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( write_3 ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_4 ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_5 ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_6 ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_7 ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_8 ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_9 ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_b ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_c ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_d ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_e ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_f ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_h ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_j ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_k ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_l ) {}
|
||||
DECLARE_WRITE_LINE_MEMBER( write_m ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_3 ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_4 ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_5 ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_6 ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_7 ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_8 ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_9 ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_b ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_c ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_d ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_e ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_f ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_h ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_j ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_k ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_l ) {}
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_m ) {}
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( output_3 ) { m_slot->m_3_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_4 ) { m_slot->m_4_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_5 ) { m_slot->m_5_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_6 ) { m_slot->m_6_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_7 ) { m_slot->m_7_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_8 ) { m_slot->m_8_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_9 ) { m_slot->m_9_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_b ) { m_slot->m_b_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_c ) { m_slot->m_c_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_d ) { m_slot->m_d_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_e ) { m_slot->m_e_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_f ) { m_slot->m_f_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_h ) { m_slot->m_h_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_j ) { m_slot->m_j_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_k ) { m_slot->m_k_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_l ) { m_slot->m_l_handler(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( output_m ) { m_slot->m_m_handler(state); }
|
||||
|
||||
protected:
|
||||
vic20_user_port_device *m_slot;
|
||||
|
@ -34,10 +34,10 @@ const device_type VIC1011 = &device_creator<vic1011_device>;
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( vic1011 )
|
||||
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL)
|
||||
MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_rxd))
|
||||
MCFG_RS232_OUT_DCD_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_dcdin))
|
||||
MCFG_RS232_OUT_CTS_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_cts))
|
||||
MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, write_dsr))
|
||||
MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_rxd))
|
||||
MCFG_RS232_OUT_DCD_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_h))
|
||||
MCFG_RS232_OUT_CTS_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_k))
|
||||
MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(DEVICE_SELF, vic1011_device, output_l))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -77,43 +77,28 @@ void vic1011_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( vic1011_device::write_rxd )
|
||||
WRITE_LINE_MEMBER( vic1011_device::output_rxd )
|
||||
{
|
||||
m_slot->m_b_handler(!state);
|
||||
m_slot->m_c_handler(!state);
|
||||
output_b(!state);
|
||||
output_c(!state);
|
||||
}
|
||||
|
||||
void vic1011_device::write_d(int state)
|
||||
void vic1011_device::input_d(int state)
|
||||
{
|
||||
m_rs232->rts_w(state);
|
||||
}
|
||||
|
||||
void vic1011_device::write_e(int state)
|
||||
void vic1011_device::input_e(int state)
|
||||
{
|
||||
m_rs232->dtr_w(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( vic1011_device::write_dcdin )
|
||||
{
|
||||
m_slot->m_h_handler(state);
|
||||
}
|
||||
|
||||
void vic1011_device::write_j(int state)
|
||||
void vic1011_device::input_j(int state)
|
||||
{
|
||||
/// dcdout
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( vic1011_device::write_cts )
|
||||
{
|
||||
m_slot->m_k_handler(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( vic1011_device::write_dsr )
|
||||
{
|
||||
m_slot->m_l_handler(state);
|
||||
}
|
||||
|
||||
void vic1011_device::write_m(int state)
|
||||
void vic1011_device::input_m(int state)
|
||||
{
|
||||
m_rs232->tx(!state);
|
||||
}
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
// ======================> vic1011_device
|
||||
|
||||
class vic1011_device : public device_t,
|
||||
public device_vic20_user_port_interface
|
||||
class vic1011_device : public device_t,
|
||||
public device_vic20_user_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -36,14 +36,13 @@ public:
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( write_rxd );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_d );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_e );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_dcdin );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_j );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_cts );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_dsr );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_m );
|
||||
// device_vic20_user_port_interface overrides
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_d );
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_e );
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_j );
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_m );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( output_rxd );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
|
@ -1096,6 +1096,7 @@ WRITE8_MEMBER( c128_state::cia1_pb_w )
|
||||
WRITE_LINE_MEMBER( c128_state::cia1_cnt_w )
|
||||
{
|
||||
m_cnt1 = state;
|
||||
m_user->write_4(state);
|
||||
|
||||
update_iec();
|
||||
}
|
||||
@ -1103,6 +1104,7 @@ WRITE_LINE_MEMBER( c128_state::cia1_cnt_w )
|
||||
WRITE_LINE_MEMBER( c128_state::cia1_sp_w )
|
||||
{
|
||||
m_sp1 = state;
|
||||
m_user->write_5(state);
|
||||
|
||||
update_iec();
|
||||
}
|
||||
@ -1139,7 +1141,7 @@ READ8_MEMBER( c128_state::cia2_pa_r )
|
||||
UINT8 data = 0;
|
||||
|
||||
// user port
|
||||
data |= m_user->pa2_r() << 2;
|
||||
data |= m_user_pa2 << 2;
|
||||
|
||||
// IEC bus
|
||||
data |= m_iec->clk_r() << 6;
|
||||
@ -1170,7 +1172,7 @@ WRITE8_MEMBER( c128_state::cia2_pa_w )
|
||||
m_va15 = BIT(data, 1);
|
||||
|
||||
// user port
|
||||
m_user->pa2_w(BIT(data, 2));
|
||||
m_user->write_m(BIT(data, 2));
|
||||
|
||||
// IEC bus
|
||||
m_iec->atn_w(!BIT(data, 3));
|
||||
@ -1180,6 +1182,22 @@ WRITE8_MEMBER( c128_state::cia2_pa_w )
|
||||
update_iec();
|
||||
}
|
||||
|
||||
READ8_MEMBER( c128_state::cia2_pb_r )
|
||||
{
|
||||
return m_user_pb;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( c128_state::cia2_pb_w )
|
||||
{
|
||||
m_user->write_c((data>>0)&1);
|
||||
m_user->write_d((data>>1)&1);
|
||||
m_user->write_e((data>>2)&1);
|
||||
m_user->write_f((data>>3)&1);
|
||||
m_user->write_h((data>>4)&1);
|
||||
m_user->write_j((data>>5)&1);
|
||||
m_user->write_k((data>>6)&1);
|
||||
m_user->write_l((data>>7)&1);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// M6510_INTERFACE( cpu_intf )
|
||||
@ -1463,9 +1481,9 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL)
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL)
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
|
||||
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
|
||||
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w))
|
||||
@ -1473,9 +1491,25 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
|
||||
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL)
|
||||
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
|
||||
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w))
|
||||
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c128_state, exp_reset_w))
|
||||
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
|
||||
MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
|
||||
MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w))
|
||||
MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
|
||||
MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0))
|
||||
MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1))
|
||||
MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2))
|
||||
MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3))
|
||||
MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4))
|
||||
MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5))
|
||||
MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6))
|
||||
MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7))
|
||||
MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2))
|
||||
|
||||
MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
|
||||
|
||||
// software list
|
||||
@ -1578,10 +1612,10 @@ static MACHINE_CONFIG_START( pal, c128_state )
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(WRITELINE(c128_state, cia1_cnt_w), WRITELINE(c128_state, cia1_sp_w))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia1_pa_r), NULL)
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia1_pb_r), WRITE8(c128_state, cia1_pb_w), NULL)
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c128_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c128_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c128_state, cia2_pa_r), WRITE8(c128_state, cia2_pa_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c128_state, cia2_pb_r), WRITE8(c128_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
|
||||
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
|
||||
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w))
|
||||
@ -1589,9 +1623,25 @@ static MACHINE_CONFIG_START( pal, c128_state )
|
||||
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL)
|
||||
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
|
||||
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w))
|
||||
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c128_state, exp_reset_w))
|
||||
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
|
||||
MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
|
||||
MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w))
|
||||
MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
|
||||
MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c128_state, write_user_pb0))
|
||||
MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c128_state, write_user_pb1))
|
||||
MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c128_state, write_user_pb2))
|
||||
MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c128_state, write_user_pb3))
|
||||
MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c128_state, write_user_pb4))
|
||||
MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c128_state, write_user_pb5))
|
||||
MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c128_state, write_user_pb6))
|
||||
MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c128_state, write_user_pb7))
|
||||
MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c128_state, write_user_pa2))
|
||||
|
||||
MCFG_QUICKLOAD_ADD("quickload", c128_state, cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
|
||||
|
||||
// software list
|
||||
|
@ -769,7 +769,7 @@ READ8_MEMBER( c64_state::cia2_pa_r )
|
||||
UINT8 data = 0;
|
||||
|
||||
// user port
|
||||
data |= m_user->pa2_r() << 2;
|
||||
data |= m_user_pa2 << 2;
|
||||
|
||||
// IEC bus
|
||||
data |= m_iec->clk_r() << 6;
|
||||
@ -800,7 +800,7 @@ WRITE8_MEMBER( c64_state::cia2_pa_w )
|
||||
m_va15 = BIT(data, 1);
|
||||
|
||||
// user port
|
||||
m_user->pa2_w(BIT(data, 2));
|
||||
m_user->write_m(BIT(data, 2));
|
||||
|
||||
// IEC bus
|
||||
m_iec->atn_w(!BIT(data, 3));
|
||||
@ -808,6 +808,22 @@ WRITE8_MEMBER( c64_state::cia2_pa_w )
|
||||
m_iec->data_w(!BIT(data, 5));
|
||||
}
|
||||
|
||||
READ8_MEMBER( c64_state::cia2_pb_r )
|
||||
{
|
||||
return m_user_pb;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( c64_state::cia2_pb_w )
|
||||
{
|
||||
m_user->write_c((data>>0)&1);
|
||||
m_user->write_d((data>>1)&1);
|
||||
m_user->write_e((data>>2)&1);
|
||||
m_user->write_f((data>>3)&1);
|
||||
m_user->write_h((data>>4)&1);
|
||||
m_user->write_j((data>>5)&1);
|
||||
m_user->write_k((data>>6)&1);
|
||||
m_user->write_l((data>>7)&1);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// M6510_INTERFACE( cpu_intf )
|
||||
@ -1032,6 +1048,8 @@ void c64_state::machine_start()
|
||||
save_item(NAME(m_exp_irq));
|
||||
save_item(NAME(m_exp_nmi));
|
||||
save_item(NAME(m_exp_dma));
|
||||
save_item(NAME(m_user_pb));
|
||||
save_item(NAME(m_user_pa2));
|
||||
}
|
||||
|
||||
|
||||
@ -1079,26 +1097,42 @@ static MACHINE_CONFIG_START( ntsc, c64_state )
|
||||
// devices
|
||||
MCFG_PLS100_ADD(PLA_TAG)
|
||||
MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia1_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
|
||||
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
|
||||
MCFG_CBM_IEC_ADD("c1541")
|
||||
MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
|
||||
MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w))
|
||||
MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
|
||||
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
|
||||
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, c64_expansion_cards, NULL)
|
||||
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
|
||||
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
|
||||
MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
|
||||
MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
|
||||
MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0))
|
||||
MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1))
|
||||
MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2))
|
||||
MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3))
|
||||
MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4))
|
||||
MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5))
|
||||
MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6))
|
||||
MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7))
|
||||
MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2))
|
||||
|
||||
MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
|
||||
|
||||
// software list
|
||||
@ -1192,26 +1226,42 @@ static MACHINE_CONFIG_START( pal, c64_state )
|
||||
// devices
|
||||
MCFG_PLS100_ADD(PLA_TAG)
|
||||
MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
|
||||
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
|
||||
MCFG_CBM_IEC_ADD("c1541")
|
||||
MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
|
||||
MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w))
|
||||
MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
|
||||
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
|
||||
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL)
|
||||
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
|
||||
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
|
||||
MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
|
||||
MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
|
||||
MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0))
|
||||
MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1))
|
||||
MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2))
|
||||
MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3))
|
||||
MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4))
|
||||
MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5))
|
||||
MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6))
|
||||
MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7))
|
||||
MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2))
|
||||
|
||||
MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
|
||||
|
||||
// software list
|
||||
@ -1283,26 +1333,41 @@ static MACHINE_CONFIG_START( pal_gs, c64gs_state )
|
||||
// devices
|
||||
MCFG_PLS100_ADD(PLA_TAG)
|
||||
MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia1_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64gs_state, cia1_pa_r), NULL)
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64gs_state, cia1_pb_r), NULL, NULL)
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, WRITELINE(c64_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_4), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_5))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia1_pa_r), NULL)
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia1_pb_r), WRITE8(c64_state, cia1_pb_w), NULL)
|
||||
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, WRITELINE(c64_state, cia2_irq_w))
|
||||
MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_6), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_7))
|
||||
MCFG_MOS6526_PORT_A_CALLBACKS(READ8(c64_state, cia2_pa_r), WRITE8(c64_state, cia2_pa_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
|
||||
MCFG_MOS6526_PORT_B_CALLBACKS(READ8(c64_state, cia2_pb_r), WRITE8(c64_state, cia2_pb_w), DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_8))
|
||||
MCFG_CBM_IEC_ADD(NULL)
|
||||
MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
|
||||
MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_w))
|
||||
|
||||
MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(VIC20_USER_PORT_TAG, vic20_user_port_device, write_9))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
|
||||
MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
|
||||
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, c64_expansion_cards, NULL)
|
||||
MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
|
||||
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, c64_user_port_cards, NULL, WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_C64_USER_PORT_CIA1_CALLBACKS(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_C64_USER_PORT_CIA2_CALLBACKS(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w), DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
|
||||
MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, c64_user_port_cards, NULL)
|
||||
MCFG_VIC20_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
|
||||
MCFG_VIC20_USER_PORT_4_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_5_HANDLER(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_6_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, cnt_w))
|
||||
MCFG_VIC20_USER_PORT_7_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, sp_w))
|
||||
MCFG_VIC20_USER_PORT_9_HANDLER(DEVWRITELINE("c1541", cbm_iec_device, atn_w))
|
||||
MCFG_VIC20_USER_PORT_B_HANDLER(DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
|
||||
MCFG_VIC20_USER_PORT_C_HANDLER(WRITELINE(c64_state, write_user_pb0))
|
||||
MCFG_VIC20_USER_PORT_D_HANDLER(WRITELINE(c64_state, write_user_pb1))
|
||||
MCFG_VIC20_USER_PORT_E_HANDLER(WRITELINE(c64_state, write_user_pb2))
|
||||
MCFG_VIC20_USER_PORT_F_HANDLER(WRITELINE(c64_state, write_user_pb3))
|
||||
MCFG_VIC20_USER_PORT_H_HANDLER(WRITELINE(c64_state, write_user_pb4))
|
||||
MCFG_VIC20_USER_PORT_J_HANDLER(WRITELINE(c64_state, write_user_pb5))
|
||||
MCFG_VIC20_USER_PORT_K_HANDLER(WRITELINE(c64_state, write_user_pb6))
|
||||
MCFG_VIC20_USER_PORT_L_HANDLER(WRITELINE(c64_state, write_user_pb7))
|
||||
MCFG_VIC20_USER_PORT_M_HANDLER(WRITELINE(c64_state, write_user_pa2))
|
||||
|
||||
MCFG_QUICKLOAD_ADD("quickload", c64_state, cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS)
|
||||
|
||||
// software list
|
||||
|
@ -563,7 +563,7 @@ WRITE_LINE_MEMBER( vic20_state::via2_cb2_w )
|
||||
|
||||
WRITE_LINE_MEMBER( vic20_state::exp_reset_w )
|
||||
{
|
||||
if (state == ASSERT_LINE)
|
||||
if (!state)
|
||||
{
|
||||
machine_reset();
|
||||
}
|
||||
@ -672,7 +672,8 @@ static MACHINE_CONFIG_START( vic20, vic20_state )
|
||||
MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(M6502_TAG, m6502_device, irq_line))
|
||||
|
||||
MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", DEVWRITELINE(M6522_2_TAG, via6522_device, write_ca1))
|
||||
MCFG_CBM_IEC_ADD("c1541")
|
||||
MCFG_CBM_IEC_ADD(NULL)
|
||||
// MCFG_CBM_IEC_ADD("c1541") - breaks quick load
|
||||
MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(M6522_2_TAG, via6522_device, write_cb1))
|
||||
|
||||
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "emu.h"
|
||||
#include "bus/cbmiec/cbmiec.h"
|
||||
#include "bus/c64/exp.h"
|
||||
#include "bus/c64/user.h"
|
||||
#include "bus/vic20/user.h"
|
||||
#include "bus/pet/cass.h"
|
||||
#include "bus/vcs/ctrl.h"
|
||||
#include "imagedev/snapquik.h"
|
||||
@ -35,6 +35,7 @@
|
||||
#define SCREEN_VDC_TAG "screen80"
|
||||
#define CONTROL1_TAG "joy1"
|
||||
#define CONTROL2_TAG "joy2"
|
||||
#define VIC20_USER_PORT_TAG "user"
|
||||
|
||||
class c128_state : public driver_device
|
||||
{
|
||||
@ -54,7 +55,7 @@ public:
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG),
|
||||
m_exp(*this, C64_EXPANSION_SLOT_TAG),
|
||||
m_user(*this, C64_USER_PORT_TAG),
|
||||
m_user(*this, VIC20_USER_PORT_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
m_rom(*this, M8502_TAG),
|
||||
@ -112,7 +113,7 @@ public:
|
||||
required_device<vcs_control_port_device> m_joy1;
|
||||
required_device<vcs_control_port_device> m_joy2;
|
||||
required_device<c64_expansion_slot_device> m_exp;
|
||||
required_device<c64_user_port_device> m_user;
|
||||
required_device<vic20_user_port_device> m_user;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<pet_datassette_port_device> m_cassette;
|
||||
required_memory_region m_rom;
|
||||
@ -195,6 +196,20 @@ public:
|
||||
DECLARE_INPUT_CHANGED_MEMBER( caps_lock );
|
||||
|
||||
DECLARE_QUICKLOAD_LOAD_MEMBER( cbm_c64 );
|
||||
|
||||
DECLARE_READ8_MEMBER( cia2_pb_r );
|
||||
DECLARE_WRITE8_MEMBER( cia2_pb_w );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pa2 ) { m_user_pa2 = state; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb0 ) { if (state) m_user_pb |= 1; else m_user_pb &= ~1; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb1 ) { if (state) m_user_pb |= 2; else m_user_pb &= ~2; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb2 ) { if (state) m_user_pb |= 4; else m_user_pb &= ~4; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb3 ) { if (state) m_user_pb |= 8; else m_user_pb &= ~8; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb4 ) { if (state) m_user_pb |= 16; else m_user_pb &= ~16; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb5 ) { if (state) m_user_pb |= 32; else m_user_pb &= ~32; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb6 ) { if (state) m_user_pb |= 64; else m_user_pb &= ~64; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb7 ) { if (state) m_user_pb |= 128; else m_user_pb &= ~128; }
|
||||
|
||||
// memory state
|
||||
int m_z80en;
|
||||
int m_loram;
|
||||
@ -227,6 +242,9 @@ public:
|
||||
// keyboard state
|
||||
UINT8 m_vic_k;
|
||||
int m_caps_lock;
|
||||
|
||||
int m_user_pa2;
|
||||
int m_user_pb;
|
||||
};
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "emu.h"
|
||||
#include "bus/cbmiec/cbmiec.h"
|
||||
#include "bus/c64/exp.h"
|
||||
#include "bus/c64/user.h"
|
||||
#include "bus/vic20/user.h"
|
||||
#include "bus/pet/cass.h"
|
||||
#include "bus/vcs/ctrl.h"
|
||||
#include "cpu/m6502/m6510.h"
|
||||
@ -29,6 +29,7 @@
|
||||
#define SCREEN_TAG "screen"
|
||||
#define CONTROL1_TAG "joy1"
|
||||
#define CONTROL2_TAG "joy2"
|
||||
#define VIC20_USER_PORT_TAG "user"
|
||||
|
||||
class c64_state : public driver_device
|
||||
{
|
||||
@ -45,7 +46,7 @@ public:
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG),
|
||||
m_exp(*this, C64_EXPANSION_SLOT_TAG),
|
||||
m_user(*this, C64_USER_PORT_TAG),
|
||||
m_user(*this, VIC20_USER_PORT_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
m_basic(*this, "basic"),
|
||||
@ -84,7 +85,7 @@ public:
|
||||
required_device<vcs_control_port_device> m_joy1;
|
||||
required_device<vcs_control_port_device> m_joy2;
|
||||
required_device<c64_expansion_slot_device> m_exp;
|
||||
required_device<c64_user_port_device> m_user;
|
||||
required_device<vic20_user_port_device> m_user;
|
||||
required_device<ram_device> m_ram;
|
||||
optional_device<pet_datassette_port_device> m_cassette;
|
||||
optional_memory_region m_basic;
|
||||
@ -139,6 +140,19 @@ public:
|
||||
|
||||
DECLARE_QUICKLOAD_LOAD_MEMBER( cbm_c64 );
|
||||
|
||||
DECLARE_READ8_MEMBER( cia2_pb_r );
|
||||
DECLARE_WRITE8_MEMBER( cia2_pb_w );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pa2 ) { m_user_pa2 = state; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb0 ) { if (state) m_user_pb |= 1; else m_user_pb &= ~1; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb1 ) { if (state) m_user_pb |= 2; else m_user_pb &= ~2; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb2 ) { if (state) m_user_pb |= 4; else m_user_pb &= ~4; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb3 ) { if (state) m_user_pb |= 8; else m_user_pb &= ~8; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb4 ) { if (state) m_user_pb |= 16; else m_user_pb &= ~16; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb5 ) { if (state) m_user_pb |= 32; else m_user_pb &= ~32; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb6 ) { if (state) m_user_pb |= 64; else m_user_pb &= ~64; }
|
||||
DECLARE_WRITE_LINE_MEMBER( write_user_pb7 ) { if (state) m_user_pb |= 128; else m_user_pb &= ~128; }
|
||||
|
||||
// memory state
|
||||
int m_loram;
|
||||
int m_hiram;
|
||||
@ -155,6 +169,9 @@ public:
|
||||
int m_exp_irq;
|
||||
int m_exp_nmi;
|
||||
int m_exp_dma;
|
||||
|
||||
int m_user_pa2;
|
||||
int m_user_pb;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user