Previous 15994 Revisions Next

r14771 Monday 19th March, 2012 at 18:51:29 UTC by Curt Coder
[C64] Added support for the Digital Excess/Hitmen, Kingsoft, and Starbyte 4 player joystick interfaces. [Curt Coder]
[C64] Added preliminary support for the Final Cartridge III. [Curt Coder]
[src/mess]mess.mak
[src/mess/machine]c64_4cga.c c64_4cga.h c64_4dxh.c* c64_4dxh.h* c64_4ksa.c* c64_4ksa.h* c64_4tba.c* c64_4tba.h* c64_final3.c* c64_final3.h* c64_magic_formel.c c64_magic_formel.h c64_stardos.c c64_stardos.h c64_warp_speed.c c64_warp_speed.h cbmipt.c cbmipt.h

src/mess/machine/c64_4ksa.c
r0r14771
1/**********************************************************************
2
3    Kingsoft 4-Player Adapter emulation
4
5    http://hitmen.c02.at/html/hardware.html
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#include "c64_4ksa.h"
13
14
15
16//**************************************************************************
17//  DEVICE DEFINITIONS
18//**************************************************************************
19
20const device_type C64_4KSA = &device_creator<c64_4ksa_device>;
21
22
23INPUT_CHANGED_MEMBER( c64_4ksa_device::fire4 )
24{
25   m_slot->sp2_w(newval);
26}
27
28static INPUT_PORTS_START( c64_4player )
29   PORT_START("SP2")
30   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4ksa_device, fire4, 0)
31
32   PORT_START("PB")
33   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
34   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
35   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
36   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
37   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
38   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
39   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
40   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
41
42   PORT_START("PA2")
43   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
44INPUT_PORTS_END
45
46
47//-------------------------------------------------
48//  input_ports - device-specific input ports
49//-------------------------------------------------
50
51ioport_constructor c64_4ksa_device::device_input_ports() const
52{
53   return INPUT_PORTS_NAME( c64_4player );
54}
55
56
57
58//**************************************************************************
59//  LIVE DEVICE
60//**************************************************************************
61
62//-------------------------------------------------
63//  c64_4ksa_device - constructor
64//-------------------------------------------------
65
66c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
67   device_t(mconfig, C64_4KSA, "C64 Kingsoft 4-Player Adapter", tag, owner, clock),
68   device_c64_user_port_interface(mconfig, *this)
69{
70}
71
72
73//-------------------------------------------------
74//  device_start - device-specific startup
75//-------------------------------------------------
76
77void c64_4ksa_device::device_start()
78{
79}
80
81
82//-------------------------------------------------
83//  c64_pb_r - port B read
84//-------------------------------------------------
85
86UINT8 c64_4ksa_device::c64_pb_r(address_space &space, offs_t offset)
87{
88   return input_port_read(*this, "PB");
89}
90
91
92//-------------------------------------------------
93//  c64_pb_w - port B write
94//-------------------------------------------------
95
96int c64_4ksa_device::c64_pa2_r()
97{
98   return BIT(input_port_read(*this, "PA2"), 0);
99}
100
101
102//-------------------------------------------------
103//  c64_cnt1_w - CNT 1 write
104//-------------------------------------------------
105
106void c64_4ksa_device::c64_cnt1_w(int level)
107{
108   m_slot->cnt2_w(level);
109}
src/mess/machine/c64_4ksa.h
r0r14771
1/**********************************************************************
2
3    Kingsoft 4-Player Adapter 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_4KSA__
13#define __C64_4KSA__
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_4ksa_device
27
28class c64_4ksa_device : public device_t,
29                  public device_c64_user_port_interface
30{
31public:
32   // construction/destruction
33   c64_4ksa_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
38   INPUT_CHANGED_MEMBER( fire4 );
39
40protected:
41   // device-level overrides
42   virtual void device_start();
43   virtual void device_config_complete() { m_shortname = "c64_4ksa"; }
44
45   // device_c64_user_port_interface overrides
46   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
47   virtual int c64_pa2_r();
48   virtual void c64_cnt1_w(int level);
49};
50
51
52// device type definition
53extern const device_type C64_4KSA;
54
55
56#endif
src/mess/machine/cbmipt.c
r14770r14771
11601160   SLOT_INTERFACE("epyxfastload", C64_EPYX_FAST_LOAD)
11611161   SLOT_INTERFACE("exos", C64_EXOS)
11621162   SLOT_INTERFACE("final", C64_FINAL)
1163   SLOT_INTERFACE("final3", C64_FINAL3)
11631164   SLOT_INTERFACE("fun_play", C64_FUN_PLAY)
11641165   SLOT_INTERFACE("kingsoft", C64_KINGSOFT)
11651166   SLOT_INTERFACE("mach5", C64_MACH5)
r14770r14771
11881189
11891190SLOT_INTERFACE_START( c64_user_port_cards )
11901191   SLOT_INTERFACE("4cga", C64_4CGA)
1192   SLOT_INTERFACE("4dxh", C64_4DXH)
1193   SLOT_INTERFACE("4ksa", C64_4KSA)
1194   SLOT_INTERFACE("4tba", C64_4TBA)
11911195SLOT_INTERFACE_END
src/mess/machine/cbmipt.h
r14770r14771
44#define CBMIPT_H_
55
66#include "machine/c64_4cga.h"
7#include "machine/c64_4dxh.h"
8#include "machine/c64_4ksa.h"
9#include "machine/c64_4tba.h"
710#include "machine/c64_comal80.h"
811#include "machine/c64_dela_ep256.h"
912#include "machine/c64_dela_ep64.h"
r14770r14771
1518#include "machine/c64_epyx_fast_load.h"
1619#include "machine/c64_exos.h"
1720#include "machine/c64_final.h"
21#include "machine/c64_final3.h"
1822#include "machine/c64_fun_play.h"
1923#include "machine/c64_georam.h"
2024#include "machine/c64_ieee488.h"
src/mess/machine/c64_4dxh.c
r0r14771
1/**********************************************************************
2
3   The Digital Excess & Hitmen 4-Player Joystick adapter emulation
4
5    http://hitmen.c02.at/html/hardware.html
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#include "c64_4dxh.h"
13
14
15
16//**************************************************************************
17//  DEVICE DEFINITIONS
18//**************************************************************************
19
20const device_type C64_4DXH = &device_creator<c64_4dxh_device>;
21
22
23INPUT_CHANGED_MEMBER( c64_4dxh_device::fire4 )
24{
25   m_slot->sp2_w(newval);
26}
27
28static INPUT_PORTS_START( c64_4player )
29   PORT_START("SP2")
30   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4dxh_device, fire4, 0)
31
32   PORT_START("PB")
33   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
34   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
35   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
36   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
37   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
38   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
39   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
40   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
41
42   PORT_START("PA2")
43   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
44INPUT_PORTS_END
45
46
47//-------------------------------------------------
48//  input_ports - device-specific input ports
49//-------------------------------------------------
50
51ioport_constructor c64_4dxh_device::device_input_ports() const
52{
53   return INPUT_PORTS_NAME( c64_4player );
54}
55
56
57
58//**************************************************************************
59//  LIVE DEVICE
60//**************************************************************************
61
62//-------------------------------------------------
63//  c64_4dxh_device - constructor
64//-------------------------------------------------
65
66c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
67   device_t(mconfig, C64_4DXH, "C64 DXH 4-Player Adapter", tag, owner, clock),
68   device_c64_user_port_interface(mconfig, *this)
69{
70}
71
72
73//-------------------------------------------------
74//  device_start - device-specific startup
75//-------------------------------------------------
76
77void c64_4dxh_device::device_start()
78{
79}
80
81
82//-------------------------------------------------
83//  c64_pb_r - port B read
84//-------------------------------------------------
85
86UINT8 c64_4dxh_device::c64_pb_r(address_space &space, offs_t offset)
87{
88   return input_port_read(*this, "PB");
89}
90
91
92//-------------------------------------------------
93//  c64_pb_w - port B write
94//-------------------------------------------------
95
96int c64_4dxh_device::c64_pa2_r()
97{
98   return BIT(input_port_read(*this, "PA2"), 0);
99}
100
101
102//-------------------------------------------------
103//  c64_cnt1_w - CNT 1 write
104//-------------------------------------------------
105
106void c64_4dxh_device::c64_cnt1_w(int level)
107{
108   m_slot->cnt2_w(level);
109}
src/mess/machine/c64_4dxh.h
r0r14771
1/**********************************************************************
2
3    The Digital Excess & Hitmen 4-Player Joystick adapter 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_4DXH__
13#define __C64_4DXH__
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_4dxh_device
27
28class c64_4dxh_device : public device_t,
29                  public device_c64_user_port_interface
30{
31public:
32   // construction/destruction
33   c64_4dxh_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
38   INPUT_CHANGED_MEMBER( fire4 );
39
40protected:
41   // device-level overrides
42   virtual void device_start();
43   virtual void device_config_complete() { m_shortname = "c64_4dxh"; }
44
45   // device_c64_user_port_interface overrides
46   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
47   virtual int c64_pa2_r();
48   virtual void c64_cnt1_w(int level);
49};
50
51
52// device type definition
53extern const device_type C64_4DXH;
54
55
56#endif
src/mess/machine/c64_warp_speed.c
r14770r14771
5656//  INPUT_PORTS( c64_warp_speed )
5757//-------------------------------------------------
5858 
59INPUT_CHANGED( c64_warp_speed_cartridge_device::reset )
59INPUT_CHANGED_MEMBER( c64_warp_speed_cartridge_device::reset )
6060{
6161   // TODO
6262}
r14770r14771
6868   PORT_DIPSETTING(    0x00, "C128" )
6969 
7070   PORT_START("SW2")
71   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED(c64_warp_speed_cartridge_device::reset, 0)
71   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, c64_warp_speed_cartridge_device, reset, 0)
7272INPUT_PORTS_END
7373 
7474 
src/mess/machine/c64_warp_speed.h
r14770r14771
3535   // optional information overrides
3636   virtual ioport_constructor device_input_ports() const;
3737 
38   static INPUT_CHANGED( reset );
38   INPUT_CHANGED_MEMBER( reset );
3939 
4040protected:
4141   // device-level overrides
src/mess/machine/c64_final3.c
r0r14771
1/**********************************************************************
2
3    Final Cartridge III emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "c64_final3.h"
11
12
13
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17
18const device_type C64_FINAL3 = &device_creator<c64_final3_cartridge_device>;
19
20
21INPUT_CHANGED_MEMBER( c64_final3_cartridge_device::freeze )
22{
23   if (!newval)
24   {
25      m_game = 0;
26   }
27
28   m_slot->nmi_w(newval ? CLEAR_LINE : ASSERT_LINE);
29}
30
31static INPUT_PORTS_START( c64_final3 )
32   PORT_START("FREEZE")
33   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_final3_cartridge_device, freeze, 0)
34INPUT_PORTS_END
35
36
37//-------------------------------------------------
38//  input_ports - device-specific input ports
39//-------------------------------------------------
40
41ioport_constructor c64_final3_cartridge_device::device_input_ports() const
42{
43   return INPUT_PORTS_NAME( c64_final3 );
44}
45
46
47
48//**************************************************************************
49//  LIVE DEVICE
50//**************************************************************************
51
52//-------------------------------------------------
53//  c64_final3_cartridge_device - constructor
54//-------------------------------------------------
55
56c64_final3_cartridge_device::c64_final3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
57   device_t(mconfig, C64_FINAL3, "C64 Final Cartridge III", tag, owner, clock),
58   device_c64_expansion_card_interface(mconfig, *this)
59{
60}
61
62
63//-------------------------------------------------
64//  device_start - device-specific startup
65//-------------------------------------------------
66
67void c64_final3_cartridge_device::device_start()
68{
69   // state saving
70   save_item(NAME(m_bank));
71   save_item(NAME(m_hidden));
72}
73
74
75//-------------------------------------------------
76//  device_reset - device-specific reset
77//-------------------------------------------------
78
79void c64_final3_cartridge_device::device_reset()
80{
81   m_bank = 0;
82
83   m_exrom = 0;
84   m_game = 0;
85
86   m_slot->nmi_w(CLEAR_LINE);
87
88   m_hidden = 0;
89}
90
91
92//-------------------------------------------------
93//  c64_cd_r - cartridge data read
94//-------------------------------------------------
95
96UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
97{
98   UINT8 data = 0;
99
100   if (!roml || !romh || !io1 || !io2)
101   {
102      offs_t addr = (m_bank << 14) | (offset & 0x3fff);
103      data = m_roml[addr];
104   }
105
106   return data;
107}
108
109
110//-------------------------------------------------
111//  c64_cd_w - cartridge data write
112//-------------------------------------------------
113
114void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
115{
116   if (!m_hidden && !io2 && ((offset & 0xff) == 0xff))
117   {
118      /*
119     
120          bit     description
121     
122          0       A14
123          1       A15
124          2       
125          3       
126          4       EXROM
127          5       GAME
128          6       NMI
129          7       hide register
130     
131      */
132   
133      m_bank = data & 0x03;
134     
135      m_exrom = BIT(data, 4);
136      m_game = BIT(data, 5);
137
138      m_slot->nmi_w(BIT(data, 6) ? CLEAR_LINE : ASSERT_LINE);
139     
140      m_hidden = BIT(data, 7);
141   }
142}
src/mess/machine/c64_final3.h
r0r14771
1/**********************************************************************
2
3    Final Cartridge III 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 __FINAL3__
13#define __FINAL3__
14
15#define ADDRESS_MAP_MODERN
16
17#include "emu.h"
18#include "machine/c64exp.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> c64_final3_cartridge_device
27
28class c64_final3_cartridge_device : public device_t,
29                              public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_final3_cartridge_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
38   INPUT_CHANGED_MEMBER( freeze );
39
40protected:
41   // device-level overrides
42   virtual void device_start();
43   virtual void device_reset();
44   virtual void device_config_complete() { m_shortname = "c64_final3"; }
45
46   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
48   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
49
50private:
51   UINT8 m_bank;
52   int m_hidden;
53};
54
55
56// device type definition
57extern const device_type C64_FINAL3;
58
59
60#endif
src/mess/machine/c64_stardos.c
r14770r14771
3131//  INPUT_PORTS( c64_stardos )
3232//-------------------------------------------------
3333 
34INPUT_CHANGED( c64_stardos_cartridge_device::reset )
34INPUT_CHANGED_MEMBER( c64_stardos_cartridge_device::reset )
3535{
3636   // TODO
3737}
3838 
3939static INPUT_PORTS_START( c64_stardos )
4040   PORT_START("RESET")
41   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED(c64_stardos_cartridge_device::reset, 0)
41   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, c64_stardos_cartridge_device, reset, 0)
4242INPUT_PORTS_END
4343 
4444 
src/mess/machine/c64_stardos.h
r14770r14771
3636   // optional information overrides
3737   virtual ioport_constructor device_input_ports() const;
3838 
39   static INPUT_CHANGED( reset );
39   INPUT_CHANGED_MEMBER( reset );
4040 
4141protected:
4242   // device-level overrides
src/mess/machine/c64_4tba.c
r0r14771
1/**********************************************************************
2
3    Starbyte Software Tie Break Adaptor emulation
4
5    http://hitmen.c02.at/html/hardware.html
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#include "c64_4tba.h"
13
14
15
16//**************************************************************************
17//  DEVICE DEFINITIONS
18//**************************************************************************
19
20const device_type C64_4TBA = &device_creator<c64_4tba_device>;
21
22
23INPUT_CHANGED_MEMBER( c64_4tba_device::fire3 )
24{
25   m_slot->sp2_w(newval);
26}
27
28static INPUT_PORTS_START( c64_4player )
29   PORT_START("SP2")
30   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, c64_4tba_device, fire3, 0)
31
32   PORT_START("PB")
33   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
34   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
35   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
36   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
37   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
38   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
39   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
40   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
41
42   PORT_START("PA2")
43   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
44INPUT_PORTS_END
45
46
47//-------------------------------------------------
48//  input_ports - device-specific input ports
49//-------------------------------------------------
50
51ioport_constructor c64_4tba_device::device_input_ports() const
52{
53   return INPUT_PORTS_NAME( c64_4player );
54}
55
56
57
58//**************************************************************************
59//  LIVE DEVICE
60//**************************************************************************
61
62//-------------------------------------------------
63//  c64_4tba_device - constructor
64//-------------------------------------------------
65
66c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
67   device_t(mconfig, C64_4TBA, "C64 Tie Break Adapter", tag, owner, clock),
68   device_c64_user_port_interface(mconfig, *this)
69{
70}
71
72
73//-------------------------------------------------
74//  device_start - device-specific startup
75//-------------------------------------------------
76
77void c64_4tba_device::device_start()
78{
79}
80
81
82//-------------------------------------------------
83//  c64_pb_r - port B read
84//-------------------------------------------------
85
86UINT8 c64_4tba_device::c64_pb_r(address_space &space, offs_t offset)
87{
88   return input_port_read(*this, "PB");
89}
90
91
92//-------------------------------------------------
93//  c64_pb_w - port B write
94//-------------------------------------------------
95
96int c64_4tba_device::c64_pa2_r()
97{
98   return BIT(input_port_read(*this, "PA2"), 0);
99}
100
101
102//-------------------------------------------------
103//  c64_cnt1_w - CNT 1 write
104//-------------------------------------------------
105
106void c64_4tba_device::c64_cnt1_w(int level)
107{
108   m_slot->cnt2_w(level);
109}
src/mess/machine/c64_4tba.h
r0r14771
1/**********************************************************************
2
3    Starbyte Software Tie Break Adaptor 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_4TBA__
13#define __C64_4TBA__
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_4tba_device
27
28class c64_4tba_device : public device_t,
29                  public device_c64_user_port_interface
30{
31public:
32   // construction/destruction
33   c64_4tba_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
38   INPUT_CHANGED_MEMBER( fire3 );
39
40protected:
41   // device-level overrides
42   virtual void device_start();
43   virtual void device_config_complete() { m_shortname = "c64_4tba"; }
44
45   // device_c64_user_port_interface overrides
46   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
47   virtual int c64_pa2_r();
48   virtual void c64_cnt1_w(int level);
49};
50
51
52// device type definition
53extern const device_type C64_4TBA;
54
55
56#endif
src/mess/machine/c64_magic_formel.c
r14770r14771
132132//  INPUT_PORTS( c64_magic_formel )
133133//-------------------------------------------------
134134 
135INPUT_CHANGED( c64_magic_formel_cartridge_device::freeze )
135INPUT_CHANGED_MEMBER( c64_magic_formel_cartridge_device::freeze )
136136{
137   /*
138137    if (!newval && (m_pb7_ff & m_cb2_ff))
139138    {
140139        m_cb2_ff = 0;
r14770r14771
145144    {
146145        m_slot->nmi_w(CLEAR_LINE);
147146    }
148    */
149147}
150148 
151149static INPUT_PORTS_START( c64_magic_formel )
152150   PORT_START("FREEZE")
153   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Freeze") PORT_CHANGED(c64_magic_formel_cartridge_device::freeze, 0)
151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Freeze") PORT_CHANGED_MEMBER(DEVICE_SELF, c64_magic_formel_cartridge_device, freeze, 0)
154152INPUT_PORTS_END
155153 
156154 
src/mess/machine/c64_magic_formel.h
r14770r14771
3737   virtual machine_config_constructor device_mconfig_additions() const;
3838   virtual ioport_constructor device_input_ports() const;
3939 
40   static INPUT_CHANGED( freeze );
40   DECLARE_INPUT_CHANGED_MEMBER( freeze );
4141 
4242   // not really public
4343   DECLARE_WRITE8_MEMBER( pia_pa_w );
src/mess/machine/c64_4cga.c
r14770r14771
3838 
3939   PORT_START("FIRE")
4040   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
41   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
41   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
4242   PORT_BIT( 0xcf, IP_ACTIVE_LOW, IPT_UNUSED )
4343INPUT_PORTS_END
4444 
src/mess/machine/c64_4cga.h
r14770r14771
3838protected:
3939   // device-level overrides
4040   virtual void device_start();
41   virtual void device_config_complete() { m_shortname = "c64_4player"; }
41   virtual void device_config_complete() { m_shortname = "c64_4cga"; }
4242 
4343   // device_c64_user_port_interface overrides
4444   virtual UINT8 c64_pb_r(address_space &space, offs_t offset);
src/mess/mess.mak
r14770r14771
772772   $(MESS_MACHINE)/c64exp.o   \
773773   $(MESS_MACHINE)/c64user.o   \
774774   $(MESS_MACHINE)/c64_4cga.o   \
775   $(MESS_MACHINE)/c64_4dxh.o   \
776   $(MESS_MACHINE)/c64_4ksa.o   \
777   $(MESS_MACHINE)/c64_4tba.o   \
775778   $(MESS_MACHINE)/c64_comal80.o   \
776779   $(MESS_MACHINE)/c64_dela_ep256.o   \
777780   $(MESS_MACHINE)/c64_dela_ep64.o   \
r14770r14771
783786   $(MESS_MACHINE)/c64_epyx_fast_load.o   \
784787   $(MESS_MACHINE)/c64_exos.o   \
785788   $(MESS_MACHINE)/c64_final.o   \
789   $(MESS_MACHINE)/c64_final3.o   \
786790   $(MESS_MACHINE)/c64_fun_play.o   \
787791   $(MESS_MACHINE)/c64_georam.o   \
788792   $(MESS_MACHINE)/c64_ieee488.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team