Previous 15994 Revisions Next

r14892 Wednesday 11th April, 2012 at 03:26:16 UTC by R. Belmont
Apple II: Thunderclock Plus card added [R. Belmont]
[src/mess]mess.mak
[src/mess/drivers]apple2.c
[src/mess/machine]a2thunderclock.c* a2thunderclock.h*

src/mess/machine/a2thunderclock.c
r0r14892
1/*********************************************************************
2
3    a2thunderclock.c
4 
5    Implemention of the Thunderware Thunderclock Plus.
6
7*********************************************************************/
8
9#include "a2thunderclock.h"
10
11/***************************************************************************
12    PARAMETERS
13***************************************************************************/
14
15//**************************************************************************
16//  GLOBAL VARIABLES
17//**************************************************************************
18
19const device_type A2BUS_THUNDERCLOCK = &device_creator<a2bus_thunderclock_device>;
20
21#define THUNDERCLOCK_ROM_REGION  "thunclk_rom"
22#define THUNDERCLOCK_UPD1990_TAG    "thunclk_upd"
23
24static UPD1990A_INTERFACE( thunderclock_upd1990a_intf )
25{
26   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_thunderclock_device, upd_dataout_w),
27   DEVCB_NULL  // TP out not used? for Thunderclock
28};
29
30MACHINE_CONFIG_FRAGMENT( thunderclock )
31    MCFG_UPD1990A_ADD(THUNDERCLOCK_UPD1990_TAG, 1021800, thunderclock_upd1990a_intf)
32MACHINE_CONFIG_END
33
34ROM_START( thunderclock )
35   ROM_REGION(0x800, THUNDERCLOCK_ROM_REGION, 0)
36    ROM_LOAD( "thunderclock plus rom.bin", 0x0000, 0x0800, CRC(1b99c4e3) SHA1(60f434f5325899d7ea257a6e56e6f53eae65146a) )
37ROM_END
38
39/***************************************************************************
40    FUNCTION PROTOTYPES
41***************************************************************************/
42
43//-------------------------------------------------
44//  machine_config_additions - device-specific
45//  machine configurations
46//-------------------------------------------------
47
48machine_config_constructor a2bus_thunderclock_device::device_mconfig_additions() const
49{
50   return MACHINE_CONFIG_NAME( thunderclock );
51}
52
53//-------------------------------------------------
54//  rom_region - device-specific ROM region
55//-------------------------------------------------
56
57const rom_entry *a2bus_thunderclock_device::device_rom_region() const
58{
59   return ROM_NAME( thunderclock );
60}
61
62//**************************************************************************
63//  LIVE DEVICE
64//**************************************************************************
65
66a2bus_thunderclock_device::a2bus_thunderclock_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
67    device_t(mconfig, type, name, tag, owner, clock),
68    device_a2bus_card_interface(mconfig, *this),
69    m_upd1990ac(*this, THUNDERCLOCK_UPD1990_TAG)
70{
71   m_shortname = "a2thunpl";
72}
73
74a2bus_thunderclock_device::a2bus_thunderclock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
75    device_t(mconfig, A2BUS_THUNDERCLOCK, "ThunderWare ThunderClock Plus", tag, owner, clock),
76    device_a2bus_card_interface(mconfig, *this),
77    m_upd1990ac(*this, THUNDERCLOCK_UPD1990_TAG)
78{
79   m_shortname = "a2thunpl";
80}
81
82//-------------------------------------------------
83//  device_start - device-specific startup
84//-------------------------------------------------
85
86void a2bus_thunderclock_device::device_start()
87{
88   // set_a2bus_device makes m_slot valid
89   set_a2bus_device();
90
91   astring tempstring;
92   m_rom = device().machine().region(this->subtag(tempstring, THUNDERCLOCK_ROM_REGION))->base();
93}
94
95void a2bus_thunderclock_device::device_reset()
96{
97    m_dataout = 0;
98}
99
100
101/*-------------------------------------------------
102    read_c0nx - called for reads from this card's c0nx space
103-------------------------------------------------*/
104
105UINT8 a2bus_thunderclock_device::read_c0nx(address_space &space, UINT8 offset)
106{
107    if (m_dataout == 0)
108    {
109        return 0;
110    }
111
112    return 0xff;
113}
114
115
116/*-------------------------------------------------
117    write_c0nx - called for writes to this card's c0nx space
118-------------------------------------------------*/
119
120void a2bus_thunderclock_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
121{
122    // uPD1990AC hookup:
123    // bit 0 = DATA IN?
124    // bit 1 = CLK
125    // bit 2 = STB
126    // bit 3 = C0
127    // bit 4 = C1
128    // bit 5 = C2
129    // bit 7 = data out
130    if (offset == 0)
131    {
132        m_upd1990ac->cs_w(1);
133        m_upd1990ac->oe_w(1);
134        m_upd1990ac->data_in_w(data&0x01);
135        m_upd1990ac->c0_w((data&0x08) >> 3);
136        m_upd1990ac->c1_w((data&0x10) >> 4);
137        m_upd1990ac->c2_w((data&0x20) >> 5);
138        m_upd1990ac->stb_w((data&0x04) >> 2);
139        m_upd1990ac->clk_w((data&0x02) >> 1);
140    }
141}
142
143/*-------------------------------------------------
144    read_cnxx - called for reads from this card's cnxx space
145-------------------------------------------------*/
146
147UINT8 a2bus_thunderclock_device::read_cnxx(address_space &space, UINT8 offset)
148{
149    // ROM is primarily a c800 image, but the first page is also the CnXX ROM
150    return m_rom[offset];
151}
152
153/*-------------------------------------------------
154    read_c800 - called for reads from this card's c800 space
155-------------------------------------------------*/
156
157UINT8 a2bus_thunderclock_device::read_c800(address_space &space, UINT16 offset)
158{
159    return m_rom[offset];
160}
161
162WRITE_LINE_MEMBER( a2bus_thunderclock_device::upd_dataout_w )
163{
164    if (state)
165    {
166        m_dataout = 1;
167    }
168    else
169    {
170        m_dataout = 0;
171    }
172}
src/mess/machine/a2thunderclock.h
r0r14892
1/*********************************************************************
2
3    a2thunderclock.h
4
5    Implemention of the Thunderware Thunderclock Plus.
6
7*********************************************************************/
8
9#ifndef __A2BUS_THUNDERCLOCK__
10#define __A2BUS_THUNDERCLOCK__
11
12#include "emu.h"
13#include "machine/a2bus.h"
14#include "machine/upd1990a.h"
15
16//**************************************************************************
17//  TYPE DEFINITIONS
18//**************************************************************************
19
20class a2bus_thunderclock_device:
21    public device_t,
22    public device_a2bus_card_interface
23{
24public:
25    // construction/destruction
26    a2bus_thunderclock_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
27    a2bus_thunderclock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
28
29    // optional information overrides
30    virtual machine_config_constructor device_mconfig_additions() const;
31    virtual const rom_entry *device_rom_region() const;
32
33    DECLARE_WRITE_LINE_MEMBER( upd_dataout_w );
34
35protected:
36    virtual void device_start();
37    virtual void device_reset();
38
39    // overrides of standard a2bus slot functions
40    virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
41    virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
42    virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
43    virtual UINT8 read_c800(address_space &space, UINT16 offset);
44
45    required_device<upd1990a_device> m_upd1990ac;
46
47private:
48    UINT8 *m_rom;
49    int m_dataout;
50};
51
52// device type definition
53extern const device_type A2BUS_THUNDERCLOCK;
54
55#endif /* __A2BUS_THUNDERCLOCK__ */
56
src/mess/drivers/apple2.c
r14891r14892
199199#include "machine/a2cffa.h"
200200#include "machine/a2memexp.h"
201201#include "machine/a2scsi.h"
202#include "machine/a2thunderclock.h"
202203
203204/***************************************************************************
204205    PARAMETERS
r14891r14892
592593    SLOT_INTERFACE("cffa202", A2BUS_CFFA2_6502)  /* CFFA2000 Compact Flash for Apple II (www.dreher.net), 6502 firmware */
593594    SLOT_INTERFACE("memexp", A2BUS_MEMEXP)  /* Apple II Memory Expansion Card */
594595    SLOT_INTERFACE("ramfactor", A2BUS_RAMFACTOR)    /* Applied Engineering RamFactor */
596    SLOT_INTERFACE("thclock", A2BUS_THUNDERCLOCK)    /* ThunderWare ThunderClock Plus */
595597//    SLOT_INTERFACE("scsi", A2BUS_SCSI)  /* Apple II SCSI Card */
596598SLOT_INTERFACE_END
597599
src/mess/mess.mak
r14891r14892
648648   $(MESS_MACHINE)/a2cffa.o   \
649649    $(MESS_MACHINE)/a2memexp.o  \
650650    $(MESS_MACHINE)/a2scsi.o    \
651    $(MESS_MACHINE)/a2thunderclock.o    \
651652   $(MESS_MACHINE)/lisa.o      \
652653   $(MESS_DRIVERS)/lisa.o      \
653654   $(MESS_MACHINE)/nubus.o     \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team