Previous 199869 Revisions Next

r20775 Wednesday 6th February, 2013 at 18:57:58 UTC by Curt Coder
(MESS) c64: Added CMD SwiftLink cartridge emulation. [Curt Coder]
[hash]c64_flop.xml
[src/emu/machine]mos6551.c
[src/mess]mess.mak
[src/mess/machine]c64_swiftlink.c* c64_swiftlink.h* cbmipt.c cbmipt.h

trunk/hash/c64_flop.xml
r20774r20775
825825      </part>
826826   </software>
827827
828   <software name="swiftlnk">
829      <description>CMD SwiftLink</description>
830      <year>1990</year>
831      <publisher>CMD</publisher>
832
833      <part name="flop1" interface="floppy_5_25">
834         <feature name="part_id" value="Disk 1 Side 1"/>
835         <dataarea name="flop" size="174848">
836            <rom name="cmd_swiftlink_utils_d1s1.d64" size="174848" crc="f70f4ff8" sha1="d70d6b0c8c2f408286ce0ea9edcfe6c5cf1af60a" offset="0" />
837         </dataarea>
838      </part>
839
840      <part name="flop2" interface="floppy_5_25">
841         <feature name="part_id" value="Disk 1 Side 2"/>
842         <dataarea name="flop" size="174848">
843            <rom name="cmd_swiftlink_utils_d1s2.d64" size="174848" crc="b9e18c85" sha1="b8b65c99ac1474b89729756adbdd969a3e9e9aa6" offset="0" />
844         </dataarea>
845      </part>
846
847      <part name="flop3" interface="floppy_5_25">
848         <feature name="part_id" value="Disk 2 Side 1"/>
849         <dataarea name="flop" size="174848">
850            <rom name="cmd_swiftlink_utils_d2s1.d64" size="174848" crc="de2828a1" sha1="6516d4674dddc58a9d7787bcb9ea55d4b4fc9898" offset="0" />
851         </dataarea>
852      </part>
853
854      <part name="flop4" interface="floppy_5_25">
855         <feature name="part_id" value="Disk 2 Side 2"/>
856         <dataarea name="flop" size="175531">
857            <rom name="cmd_swiftlink_utils_d2s2.d64" size="175531" crc="309d1b76" sha1="847b06a65238861c84dee715e48a635978647303" offset="0" />
858         </dataarea>
859      </part>
860
861      <part name="flop5" interface="floppy_5_25">
862         <feature name="part_id" value="Disk 3 Side 1"/>
863         <dataarea name="flop" size="174848">
864            <rom name="cmd_swiftlink_utils_d3s1.d64" size="174848" crc="180ff985" sha1="0b0f4c610cc5a062287ae20e41d9df78b9dc6007" offset="0" />
865         </dataarea>
866      </part>
867
868      <part name="flop6" interface="floppy_5_25">
869         <feature name="part_id" value="Disk 3 Side 2"/>
870         <dataarea name="flop" size="174848">
871            <rom name="cmd_swiftlink_utils_d3s2.d64" size="174848" crc="d2ec8d3c" sha1="02413c30f631986c17984f54dac48b9aec0904af" offset="0" />
872         </dataarea>
873      </part>
874   </software>
875
828876</softwarelist>
trunk/src/emu/machine/mos6551.c
r20774r20775
77
88**********************************************************************/
99
10/*
11
12   TODO:
13
14   - receiver disable
15   - IRQ on DCD/DSR change
16   - parity
17   - framing error
18
19*/
20
1021#include "mos6551.h"
1122
1223
r20774r20775
8596
8697void mos6551_device::tra_complete()
8798{
88   if ((m_cmd & CMD_TC_MASK) == CMD_TC_TIE_RTS_LO)
89   {
90      m_st |= ST_IRQ;
91      m_irq_handler(ASSERT_LINE);
92   }
93
9499   if (!(m_st & ST_TDRE))
95100   {
96101      transmit_register_setup(m_tdr);
97102      m_st |= ST_TDRE;
103   
104      if ((m_cmd & CMD_TC_MASK) == CMD_TC_TIE_RTS_LO)
105      {
106         m_st |= ST_IRQ;
107         m_irq_handler(ASSERT_LINE);
108      }
98109   }
99110}
100111
r20774r20775
109120   {
110121      m_st |= ST_OR;
111122   }
112   else
123     
124   m_st &= ~(ST_FE | ST_PE);
125
126   m_st |= ST_RDRF;
127
128   if (!(m_cmd & CMD_RIE))
113129   {
114      m_st |= ST_RDRF;
115
116      if (!(m_cmd & CMD_RIE))
117      {
118         m_st |= ST_IRQ;
119         m_irq_handler(ASSERT_LINE);
120      }
130      m_st |= ST_IRQ;
131      m_irq_handler(ASSERT_LINE);
121132   }
122133}
123134
r20774r20775
244255      {
245256         transmit_register_setup(m_tdr);
246257         m_st |= ST_TDRE;
258         
259         if ((m_cmd & CMD_TC_MASK) == CMD_TC_TIE_RTS_LO)
260         {
261            m_st |= ST_IRQ;
262            m_irq_handler(ASSERT_LINE);
263         }
247264      }
248265      break;
249266
r20774r20775
274291void mos6551_device::set_rxc(int clock)
275292{
276293   m_ext_rxc = clock;
294
295   update_serial();
277296}
trunk/src/mess/machine/cbmipt.c
r20774r20775
11281128   SLOT_INTERFACE("reu1764", C64_REU1764)
11291129   SLOT_INTERFACE("sfxse", C64_SFX_SOUND_EXPANDER)
11301130   SLOT_INTERFACE("supercpu", C64_SUPERCPU)
1131   SLOT_INTERFACE("swiftlink", C64_SWIFTLINK)
11311132
11321133   // the following need ROMs from the software list
11331134   SLOT_INTERFACE_INTERNAL("standard", C64_STD)
trunk/src/mess/machine/cbmipt.h
r20774r20775
5555#include "machine/c64_super_games.h"
5656#include "machine/c64_supercpu.h"
5757#include "machine/c64_sw8k.h"
58#include "machine/c64_swiftlink.h"
5859#include "machine/c64_system3.h"
5960#include "machine/c64_tdos.h"
6061#include "machine/c64_vw64.h"
trunk/src/mess/machine/c64_swiftlink.c
r0r20775
1/**********************************************************************
2
3    CMD SwiftLink RS-232 cartridge emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11
12   http://mclauchlan.site.net.au/scott/C=Hacking/C-Hacking10/C-Hacking10-swiftlink.html
13
14*/
15
16#include "c64_swiftlink.h"
17
18
19
20//**************************************************************************
21//  MACROS/CONSTANTS
22//**************************************************************************
23
24#define MOS6551_TAG       "mos6551"
25
26
27
28//**************************************************************************
29//  DEVICE DEFINITIONS
30//**************************************************************************
31
32const device_type C64_SWIFTLINK = &device_creator<c64_swiftlink_cartridge_device>;
33
34
35//-------------------------------------------------
36//  MACHINE_CONFIG_FRAGMENT( c64_swiftlink )
37//-------------------------------------------------
38
39static MACHINE_CONFIG_FRAGMENT( c64_swiftlink )
40   MCFG_MOS6551_ADD(MOS6551_TAG, XTAL_3_6864MHz, DEVWRITELINE(DEVICE_SELF, c64_swiftlink_cartridge_device, acia_irq_w))
41MACHINE_CONFIG_END
42
43
44//-------------------------------------------------
45//  machine_config_additions - device-specific
46//  machine configurations
47//-------------------------------------------------
48
49machine_config_constructor c64_swiftlink_cartridge_device::device_mconfig_additions() const
50{
51   return MACHINE_CONFIG_NAME( c64_swiftlink );
52}
53
54
55//-------------------------------------------------
56//  INPUT_PORTS( c64_swiftlink )
57//-------------------------------------------------
58
59static INPUT_PORTS_START( c64_swiftlink )
60   PORT_START("CS")
61   PORT_DIPNAME( 0x03, 0x01, "Base Address" )
62   PORT_DIPSETTING(    0x00, "$D700 (C128)" )
63   PORT_DIPSETTING(    0x01, "$DE00" )
64   PORT_DIPSETTING(    0x02, "$DF00" )
65
66   PORT_START("IRQ")
67   PORT_DIPNAME( 0x01, 0x01, "Interrupt" )
68   PORT_DIPSETTING(    0x00, "IRQ (C128)" )
69   PORT_DIPSETTING(    0x01, "NMI" )
70INPUT_PORTS_END
71
72
73//-------------------------------------------------
74//  input_ports - device-specific input ports
75//-------------------------------------------------
76
77ioport_constructor c64_swiftlink_cartridge_device::device_input_ports() const
78{
79   return INPUT_PORTS_NAME( c64_swiftlink );
80}
81
82
83
84//**************************************************************************
85//  LIVE DEVICE
86//**************************************************************************
87
88//-------------------------------------------------
89//  c64_swiftlink_cartridge_device - constructor
90//-------------------------------------------------
91
92c64_swiftlink_cartridge_device::c64_swiftlink_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
93   device_t(mconfig, C64_SWIFTLINK, "C64 SwiftLink cartridge", tag, owner, clock),
94   device_c64_expansion_card_interface(mconfig, *this),
95   m_acia(*this, MOS6551_TAG),
96   m_io_cs(*this, "CS"),
97   m_io_irq(*this, "IRQ")
98{
99}
100
101
102//-------------------------------------------------
103//  device_start - device-specific startup
104//-------------------------------------------------
105
106void c64_swiftlink_cartridge_device::device_start()
107{
108}
109
110
111//-------------------------------------------------
112//  device_reset - device-specific reset
113//-------------------------------------------------
114
115void c64_swiftlink_cartridge_device::device_reset()
116{
117   m_acia->reset();
118
119   m_cs = m_io_cs->read();
120   m_irq = m_io_irq->read();
121}
122
123
124//-------------------------------------------------
125//  c64_cd_r - cartridge data read
126//-------------------------------------------------
127
128UINT8 c64_swiftlink_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
129{
130   if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) ||
131      ((m_cs == D700) && ((offset & 0xff00) == 0xd700)))
132   {
133      data = m_acia->read(space, offset & 0x03);
134   }
135
136   return data;
137}
138
139
140//-------------------------------------------------
141//  c64_cd_w - cartridge data write
142//-------------------------------------------------
143
144void c64_swiftlink_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
145{
146   if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) ||
147      ((m_cs == D700) && ((offset & 0xff00) == 0xd700)))
148   {
149      m_acia->write(space, offset & 0x03, data);
150   }
151}
152
153
154//-------------------------------------------------
155//  acia_irq_w -
156//-------------------------------------------------
157
158WRITE_LINE_MEMBER( c64_swiftlink_cartridge_device::acia_irq_w )
159{
160   switch (m_irq)
161   {
162   case IRQ: m_slot->irq_w(state); break;
163   case NMI: m_slot->nmi_w(state); break;
164   }
165}
Property changes on: trunk/src/mess/machine/c64_swiftlink.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/c64_swiftlink.h
r0r20775
1/**********************************************************************
2
3    CMD SwiftLink RS-232 cartridge 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 __SWIFTLINK__
13#define __SWIFTLINK__
14
15
16#include "emu.h"
17#include "machine/c64exp.h"
18#include "machine/mos6551.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> c64_swiftlink_cartridge_device
27
28class c64_swiftlink_cartridge_device : public device_t,
29                           public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_swiftlink_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual machine_config_constructor device_mconfig_additions() const;
37   virtual ioport_constructor device_input_ports() const;
38
39   DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
40
41protected:
42   // device-level overrides
43   virtual void device_config_complete() { m_shortname = "c64_swiftlink"; }
44   virtual void device_start();
45   virtual void device_reset();
46
47   // device_c64_expansion_card_interface overrides
48   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
49   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
50
51private:
52   required_device<mos6551_device> m_acia;
53   required_ioport m_io_cs;
54   required_ioport m_io_irq;
55
56   enum
57   {
58      D700 = 0,
59      DE00,
60      DF00
61   };
62
63   enum
64   {
65      IRQ = 0,
66      NMI
67   };
68
69   int m_cs;
70   int m_irq;
71};
72
73
74// device type definition
75extern const device_type C64_SWIFTLINK;
76
77
78#endif
Property changes on: trunk/src/mess/machine/c64_swiftlink.h
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/mess.mak
r20774r20775
886886   $(MESS_MACHINE)/c64_super_games.o   \
887887   $(MESS_MACHINE)/c64_supercpu.o  \
888888   $(MESS_MACHINE)/c64_sw8k.o  \
889   $(MESS_MACHINE)/c64_swiftlink.o   \
889890   $(MESS_MACHINE)/c64_system3.o   \
890891   $(MESS_MACHINE)/c64_tdos.o  \
891892   $(MESS_MACHINE)/c64_vw64.o  \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team