Previous 15994 Revisions Next

r12123 Thursday 30th June, 2011 at 09:48:00 UTC by Curt Coder
[C64] Added skeleton device for XL 80 cartridge. (nw)
[src/mess]mess.mak
[src/mess/drivers]c64.c
[src/mess/machine]c64_xl80.c* c64_xl80.h* comx_clm.c

src/mess/machine/comx_clm.c
r12122r12123
145145//  GFXDECODE( comx_clm )
146146//-------------------------------------------------
147147
148static const gfx_layout comx_clm_gfxlayout =
149{
150   8, 8,               /* 8 x 8 characters */
151   256,               /* 256 characters */
152   1,               /* 1 bits per pixel */
153   { 0 },               /* no bitplanes */
154   /* x offsets */
155   { 0, 1, 2, 3, 4, 5, 6, 7 },
156   /* y offsets */
157   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
158   8*8               /* every char takes 8 bytes */
159};
160
161148static GFXDECODE_START( comx_clm )
162   GFXDECODE_ENTRY( "chargen", 0x0000, comx_clm_gfxlayout, 0, 36 )
149   GFXDECODE_ENTRY(MC6845_TAG, 0x0000, gfx_8x8x1, 0, 1)
163150GFXDECODE_END
164151
165152
r12122r12123
174161   MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 24*8-1)
175162   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
176163   MCFG_SCREEN_REFRESH_RATE(50)
164   
165   //MCFG_GFXDECODE(comx_clm)
177166
178167   MCFG_MC6845_ADD(MC6845_TAG, MC6845, XTAL_14_31818MHz, crtc_intf)
179168MACHINE_CONFIG_END
src/mess/machine/c64_xl80.c
r0r12123
1/*
2
3XL 80 cartridge
4(c) 1984 20 Data Corporation
5
6PCB Layout
7----------
8
9      |==================================|
10      |   LS175    LS20    LS139         |
11      |   LS157                          |
12|=======|                                  |
13|=|                          RAM           |
14|=|    LS157      LS157             LS165  |
15|=|                                        |
16|=|                                     CN1|
17|=|          CRTC            ROM1          |
18|=|                                        |
19|=|    ROM0          LS245   LS151         |
20|=|                             14.31818MHz|
21|=======|            LS174   LS00          |
22      |                           HCU04  |
23      |    LS74    LS161   LS74          |
24      |==================================|
25
26Notes:
27    All IC's shown.
28
29   CRTC    - Hitachi HD46505SP
30   RAM     - Toshiba TMM2016AP-12 2Kx8 Static RAM
31   ROM0    - GI 9433CS-0090 8Kx8 ROM?
32   ROM1    - GI 9316CS-F67 2Kx8 ROM? "DTC"
33   CN1     - RCA video output
34
35*/
36
37#include "c64_xl80.h"
38
39
40
41//**************************************************************************
42//  MACROS/CONSTANTS
43//**************************************************************************
44
45#define RAM_SIZE         0x800
46
47#define HD46505SP_TAG      "mc6845"
48#define MC6845_SCREEN_TAG   "screen80"
49
50
51
52//**************************************************************************
53//  DEVICE DEFINITIONS
54//**************************************************************************
55
56const device_type C64_XL80 = &device_creator<c64_xl80_device>;
57
58
59//-------------------------------------------------
60//  ROM( c64_xl80 )
61//-------------------------------------------------
62
63ROM_START( c64_xl80 )
64   ROM_REGION( 0x2000, "roml", 0 )
65   ROM_LOAD( "9433cs-0090.u3",   0x0000, 0x2000, NO_DUMP )
66
67   ROM_REGION( 0x800, HD46505SP_TAG, 0 )
68   ROM_LOAD( "dtc.u14", 0x000, 0x800, NO_DUMP )
69ROM_END
70
71
72//-------------------------------------------------
73//  rom_region - device-specific ROM region
74//-------------------------------------------------
75
76const rom_entry *c64_xl80_device::device_rom_region() const
77{
78   return ROM_NAME( c64_xl80 );
79}
80
81//-------------------------------------------------
82//  mc6845_interface crtc_intf
83//-------------------------------------------------
84
85void c64_xl80_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
86{
87}
88
89static MC6845_UPDATE_ROW( c64_xl80_update_row )
90{
91   c64_xl80_device *xl80 = downcast<c64_xl80_device *>(device->owner());
92   xl80->crtc_update_row(device,bitmap,cliprect,ma,ra,y,x_count,cursor_x,param);
93}
94
95static const mc6845_interface crtc_intf =
96{
97   MC6845_SCREEN_TAG,
98   8,
99   NULL,
100   c64_xl80_update_row,
101   NULL,
102   DEVCB_NULL,
103   DEVCB_NULL,
104   DEVCB_NULL,
105   DEVCB_NULL,
106   NULL
107};
108
109
110//-------------------------------------------------
111//  GFXDECODE( c64_xl80 )
112//-------------------------------------------------
113
114static GFXDECODE_START( c64_xl80 )
115   GFXDECODE_ENTRY(HD46505SP_TAG, 0x0000, gfx_8x8x1, 0, 1)
116GFXDECODE_END
117
118
119//-------------------------------------------------
120//  MACHINE_CONFIG_FRAGMENT( c64_xl80 )
121//-------------------------------------------------
122
123static MACHINE_CONFIG_FRAGMENT( c64_xl80 )
124   MCFG_SCREEN_ADD(MC6845_SCREEN_TAG, RASTER)
125   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
126   MCFG_SCREEN_SIZE(80*8, 24*8)
127   MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 24*8-1)
128   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
129   MCFG_SCREEN_REFRESH_RATE(50)
130   
131   //MCFG_GFXDECODE(c64_xl80)
132
133   MCFG_MC6845_ADD(HD46505SP_TAG, H46505, XTAL_14_31818MHz, crtc_intf)
134MACHINE_CONFIG_END
135
136
137//-------------------------------------------------
138//  machine_config_additions - device-specific
139//  machine configurations
140//-------------------------------------------------
141
142machine_config_constructor c64_xl80_device::device_mconfig_additions() const
143{
144   return MACHINE_CONFIG_NAME( c64_xl80 );
145}
146
147
148
149//**************************************************************************
150//  LIVE DEVICE
151//**************************************************************************
152
153//-------------------------------------------------
154//  c64_xl80_device - constructor
155//-------------------------------------------------
156
157c64_xl80_device::c64_xl80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
158   device_t(mconfig, C64_XL80, "XL 80", tag, owner, clock),
159   device_c64_expansion_card_interface(mconfig, *this),
160   device_slot_card_interface(mconfig, *this),
161   m_crtc(*this, HD46505SP_TAG)
162{
163}
164
165
166//-------------------------------------------------
167//  device_start - device-specific startup
168//-------------------------------------------------
169
170void c64_xl80_device::device_start()
171{
172   m_slot = dynamic_cast<c64_expansion_slot_device *>(owner());
173
174   m_rom = subregion("roml")->base();
175   m_char_rom = subregion(HD46505SP_TAG)->base();
176   m_video_ram = auto_alloc_array(machine(), UINT8, RAM_SIZE);;
177
178   // state saving
179   save_pointer(NAME(m_video_ram), RAM_SIZE);
180}
181
182
183//-------------------------------------------------
184//  device_reset - device-specific reset
185//-------------------------------------------------
186
187void c64_xl80_device::device_reset()
188{
189}
190
191
192//-------------------------------------------------
193//  c64_cd_r - cartridge data read
194//-------------------------------------------------
195
196UINT8 c64_xl80_device::c64_cd_r(offs_t offset, int roml, int romh, int io1, int io2)
197{
198   return 0;
199}
200
201
202//-------------------------------------------------
203//  c64_cd_w - cartridge data write
204//-------------------------------------------------
205
206void c64_xl80_device::c64_cd_w(offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
207{
208}
209
210
211//-------------------------------------------------
212//  c64_game_r - GAME read
213//-------------------------------------------------
214
215int c64_xl80_device::c64_game_r()
216{
217   return 1;
218}
219
220
221//-------------------------------------------------
222//  c64_exrom_r - EXROM read
223//-------------------------------------------------
224
225int c64_xl80_device::c64_exrom_r()
226{
227   return 0;
228}
229
230
231//-------------------------------------------------
232//  c64_screen_update - update screen
233//-------------------------------------------------
234
235bool c64_xl80_device::c64_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
236{
237   m_crtc->update(&bitmap, &cliprect);
238
239   return false;
240}
src/mess/machine/c64_xl80.h
r0r12123
1/**********************************************************************
2
3    XL 80 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 __XL80__
13#define __XL80__
14
15#define ADDRESS_MAP_MODERN
16
17#include "emu.h"
18#include "machine/c64exp.h"
19#include "video/mc6845.h"
20
21
22
23//**************************************************************************
24//  TYPE DEFINITIONS
25//**************************************************************************
26
27// ======================> c64_xl80_device
28
29class c64_xl80_device : public device_t,
30                   public device_c64_expansion_card_interface,
31                   public device_slot_card_interface
32{
33public:
34   // construction/destruction
35   c64_xl80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
36
37   // optional information overrides
38   virtual const rom_entry *device_rom_region() const;
39   virtual machine_config_constructor device_mconfig_additions() const;
40
41   // not really public
42   void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
43
44protected:
45   // device-level overrides
46   virtual void device_start();
47   virtual void device_reset();
48    virtual void device_config_complete() { m_shortname = "c64_xl80"; }
49
50   // device_c64_expansion_card_interface overrides
51   virtual UINT8 c64_cd_r(offs_t offset, int roml, int romh, int io1, int io2);
52   virtual void c64_cd_w(offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
53   virtual int c64_game_r();
54   virtual int c64_exrom_r();
55   virtual bool c64_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
56
57private:
58   c64_expansion_slot_device *m_slot;
59
60   // internal state
61   required_device<h46505_device> m_crtc;
62
63   UINT8 *m_rom;
64   UINT8 *m_char_rom;
65   UINT8 *m_video_ram;
66};
67
68
69// device type definition
70extern const device_type C64_XL80;
71
72
73#endif
src/mess/drivers/c64.c
r12122r12123
344344#include "machine/c2040.h"
345345#include "machine/interpod.h"
346346#include "machine/c64exp.h"
347#include "machine/c64_xl80.h"
347348
348349#include "includes/c64.h"
349350
r12122r12123
693694};
694695
695696static SLOT_INTERFACE_START( c64_expansion_cards )
697   SLOT_INTERFACE("xl80", C64_XL80)
696698SLOT_INTERFACE_END
697699
698700
src/mess/mess.mak
r12122r12123
730730   $(MESS_MACHINE)/pet.o      \
731731   $(MESS_DRIVERS)/c64.o      \
732732   $(MESS_MACHINE)/c64exp.o   \
733   $(MESS_MACHINE)/c64_xl80.o   \
733734   $(MESS_MACHINE)/interpod.o   \
734735   $(MESS_DRIVERS)/vic20.o      \
735736   $(MESS_MACHINE)/vic1112.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team