Previous 15994 Revisions Next

r14768 Sunday 18th March, 2012 at 18:31:51 UTC by Curt Coder
[C64] Added support for the Classical Games/Protovision 4 player joystick interface. [Curt Coder]
[hash]c64_cart.xml
[src/mess]mess.mak
[src/mess/machine]c64_4cga.c* c64_4cga.h* cbmipt.c cbmipt.h

hash/c64_cart.xml
r14767r14768
44
55   Missing dumps that exist as .crt but are missing from this list:
66
7   - Ariolasoft Structured BASIC
78   - Prophet-64
89   - MSSIAH
910   - Rex Diashow-Maker
11   - Pagefox (English/German)
1012
1113   If you have any of these, please forward them to messdev :)
1214
src/mess/machine/cbmipt.c
r14767r14768
11871187SLOT_INTERFACE_END
11881188
11891189SLOT_INTERFACE_START( c64_user_port_cards )
1190   SLOT_INTERFACE("4cga", C64_4CGA)
11901191SLOT_INTERFACE_END
src/mess/machine/cbmipt.h
r14767r14768
33#ifndef CBMIPT_H_
44#define CBMIPT_H_
55
6#include "machine/c64_4cga.h"
67#include "machine/c64_comal80.h"
78#include "machine/c64_dela_ep256.h"
89#include "machine/c64_dela_ep64.h"
src/mess/machine/c64_4cga.c
r0r14768
1/**********************************************************************
2 
3    Classical Games/Protovision 4 Player Interface emulation
4 
5    http://www.protovision-online.com/hardw/4_player.htm
6    http://hitmen.c02.at/html/hardware.html
7 
8    Copyright MESS Team.
9    Visit http://mamedev.org for licensing and usage restrictions.
10 
11**********************************************************************/
12 
13#include "c64_4cga.h"
14 
15 
16 
17//**************************************************************************
18//  DEVICE DEFINITIONS
19//**************************************************************************
20 
21const device_type C64_4CGA = &device_creator<c64_4cga_device>;
22 
23 
24static INPUT_PORTS_START( c64_4player )
25   PORT_START("JOY3")
26   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
27   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
28   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
29   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
30   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
31 
32   PORT_START("JOY4")
33   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
34   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
35   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
36   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
37   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
38 
39   PORT_START("FIRE")
40   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
41   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
42   PORT_BIT( 0xcf, IP_ACTIVE_LOW, IPT_UNUSED )
43INPUT_PORTS_END
44 
45 
46//-------------------------------------------------
47//  input_ports - device-specific input ports
48//-------------------------------------------------
49 
50ioport_constructor c64_4cga_device::device_input_ports() const
51{
52   return INPUT_PORTS_NAME( c64_4player );
53}
54 
55 
56 
57//**************************************************************************
58//  LIVE DEVICE
59//**************************************************************************
60 
61//-------------------------------------------------
62//  c64_4cga_device - constructor
63//-------------------------------------------------
64 
65c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
66   device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock),
67   device_c64_user_port_interface(mconfig, *this),
68   m_port(0)
69{
70}
71 
72 
73//-------------------------------------------------
74//  device_start - device-specific startup
75//-------------------------------------------------
76 
77void c64_4cga_device::device_start()
78{
79   // state saving
80   save_item(NAME(m_port));
81}
82 
83 
84//-------------------------------------------------
85//  c64_pb_r - port B read
86//-------------------------------------------------
87 
88UINT8 c64_4cga_device::c64_pb_r(address_space &space, offs_t offset)
89{
90   UINT8 data = input_port_read(*this, "FIRE");
91 
92   if (m_port)
93   {
94      data &= input_port_read(*this, "JOY3");
95   }
96   else
97   {
98      data &= input_port_read(*this, "JOY4");
99   }
100 
101   return data;
102}
103 
104 
105//-------------------------------------------------
106//  c64_pb_w - port B write
107//-------------------------------------------------
108 
109void c64_4cga_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data)
110{
111   m_port = BIT(data, 7);
112}
src/mess/machine/c64_4cga.h
r0r14768
1/**********************************************************************
2 
3    Classical Games/Protovision 4 Player Interface emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __C64_4CGA__
13#define __C64_4CGA__
14 
15#define ADDRESS_MAP_MODERN
16 
17#include "emu.h"
18#include "machine/c64user.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> c64_4cga_device
27 
28class c64_4cga_device : public device_t,
29                  public device_c64_user_port_interface
30{
31public:
32   // construction/destruction
33   c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35   // optional information overrides
36   virtual ioport_constructor device_input_ports() const;
37 
38protected:
39   // device-level overrides
40   virtual void device_start();
41   virtual void device_config_complete() { m_shortname = "c64_4player"; }
42 
43   // device_c64_user_port_interface overrides
44   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
45   virtual void c64_pb_w(address_space &space, offs_t offset, UINT8 data);
46 
47private:
48   int m_port;
49};
50 
51 
52// device type definition
53extern const device_type C64_4CGA;
54 
55 
56#endif
src/mess/mess.mak
r14767r14768
771771   $(MESS_DRIVERS)/c64dtv.o   \
772772   $(MESS_MACHINE)/c64exp.o   \
773773   $(MESS_MACHINE)/c64user.o   \
774   $(MESS_MACHINE)/c64_4cga.o   \
774775   $(MESS_MACHINE)/c64_comal80.o   \
775776   $(MESS_MACHINE)/c64_dela_ep256.o   \
776777   $(MESS_MACHINE)/c64_dela_ep64.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team