Previous 15994 Revisions Next

r14225 Friday 27th January, 2012 at 07:49:43 UTC by Curt Coder
[VIC20] Emulated the VIC-1210 3K RAM Expansion cartridge. [Curt Coder]
[src/mess]mess.mak
[src/mess/machine]cbmipt.c cbmipt.h vic1210.c* vic1210.h*

src/mess/machine/cbmipt.c
r14224r14225
11251125SLOT_INTERFACE_END
11261126
11271127SLOT_INTERFACE_START( vic20_expansion_cards )
1128   SLOT_INTERFACE("3k", VIC1210)
11281129   SLOT_INTERFACE("8k", VIC1110)
11291130   SLOT_INTERFACE("ieee488", VIC1112)
11301131SLOT_INTERFACE_END
src/mess/machine/cbmipt.h
r14224r14225
1515#include "machine/softbox.h"
1616#include "machine/vic1110.h"
1717#include "machine/vic1112.h"
18#include "machine/vic1210.h"
1819
1920
2021#define MCFG_CBM_IEC_ADD(_intf, _default_drive) \
src/mess/machine/vic1210.c
r0r14225
1/**********************************************************************
2
3    Commodore VIC-1210 3K RAM Expansion Cartridge emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "vic1210.h"
11
12
13
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17
18const device_type VIC1210 = &device_creator<vic1210_device>;
19
20
21
22//**************************************************************************
23//  LIVE DEVICE
24//**************************************************************************
25
26//-------------------------------------------------
27//  vic1210_device - constructor
28//-------------------------------------------------
29
30vic1210_device::vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
31    : device_t(mconfig, VIC1210, "VIC1210", tag, owner, clock),
32     device_vic20_expansion_card_interface(mconfig, *this)
33{
34}
35
36
37//-------------------------------------------------
38//  device_start - device-specific startup
39//-------------------------------------------------
40
41void vic1210_device::device_start()
42{
43   // allocate memory
44   m_ram = auto_alloc_array(machine(), UINT8, 0xc00);
45}
46
47
48//-------------------------------------------------
49//  vic20_ram1_r - RAM 1 read
50//-------------------------------------------------
51
52UINT8 vic1210_device::vic20_ram1_r(address_space &space, offs_t offset)
53{
54   return m_ram[offset & 0x3ff];
55}
56
57
58//-------------------------------------------------
59//  vic20_ram1_w - RAM 1 write
60//-------------------------------------------------
61
62void vic1210_device::vic20_ram1_w(address_space &space, offs_t offset, UINT8 data)
63{
64   m_ram[offset & 0x3ff] = data;
65}
66
67
68//-------------------------------------------------
69//  vic20_ram2_r - RAM 2 read
70//-------------------------------------------------
71
72UINT8 vic1210_device::vic20_ram2_r(address_space &space, offs_t offset)
73{
74   return m_ram[0x400 | (offset & 0x3ff)];
75}
76
77
78//-------------------------------------------------
79//  vic20_ram2_w - RAM 2 write
80//-------------------------------------------------
81
82void vic1210_device::vic20_ram2_w(address_space &space, offs_t offset, UINT8 data)
83{
84   m_ram[0x400 | (offset & 0x3ff)] = data;
85}
86
87
88//-------------------------------------------------
89//  vic20_ram3_r - RAM 3 read
90//-------------------------------------------------
91
92UINT8 vic1210_device::vic20_ram3_r(address_space &space, offs_t offset)
93{
94   return m_ram[0x800 | (offset & 0x3ff)];
95}
96
97
98//-------------------------------------------------
99//  vic20_ram3_w - RAM 3 write
100//-------------------------------------------------
101
102void vic1210_device::vic20_ram3_w(address_space &space, offs_t offset, UINT8 data)
103{
104   m_ram[0x800 | (offset & 0x3ff)] = data;
105}
src/mess/machine/vic1210.h
r0r14225
1/**********************************************************************
2
3    Commodore VIC-1210 3K RAM Expansion 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 __VIC1210__
13#define __VIC1210__
14
15#define ADDRESS_MAP_MODERN
16
17#include "emu.h"
18#include "machine/vic20exp.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> vic1210_device
27
28class vic1210_device :  public device_t,
29                  public device_vic20_expansion_card_interface
30{
31public:
32    // construction/destruction
33    vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34   
35protected:
36    // device-level overrides
37    virtual void device_start();
38   
39   // device_vic20_expansion_card_interface overrides
40   virtual UINT8 vic20_ram1_r(address_space &space, offs_t offset);
41   virtual void vic20_ram1_w(address_space &space, offs_t offset, UINT8 data);
42   virtual UINT8 vic20_ram2_r(address_space &space, offs_t offset);
43   virtual void vic20_ram2_w(address_space &space, offs_t offset, UINT8 data);
44   virtual UINT8 vic20_ram3_r(address_space &space, offs_t offset);
45   virtual void vic20_ram3_w(address_space &space, offs_t offset, UINT8 data);
46
47private:
48   UINT8 *m_ram;
49};
50
51
52// device type definition
53extern const device_type VIC1210;
54
55
56
57#endif
src/mess/mess.mak
r14224r14225
755755   $(MESS_MACHINE)/vic20exp.o   \
756756   $(MESS_MACHINE)/vic1110.o   \
757757   $(MESS_MACHINE)/vic1112.o   \
758   $(MESS_MACHINE)/vic1210.o   \
758759   $(MESS_AUDIO)/ted7360.o      \
759760   $(MESS_AUDIO)/t6721.o      \
760761   $(MESS_MACHINE)/c16.o      \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team