Previous 199869 Revisions Next

r18143 Tuesday 25th September, 2012 at 14:55:28 UTC by Curt Coder
(MESS) cbm2: Added skeleton for CBM-II high resolution cartridge. (nw)
[hash]cbm2_cart.xml
[src/mess]mess.mak
[src/mess/machine]cbm2_graphic.c* cbm2_graphic.h* cbmipt.c cbmipt.h

trunk/hash/cbm2_cart.xml
r18142r18143
8888      </part>
8989   </software>
9090
91   <software name="graphic">
92      <description>High Resolution Graphics</description>
93      <year>198?</year>
94      <publisher>Commodore</publisher>
95     
96      <part name="cart" interface="cbm2_cart">
97         <feature name="slot" value="graphic" />
98
99         <dataarea name="bank3" size="0x2000">
100            <rom name="324688-01.bin" size="0x2000" crc="863e9ef8" sha1="d75ffa97b2dd4e1baefe4acaa130daae866ab0e8" offset="0" />
101         </dataarea>
102      </part>
103   </software>
104
91105</softwarelist>
trunk/src/mess/mess.mak
r18142r18143
889889   $(MESS_DRIVERS)/cbm2.o      \
890890   $(MESS_MACHINE)/cbm2exp.o   \
891891   $(MESS_MACHINE)/cbm2_std.o   \
892   $(MESS_MACHINE)/cbm2_graphic.o   \
892893   $(MESS_DRIVERS)/c65.o      \
893894   $(MESS_MACHINE)/c65.o      \
894895   $(MESS_DRIVERS)/c128.o      \
trunk/src/mess/machine/cbmipt.c
r18142r18143
10451045
10461046SLOT_INTERFACE_START( cbm2_expansion_cards )
10471047   SLOT_INTERFACE_INTERNAL("standard", CBM2_STD)
1048   SLOT_INTERFACE_INTERNAL("graphic", CBM2_GRAPHIC)
10481049SLOT_INTERFACE_END
10491050
10501051SLOT_INTERFACE_START( cbm_datassette_devices )
trunk/src/mess/machine/cbmipt.h
r18142r18143
6161#include "machine/c64_zaxxon.h"
6262#include "machine/c128_comal80.h"
6363#include "machine/cbm2_std.h"
64#include "machine/cbm2_graphic.h"
6465#include "machine/c1541.h"
6566#include "machine/c1551.h"
6667#include "machine/c1571.h"
trunk/src/mess/machine/cbm2_graphic.c
r0r18143
1/**********************************************************************
2
3    CBM 500/600/700 High Resolution Graphics cartridge emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11
12   TODO:
13
14   - version A (EF9365, 512x512 interlaced, 1 page)
15   - version B (EF9366, 512x256 non-interlaced, 2 pages)
16
17*/
18
19#include "cbm2_graphic.h"
20
21
22
23//**************************************************************************
24//  MACROS/CONSTANTS
25//**************************************************************************
26
27#define EF9365_TAG   "ef9365"
28#define EF9366_TAG   "ef9366"
29#define SCREEN_TAG   "screen"
30
31
32
33//**************************************************************************
34//  DEVICE DEFINITIONS
35//**************************************************************************
36
37const device_type CBM2_GRAPHIC = &device_creator<cbm2_graphic_cartridge_device>;
38
39
40//-------------------------------------------------
41//  ef9345_interface gdp_intf
42//-------------------------------------------------
43
44static const ef9345_interface gdp_intf =
45{
46   SCREEN_TAG
47};
48
49
50//-------------------------------------------------
51//  MACHINE_CONFIG_FRAGMENT( cbm2_graphic_a )
52//-------------------------------------------------
53
54static MACHINE_CONFIG_FRAGMENT( cbm2_graphic_a )
55   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
56   MCFG_SCREEN_UPDATE_DEVICE(EF9365_TAG, ef9345_device, screen_update)
57   MCFG_SCREEN_SIZE(512, 512)
58   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 512-1)
59   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
60   MCFG_SCREEN_REFRESH_RATE(50)
61
62   MCFG_EF9345_ADD(EF9365_TAG, gdp_intf)
63MACHINE_CONFIG_END
64
65
66//-------------------------------------------------
67//  MACHINE_CONFIG_FRAGMENT( cbm2_graphic_b )
68//-------------------------------------------------
69
70static MACHINE_CONFIG_FRAGMENT( cbm2_graphic_b )
71   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
72   MCFG_SCREEN_UPDATE_DEVICE(EF9366_TAG, ef9345_device, screen_update)
73   MCFG_SCREEN_SIZE(512, 256)
74   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
75   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
76   MCFG_SCREEN_REFRESH_RATE(50)
77
78   MCFG_EF9345_ADD(EF9366_TAG, gdp_intf)
79MACHINE_CONFIG_END
80
81
82//-------------------------------------------------
83//  machine_config_additions - device-specific
84//  machine configurations
85//-------------------------------------------------
86
87machine_config_constructor cbm2_graphic_cartridge_device::device_mconfig_additions() const
88{
89   switch (m_variant)
90   {
91   default: return MACHINE_CONFIG_NAME( cbm2_graphic_a );
92   case TYPE_B: return MACHINE_CONFIG_NAME( cbm2_graphic_b );
93   }
94}
95
96
97
98//**************************************************************************
99//  LIVE DEVICE
100//**************************************************************************
101
102//-------------------------------------------------
103//  cbm2_graphic_cartridge_device - constructor
104//-------------------------------------------------
105
106cbm2_graphic_cartridge_device::cbm2_graphic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
107   device_t(mconfig, CBM2_GRAPHIC, "CBM 500/600/700 High Resolution Graphics", tag, owner, clock),
108   device_cbm2_expansion_card_interface(mconfig, *this),
109   m_gdc(*this, EF9365_TAG),
110   m_variant(TYPE_A)
111{
112}
113
114
115//-------------------------------------------------
116//  device_start - device-specific startup
117//-------------------------------------------------
118
119void cbm2_graphic_cartridge_device::device_start()
120{
121}
122
123
124//-------------------------------------------------
125//  device_reset - device-specific reset
126//-------------------------------------------------
127
128void cbm2_graphic_cartridge_device::device_reset()
129{
130}
131
132
133//-------------------------------------------------
134//  cbm2_bd_r - cartridge data read
135//-------------------------------------------------
136
137UINT8 cbm2_graphic_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3)
138{
139   if (!csbank3)
140   {
141      if (offset < 0x7f80)
142      {
143         data = m_bank3[offset & m_bank1_mask];
144      }
145      else if (offset == 0x7f90)
146      {
147         /*
148         
149             bit     description
150         
151             0       light pen
152             1       
153             2       
154             3       
155             4       
156             5       
157             6       
158             7       
159         
160         */
161      }
162      else if (offset == 0x7fb0)
163      {
164         // hard copy
165      }
166      else if (offset >= 0x7ff0)
167      {
168         data = m_gdc->data_r(space, offset & 0x07);
169      }
170   }
171
172   return data;
173}
174
175
176//-------------------------------------------------
177//  cbm2_bd_w - cartridge data write
178//-------------------------------------------------
179
180void cbm2_graphic_cartridge_device::cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3)
181{
182   if (!csbank3)
183   {
184      if (offset == 0x7f80)
185      {
186         /*
187         
188             bit     description
189         
190             0       hard copy (0=active)
191             1       operating page select (version B)
192             2       
193             3       read-modify-write (1=active)
194             4       display switch (1=graphic)
195             5       display page select (version B)
196             6       
197             7       
198         
199         */
200      }
201      else if (offset >= 0x7ff0)
202      {
203         m_gdc->data_w(space, offset & 0x07, data);
204      }
205   }
206}
trunk/src/mess/machine/cbm2_graphic.h
r0r18143
1/**********************************************************************
2
3    CBM 500/600/700 High Resolution Graphics 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 __CBM2_GRAPHIC__
13#define __CBM2_GRAPHIC__
14
15
16#include "emu.h"
17#include "machine/cbm2exp.h"
18#include "video/ef9345.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> cbm2_graphic_cartridge_device
27
28class cbm2_graphic_cartridge_device : public device_t,
29                              public device_cbm2_expansion_card_interface
30{
31public:
32   // construction/destruction
33   cbm2_graphic_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
38protected:
39   enum
40   {
41      TYPE_A,
42      TYPE_B
43   };
44
45   // device-level overrides
46    virtual void device_config_complete() { m_shortname = "cbm2_graphic"; }
47   virtual void device_start();
48   virtual void device_reset();
49
50   // device_cbm2_expansion_card_interface overrides
51   virtual UINT8 cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3);
52   virtual void cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3);
53
54private:
55   required_device<ef9345_device> m_gdc;
56
57   int m_variant;
58};
59
60
61// device type definition
62extern const device_type CBM2_GRAPHIC;
63
64
65#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team