Previous 15994 Revisions Next

r14226 Friday 27th January, 2012 at 07:53:41 UTC by Curt Coder
[VIC20] Emulated the VIC-1111 16K RAM Expansion cartridge. [Curt Coder]
[src/mess]mess.mak
[src/mess/machine]cbmipt.c cbmipt.h vic1111.c* vic1111.h*

src/mess/machine/cbmipt.c
r14225r14226
11271127SLOT_INTERFACE_START( vic20_expansion_cards )
11281128   SLOT_INTERFACE("3k", VIC1210)
11291129   SLOT_INTERFACE("8k", VIC1110)
1130   SLOT_INTERFACE("16k", VIC1111)
11301131   SLOT_INTERFACE("ieee488", VIC1112)
11311132SLOT_INTERFACE_END
11321133
src/mess/machine/cbmipt.h
r14225r14226
1414#include "machine/serialbox.h"
1515#include "machine/softbox.h"
1616#include "machine/vic1110.h"
17#include "machine/vic1111.h"
1718#include "machine/vic1112.h"
1819#include "machine/vic1210.h"
1920
src/mess/machine/vic1111.c
r0r14226
1/**********************************************************************
2
3    Commodore VIC-1111 16K RAM Expansion Cartridge emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "vic1111.h"
11
12
13
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17
18const device_type VIC1111 = &device_creator<vic1111_device>;
19
20
21
22//**************************************************************************
23//  LIVE DEVICE
24//**************************************************************************
25
26//-------------------------------------------------
27//  vic1111_device - constructor
28//-------------------------------------------------
29
30vic1111_device::vic1111_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
31    : device_t(mconfig, VIC1111, "VIC1111", 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 vic1111_device::device_start()
42{
43   // allocate memory
44   m_ram = auto_alloc_array(machine(), UINT8, 0x4000);
45}
46
47
48//-------------------------------------------------
49//  vic20_blk1_r - block 1 read
50//-------------------------------------------------
51
52UINT8 vic1111_device::vic20_blk1_r(address_space &space, offs_t offset)
53{
54   return m_ram[offset & 0x1fff];
55}
56
57
58//-------------------------------------------------
59//  vic20_blk1_w - block 1 write
60//-------------------------------------------------
61
62void vic1111_device::vic20_blk1_w(address_space &space, offs_t offset, UINT8 data)
63{
64   m_ram[offset & 0x1fff] = data;
65}
66
67
68//-------------------------------------------------
69//  vic20_blk2_r - block 2 read
70//-------------------------------------------------
71
72UINT8 vic1111_device::vic20_blk2_r(address_space &space, offs_t offset)
73{
74   return m_ram[0x2000 | (offset & 0x1fff)];
75}
76
77
78//-------------------------------------------------
79//  vic20_blk2_w - block 2 write
80//-------------------------------------------------
81
82void vic1111_device::vic20_blk2_w(address_space &space, offs_t offset, UINT8 data)
83{
84   m_ram[0x2000 | (offset & 0x1fff)] = data;
85}
src/mess/machine/vic1111.h
r0r14226
1/**********************************************************************
2
3    Commodore VIC-1111 16K 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 __VIC1111__
13#define __VIC1111__
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// ======================> vic1111_device
27
28class vic1111_device :  public device_t,
29                  public device_vic20_expansion_card_interface
30{
31public:
32    // construction/destruction
33    vic1111_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_blk1_r(address_space &space, offs_t offset);
41   virtual void vic20_blk1_w(address_space &space, offs_t offset, UINT8 data);
42   virtual UINT8 vic20_blk2_r(address_space &space, offs_t offset);
43   virtual void vic20_blk2_w(address_space &space, offs_t offset, UINT8 data);
44
45private:
46   UINT8 *m_ram;
47};
48
49
50// device type definition
51extern const device_type VIC1111;
52
53
54
55#endif
src/mess/mess.mak
r14225r14226
754754   $(MESS_DRIVERS)/vic20.o      \
755755   $(MESS_MACHINE)/vic20exp.o   \
756756   $(MESS_MACHINE)/vic1110.o   \
757   $(MESS_MACHINE)/vic1111.o   \
757758   $(MESS_MACHINE)/vic1112.o   \
758759   $(MESS_MACHINE)/vic1210.o   \
759760   $(MESS_AUDIO)/ted7360.o      \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team