Previous 15994 Revisions Next

r14447 Monday 13th February, 2012 at 20:32:58 UTC by Curt Coder
[C64] Added support for the Dela 7x8 KB EPROM cartridge, and preliminary support for the Magic Formel cartridge. [Curt Coder]
[hash]c64_cart.xml
[src/mess]mess.mak mess_dev.lst
[src/mess/drivers]c64.c
[src/mess/machine]c64_dela_ep7x8.c* c64_dela_ep7x8.h* c64_ieee488.c c64_ieee488.h c64_magic_formel.c* c64_magic_formel.h* c64_silverrock.h c64_system3.c c64_xl80.c c64_xl80.h c64exp.c c64exp.h cbmipt.c cbmipt.h

hash/c64_cart.xml
r14446r14447
10711071      <publisher>Rex Datentechnik</publisher>
10721072      <info name="serial" value="REX 9513" />
10731073      <part name="cart" interface="c64_cart">
1074         <feature name="slot" value="rex" />
1074         <feature name="slot" value="rex_ep256" />
10751075         <feature name="exrom" value="0" />
10761076         <feature name="game" value="1" />
10771077         <dataarea name="roml" size="0x2000">
r14446r14447
12601260      </part>
12611261   </software>
12621262
1263   <software name="dela7x8k" supported="no">
1264      <description>7x8K-EPROM-Bank (Ger)</description>
1265      <year>19??</year>
1266      <publisher>Dela Elektronik</publisher>
1267      <part name="cart" interface="c64_cart">
1268         <feature name="slot" value="dela_7x8k" />
1269         <feature name="exrom" value="0" />
1270         <feature name="game" value="1" />
1271         <dataarea name="roml" size="0x2000">
1272            <rom name="dela_7x8k-eprom-bank.bin" size="0x2000" crc="546d7ea8" sha1="6ab7a279144bcaaa20e7b2d12d67d3ed5cc3f6b6" offset="0x0000" />
1273         </dataarea>
1274      </part>
1275   </software>
1276
12771263   <software name="c64link">
12781264      <description>C64-Link</description>
12791265      <year>1982</year>
r14446r14447
44294415      <year>19??</year>
44304416      <publisher>Dela Elektronik</publisher>
44314417      <part name="cart" interface="c64_cart">
4418         <feature name="slot" value="dela_ep256" />
44324419         <feature name="exrom" value="0" />
44334420         <feature name="game" value="1" />
44344421         <dataarea name="roml" size="0x2000">
r14446r14447
56495636      </part>
56505637   </software>
56515638
5652   <software name="magicf">
5639   <software name="formel64">
5640      <description>Formel 64</description>
5641      <year>1986</year>
5642      <publisher>Grewe Computertechnik</publisher>
5643      <part name="cart" interface="c64_cart">
5644         <feature name="slot" value="magic_formel" />
5645         <feature name="exrom" value="1" />
5646         <feature name="game" value="1" />
5647         <dataarea name="romh" size="0x10000">
5648            <rom name="magic_formel_v1.1_1986_ori.bin" size="0x10000" crc="71dc4e30" sha1="329c4e73150e4520cc11924e220210cec3bf78f6" offset="0x0000" />
5649         </dataarea>
5650         <dataarea name="ram" size="0x2000"/>
5651      </part>
5652   </software>
5653
5654   <software name="magicfor" cloneof="formel64">
56535655      <description>Magic Formel</description>
5654      <year>1984</year>
5655      <publisher>LS</publisher>
5656      <year>1986</year>
5657      <publisher>Grewe Computertechnik</publisher>
56565658      <part name="cart" interface="c64_cart">
56575659         <feature name="slot" value="magic_formel" />
56585660         <feature name="exrom" value="1" />
56595661         <feature name="game" value="1" />
5660         <dataarea name="roml" size="0x10000">
5661            <rom name="magic formel (1984)(ls).80" size="0x10000" crc="dfc8b7f3" sha1="7c2e12ee2836157af9f811e1c9017bff542c8cfa" offset="0x0000" />
5662         <dataarea name="romh" size="0x10000">
5663            <rom name="magic_formel_v1.2_1986_ori.bin" size="0x10000" crc="dfc8b7f3" sha1="7c2e12ee2836157af9f811e1c9017bff542c8cfa" offset="0x0000" />
56625664         </dataarea>
5665         <dataarea name="ram" size="0x2000"/>
56635666      </part>
56645667   </software>
56655668
5669   <software name="magicf20" cloneof="formel64">
5670      <description>Magic Formel 2.0</description>
5671      <year>1987</year>
5672      <publisher>Grewe Computertechnik</publisher>
5673      <part name="cart" interface="c64_cart">
5674         <feature name="slot" value="magic_formel" />
5675         <feature name="exrom" value="1" />
5676         <feature name="game" value="1" />
5677         <dataarea name="romh" size="0x20000">
5678            <rom name="magic_formel_v2.0_1987_1st_eprom.bin" size="0x10000" crc="030e0031" sha1="a78323a25fc9e93f6008669948c93afe2b14a63f" offset="0x00000" />
5679            <rom name="magic_formel_v2.0_1987_2nd_eprom.bin" size="0x8000" crc="5d5ce3e8" sha1="80db6efd099c66fccd0d6337226c3f786bed5b71" offset="0x18000" />
5680         </dataarea>
5681         <dataarea name="ram" size="0x2000"/>
5682      </part>
5683   </software>
5684
56665685   <software name="nordic72">
56675686      <description>Nordic Power: Action Cartridge v7.2</description>
56685687      <year>1991</year>
src/mess/machine/c64_silverrock.h
r14446r14447
4040   // device_c64_expansion_card_interface overrides
4141   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
4242   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
43   virtual int c64_game_r() { return 0; }
44   virtual int c64_exrom_r() { return 0; }
4543 
4644private:
4745   UINT8 m_bank;
src/mess/machine/cbmipt.c
r14446r14447
11431143SLOT_INTERFACE_END
11441144
11451145SLOT_INTERFACE_START( c64_expansion_cards )
1146   SLOT_INTERFACE("ep7x8", C64_DELA_EP7X8)
11461147   SLOT_INTERFACE("georam", C64_GEORAM)
11471148   SLOT_INTERFACE("ieee488", C64_IEEE488)
11481149   SLOT_INTERFACE("xl80", C64_XL80)
r14446r14447
11551156   SLOT_INTERFACE("epyxfastload", C64_EPYX_FAST_LOAD)
11561157   SLOT_INTERFACE("fun_play", C64_FUN_PLAY)
11571158   SLOT_INTERFACE("magic_desk", C64_MAGIC_DESK)
1159   SLOT_INTERFACE("magic_formel", C64_MAGIC_FORMEL)
11581160   SLOT_INTERFACE("mikroasm", C64_MIKRO_ASSEMBLER)
11591161   SLOT_INTERFACE("multiscreen", C64_MULTISCREEN)
11601162   SLOT_INTERFACE("ocean", C64_OCEAN)
src/mess/machine/cbmipt.h
r14446r14447
44#define CBMIPT_H_
55
66#include "machine/c64_comal80.h"
7#include "machine/c64_dela_ep7x8.h"
78#include "machine/c64_dinamic.h"
89#include "machine/c64_easy_calc_result.h"
910#include "machine/c64_epyx_fast_load.h"
r14446r14447
1112#include "machine/c64_georam.h"
1213#include "machine/c64_ieee488.h"
1314#include "machine/c64_magic_desk.h"
15#include "machine/c64_magic_formel.h"
1416#include "machine/c64_mikro_assembler.h"
1517#include "machine/c64_multiscreen.h"
1618#include "machine/c64_ocean.h"
src/mess/machine/c64_system3.c
r14446r14447
8181{
8282   if (!io1)
8383   {
84      m_bank = offset & 0x0f;
84      m_bank = offset & 0x3f;
8585   }
8686}
src/mess/machine/c64_xl80.c
r14446r14447
258258      m_video_ram[offset & 0x7ff] = data;
259259   }
260260}
261
262
263//-------------------------------------------------
264//  c64_game_r - GAME read
265//-------------------------------------------------
266
267int c64_xl80_device::c64_game_r()
268{
269   return 1;
270}
271
272
273//-------------------------------------------------
274//  c64_exrom_r - EXROM read
275//-------------------------------------------------
276
277int c64_xl80_device::c64_exrom_r()
278{
279   return 0;
280}
src/mess/machine/c64_xl80.h
r14446r14447
4949   // device_c64_expansion_card_interface overrides
5050   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
5151   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
52   virtual int c64_game_r();
53   virtual int c64_exrom_r();
52   virtual int c64_game_r(offs_t offset, int ba, int rw) { return 1; }
53   virtual int c64_exrom_r() { return 0; }
5454
5555private:
5656   required_device<h46505_device> m_crtc;
src/mess/machine/c64_ieee488.c
r14446r14447
351351//  c64_game_r - GAME read
352352//-------------------------------------------------
353353 
354int c64_ieee488_device::c64_game_r()
354int c64_ieee488_device::c64_game_r(offs_t offset, int ba, int rw)
355355{
356   return m_exp->game_r();
356   return m_exp->game_r(offset, ba, rw);
357357}
src/mess/machine/c64_ieee488.h
r14446r14447
5959   // device_c64_expansion_card_interface overrides
6060   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
6161   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
62   virtual int c64_game_r();
62   virtual int c64_game_r(offs_t offset, int ba, int rw);
6363 
6464private:
6565   required_device<device_t> m_tpi;
src/mess/machine/c64_magic_formel.c
r0r14447
1/**********************************************************************
2 
3    Magic Formel cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "c64_magic_formel.h"
11 
12 
13 
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17 
18#define MC6821_TAG      "mc6821"
19 
20#define PA4    (m_pb7_ff ? m_ram_oe : 0)
21 
22 
23//**************************************************************************
24//  DEVICE DEFINITIONS
25//**************************************************************************
26 
27const device_type C64_MAGIC_FORMEL = &device_creator<c64_magic_formel_cartridge_device>;
28 
29 
30//-------------------------------------------------
31//  pia6821_interface pia_intf
32//-------------------------------------------------
33 
34WRITE8_MEMBER( c64_magic_formel_cartridge_device::pia_pa_w )
35{
36   /*
37 
38        bit     description
39 
40        PA0      ROM A13
41        PA1      ROM A14
42        PA2      ROM A15
43        PA3      ROM _OE
44        PA4      RAM _OE
45        PA5       
46        PA6       
47        PA7       
48 
49    */
50   
51   m_rom_bank = data & 0x0f;
52 
53   m_rom_oe = BIT(data, 3);
54 
55   m_ram_oe = BIT(data, 4);
56}
57 
58WRITE8_MEMBER( c64_magic_formel_cartridge_device::pia_pb_w )
59{
60   /*
61 
62        bit     description
63 
64        PB0      RAM A10
65        PB1      RAM A11
66        PB2      RAM A9
67        PB3      RAM A8
68        PB4      RAM A12
69        PB5
70        PB6
71        PB7      ROMH enable
72 
73    */
74   
75   m_ram_bank = data & 0x1f;
76   
77   m_pb7 = BIT(data, 7);
78 
79   if (!m_pb7)
80   {
81      m_pb7_ff = 1;
82   }
83}
84 
85WRITE_LINE_MEMBER( c64_magic_formel_cartridge_device::pia_cb2_w )
86{
87   if (!state)
88   {
89      m_cb2_ff = 1;
90   }
91}
92 
93static const pia6821_interface pia_intf =
94{
95   DEVCB_NULL,      // input A
96   DEVCB_NULL,      // input B
97   DEVCB_NULL,                              // input CA1
98   DEVCB_NULL,                                 // input CB1
99   DEVCB_NULL,                                 // input CA2
100   DEVCB_NULL,                                 // input CB2
101   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_formel_cartridge_device, pia_pa_w),      // output A
102   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_formel_cartridge_device, pia_pb_w),      // output B
103   DEVCB_NULL,                                 // output CA2
104   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_formel_cartridge_device, pia_cb2_w),      // output CB2
105   DEVCB_NULL,                                 // irq A
106   DEVCB_NULL                                 // irq B
107};
108 
109 
110//-------------------------------------------------
111//  MACHINE_CONFIG_FRAGMENT( c64_magic_formel )
112//-------------------------------------------------
113 
114static MACHINE_CONFIG_FRAGMENT( c64_magic_formel )
115   MCFG_PIA6821_ADD(MC6821_TAG, pia_intf)
116MACHINE_CONFIG_END
117 
118 
119//-------------------------------------------------
120//  machine_config_additions - device-specific
121//  machine configurations
122//-------------------------------------------------
123 
124machine_config_constructor c64_magic_formel_cartridge_device::device_mconfig_additions() const
125{
126   return MACHINE_CONFIG_NAME( c64_magic_formel );
127}
128 
129 
130//-------------------------------------------------
131//  INPUT_PORTS( c64_magic_formel )
132//-------------------------------------------------
133 
134INPUT_CHANGED( c64_magic_formel_cartridge_device::freeze )
135{
136   /*
137   if (!newval && (m_pb7_ff & m_cb2_ff))
138   {
139      m_cb2_ff = 0;
140       
141      m_slot->nmi_w(ASSERT_LINE);
142   }
143   else
144   {
145      m_slot->nmi_w(CLEAR_LINE);
146   }
147   */
148}
149 
150static INPUT_PORTS_START( c64_magic_formel )
151   PORT_START("FREEZE")
152   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Freeze") PORT_CHANGED(c64_magic_formel_cartridge_device::freeze, 0)
153INPUT_PORTS_END
154 
155 
156//-------------------------------------------------
157//  input_ports - device-specific input ports
158//-------------------------------------------------
159 
160ioport_constructor c64_magic_formel_cartridge_device::device_input_ports() const
161{
162   return INPUT_PORTS_NAME( c64_magic_formel );
163}
164 
165 
166 
167//**************************************************************************
168//  LIVE DEVICE
169//**************************************************************************
170 
171//-------------------------------------------------
172//  c64_magic_formel_cartridge_device - constructor
173//-------------------------------------------------
174 
175c64_magic_formel_cartridge_device::c64_magic_formel_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
176   device_t(mconfig, C64_MAGIC_FORMEL, "C64 Magic Formel cartridge", tag, owner, clock),
177   device_c64_expansion_card_interface(mconfig, *this),
178   m_pia(*this, MC6821_TAG)
179{
180}
181 
182 
183//-------------------------------------------------
184//  device_start - device-specific startup
185//-------------------------------------------------
186 
187void c64_magic_formel_cartridge_device::device_start()
188{
189   // state saving
190   save_item(NAME(m_rom_bank));
191   save_item(NAME(m_ram_bank));
192   save_item(NAME(m_pb7_ff));
193   save_item(NAME(m_cb2_ff));
194   save_item(NAME(m_rom_oe));
195   save_item(NAME(m_ram_oe));
196   save_item(NAME(m_pb7));
197}
198 
199 
200//-------------------------------------------------
201//  device_reset - device-specific reset
202//-------------------------------------------------
203 
204void c64_magic_formel_cartridge_device::device_reset()
205{
206   m_rom_bank = 0;
207   m_ram_bank = 0;
208   m_pb7_ff = 0;
209   m_cb2_ff = 0;
210   m_rom_oe = 0;
211   m_ram_oe = 0;
212}
213 
214 
215//-------------------------------------------------
216//  c64_cd_r - cartridge data read
217//-------------------------------------------------
218 
219UINT8 c64_magic_formel_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
220{
221   UINT8 data = 0;
222   
223   if (!romh && !m_rom_oe)
224   {
225      UINT8 bank = m_pb7_ff ? m_rom_bank : 0;
226      offs_t addr = (bank << 13) | (offset & 0x1fff);
227      data = m_romh[addr];
228   }
229   else if (!io1 && !PA4)
230   {
231      offs_t addr = (m_ram_bank << 8) | (offset & 0xff);
232      data = m_ram[addr];
233   }
234 
235   return data;
236}
237 
238 
239//-------------------------------------------------
240//  c64_cd_w - cartridge data write
241//-------------------------------------------------
242 
243void c64_magic_formel_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
244{
245   if (!io1)
246   {
247      offs_t addr = (m_ram_bank << 8) | (offset & 0xff);
248      m_ram[addr] = data;
249   }
250   else if (!io2 && !(m_cb2_ff & PA4))
251   {
252      offs_t addr = (offset >> 6) & 0x03;
253      UINT8 new_data = (BIT(data, 1) << 7) | (offset & 0x3f);
254      m_pia->write(space, addr, new_data);
255   }
256   else if (offset == 0x0001)
257   {
258      m_pb7_ff = 0;
259   }
260}
261 
262 
263//-------------------------------------------------
264//  c64_cd_w - GAME read
265//-------------------------------------------------
266 
267int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int ba, int rw)
268{
269   return !(ba & rw & ((offset & 0xe000) == 0xe000) & !(m_pb7 & m_cb2_ff));
270}
src/mess/machine/c64_magic_formel.h
r0r14447
1/**********************************************************************
2 
3    Magic Formel 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 __MAGIC_FORMEL__
13#define __MAGIC_FORMEL__
14 
15#define ADDRESS_MAP_MODERN
16 
17#include "emu.h"
18#include "machine/c64exp.h"
19#include "machine/6821pia.h"
20 
21 
22 
23//**************************************************************************
24//  TYPE DEFINITIONS
25//**************************************************************************
26 
27// ======================> c64_magic_formel_cartridge_device
28 
29class c64_magic_formel_cartridge_device : public device_t,
30                                public device_c64_expansion_card_interface
31{
32public:
33   // construction/destruction
34   c64_magic_formel_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35 
36   // optional information overrides
37   virtual machine_config_constructor device_mconfig_additions() const;
38   virtual ioport_constructor device_input_ports() const;
39 
40   static INPUT_CHANGED( freeze );
41   
42   // not really public
43   DECLARE_WRITE8_MEMBER( pia_pa_w );
44   DECLARE_WRITE8_MEMBER( pia_pb_w );
45   DECLARE_WRITE_LINE_MEMBER( pia_cb2_w );
46 
47protected:
48   // device-level overrides
49   virtual void device_start();
50   virtual void device_reset();
51 
52   // device_c64_expansion_card_interface overrides
53   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
54   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
55   virtual int c64_game_r(offs_t offset, int ba, int rw);
56   
57private:
58   required_device<pia6821_device> m_pia;
59   
60   UINT8 m_rom_bank;
61   UINT8 m_ram_bank;
62   int m_pb7_ff;
63   int m_cb2_ff;
64   int m_rom_oe;
65   int m_ram_oe;
66   int m_pb7;
67};
68 
69 
70// device type definition
71extern const device_type C64_MAGIC_FORMEL;
72 
73 
74#endif
src/mess/machine/c64exp.c
r14446r14447
407407//  game_r - GAME read
408408//-------------------------------------------------
409409
410READ_LINE_MEMBER( c64_expansion_slot_device::game_r )
410int c64_expansion_slot_device::game_r(offs_t offset, int ba, int rw)
411411{
412412   int state = 1;
413413
414414   if (m_cart != NULL)
415415   {
416      state = m_cart->c64_game_r();
416      state = m_cart->c64_game_r(offset, ba, rw);
417417   }
418418
419419   return state;
src/mess/machine/c64exp.h
r14446r14447
101101   DECLARE_WRITE8_MEMBER( io1_w );
102102   DECLARE_READ8_MEMBER( io2_r );
103103   DECLARE_WRITE8_MEMBER( io2_w );
104   DECLARE_READ_LINE_MEMBER( game_r );
104   int game_r(offs_t offset, int ba, int rw);
105105   DECLARE_READ_LINE_MEMBER( exrom_r );
106106
107107   DECLARE_WRITE_LINE_MEMBER( irq_w );
r14446r14447
157157   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2) { };
158158
159159   // memory banking
160   virtual int c64_game_r() { return m_game; }
160   virtual int c64_game_r(offs_t offset, int ba, int rw) { return m_game; }
161161   virtual int c64_exrom_r() { return m_exrom; }
162162   virtual void c64_game_w(int state) { m_game = state; }
163163   virtual void c64_exrom_w(int state) { m_exrom = state; }
src/mess/machine/c64_dela_ep7x8.c
r0r14447
1/**********************************************************************
2 
3    Dela 7x8K EPROM cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "c64_dela_ep7x8.h"
11 
12 
13 
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17 
18const device_type C64_DELA_EP7X8 = &device_creator<c64_dela_ep7x8_cartridge_device>;
19 
20 
21//-------------------------------------------------
22//  ROM( c64_dela_ep7x8 )
23//-------------------------------------------------
24 
25ROM_START( c64_dela_ep7x8 )
26   ROM_REGION( 0x10000, "roml", 0 )
27   ROM_LOAD( "dela_7x8k-eprom-bank.bin", 0x0000, 0x2000, CRC(546d7ea8) SHA1(6ab7a279144bcaaa20e7b2d12d67d3ed5cc3f6b6) )
28   ROM_CART_LOAD( "rom1", 0x2000, 0x2000, ROM_MIRROR )
29   ROM_CART_LOAD( "rom2", 0x4000, 0x2000, ROM_MIRROR )
30   ROM_CART_LOAD( "rom3", 0x6000, 0x2000, ROM_MIRROR )
31   ROM_CART_LOAD( "rom4", 0x8000, 0x2000, ROM_MIRROR )
32   ROM_CART_LOAD( "rom5", 0xa000, 0x2000, ROM_MIRROR )
33   ROM_CART_LOAD( "rom6", 0xc000, 0x2000, ROM_MIRROR )
34   ROM_CART_LOAD( "rom7", 0xe000, 0x2000, ROM_MIRROR )
35ROM_END
36 
37 
38//-------------------------------------------------
39//  rom_region - device-specific ROM region
40//-------------------------------------------------
41 
42const rom_entry *c64_dela_ep7x8_cartridge_device::device_rom_region() const
43{
44   return ROM_NAME( c64_dela_ep7x8 );
45}
46 
47 
48//-------------------------------------------------
49//  MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 )
50//-------------------------------------------------
51 
52static MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 )
53   MCFG_CARTSLOT_ADD("rom1")
54   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
55   MCFG_CARTSLOT_ADD("rom2")
56   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
57   MCFG_CARTSLOT_ADD("rom3")
58   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
59   MCFG_CARTSLOT_ADD("rom4")
60   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
61   MCFG_CARTSLOT_ADD("rom5")
62   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
63   MCFG_CARTSLOT_ADD("rom6")
64   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
65   MCFG_CARTSLOT_ADD("rom7")
66   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
67MACHINE_CONFIG_END
68 
69 
70//-------------------------------------------------
71//  machine_config_additions - device-specific
72//  machine configurations
73//-------------------------------------------------
74 
75machine_config_constructor c64_dela_ep7x8_cartridge_device::device_mconfig_additions() const
76{
77   return MACHINE_CONFIG_NAME( c64_dela_ep7x8 );
78}
79 
80 
81//**************************************************************************
82//  LIVE DEVICE
83//**************************************************************************
84 
85//-------------------------------------------------
86//  c64_dela_ep7x8_cartridge_device - constructor
87//-------------------------------------------------
88 
89c64_dela_ep7x8_cartridge_device::c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
90   device_t(mconfig, C64_DELA_EP7X8, "C64 Dela 7x8KB EPROM cartridge", tag, owner, clock),
91   device_c64_expansion_card_interface(mconfig, *this)
92{
93}
94 
95 
96//-------------------------------------------------
97//  device_start - device-specific startup
98//-------------------------------------------------
99 
100void c64_dela_ep7x8_cartridge_device::device_start()
101{
102   m_roml = subregion("roml")->base();
103   
104   // state saving
105   save_item(NAME(m_bank));
106}
107 
108 
109//-------------------------------------------------
110//  device_reset - device-specific reset
111//-------------------------------------------------
112 
113void c64_dela_ep7x8_cartridge_device::device_reset()
114{
115   m_bank = 0xfe;
116   m_exrom = 0;
117}
118 
119 
120//-------------------------------------------------
121//  c64_cd_r - cartridge data read
122//-------------------------------------------------
123 
124UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
125{
126   UINT8 data = 0;
127   
128   if (!roml)
129   {
130      offs_t addr = offset & 0x1fff;
131       
132      if (!BIT(m_bank, 0)) data |= m_roml[0x0000 + addr];
133      if (!BIT(m_bank, 1)) data |= m_roml[0x2000 + addr];
134      if (!BIT(m_bank, 2)) data |= m_roml[0x4000 + addr];
135      if (!BIT(m_bank, 3)) data |= m_roml[0x6000 + addr];
136      if (!BIT(m_bank, 4)) data |= m_roml[0x8000 + addr];
137      if (!BIT(m_bank, 5)) data |= m_roml[0xa000 + addr];
138      if (!BIT(m_bank, 6)) data |= m_roml[0xc000 + addr];
139      if (!BIT(m_bank, 7)) data |= m_roml[0xe000 + addr];
140   }
141 
142   return data;
143}
144 
145 
146//-------------------------------------------------
147//  c64_cd_w - cartridge data write
148//-------------------------------------------------
149 
150void c64_dela_ep7x8_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
151{
152   if (!io1)
153   {
154      m_bank = data;
155       
156      if (data == 0xff)
157      {
158         m_exrom = 1;
159      }
160      else
161      {
162         m_exrom = 0;
163      }
164   }
165}
src/mess/machine/c64_dela_ep7x8.h
r0r14447
1/**********************************************************************
2 
3    Dela 7x8K EPROM 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 __DELA_EP7X8__
13#define __DELA_EP7X8__
14 
15#define ADDRESS_MAP_MODERN
16 
17#include "emu.h"
18#include "imagedev/cartslot.h"
19#include "machine/c64exp.h"
20 
21 
22 
23//**************************************************************************
24//  TYPE DEFINITIONS
25//**************************************************************************
26 
27// ======================> c64_dela_ep7x8_cartridge_device
28 
29class c64_dela_ep7x8_cartridge_device : public device_t,
30                              public device_c64_expansion_card_interface
31{
32public:
33   // construction/destruction
34   c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35 
36   // optional information overrides
37   virtual const rom_entry *device_rom_region() const;
38   virtual machine_config_constructor device_mconfig_additions() const;
39 
40protected:
41   // device-level overrides
42    virtual void device_config_complete() { m_shortname = "ep7x8"; }
43   virtual void device_start();
44   virtual void device_reset();
45 
46   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
48   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
49   
50private:
51   UINT8 m_bank;
52};
53 
54 
55// device type definition
56extern const device_type C64_DELA_EP7X8;
57 
58 
59 
60#endif
src/mess/mess_dev.lst
r14446r14447
151151TANDY2K_KEYBOARD
152152WANGPC_KEYBOARD
153153C64_IEEE488
154C64_DELA_EP7X8
src/mess/mess.mak
r14446r14447
754754   $(MESS_MACHINE)/c64exp.o   \
755755   $(MESS_MACHINE)/c64user.o   \
756756   $(MESS_MACHINE)/c64_comal80.o   \
757   $(MESS_MACHINE)/c64_dela_ep7x8.o   \
757758   $(MESS_MACHINE)/c64_dinamic.o   \
758759   $(MESS_MACHINE)/c64_easy_calc_result.o   \
759760   $(MESS_MACHINE)/c64_epyx_fast_load.o   \
r14446r14447
761762   $(MESS_MACHINE)/c64_georam.o   \
762763   $(MESS_MACHINE)/c64_ieee488.o   \
763764   $(MESS_MACHINE)/c64_magic_desk.o   \
765   $(MESS_MACHINE)/c64_magic_formel.o   \
764766   $(MESS_MACHINE)/c64_mikro_assembler.o   \
765767   $(MESS_MACHINE)/c64_multiscreen.o   \
766768   $(MESS_MACHINE)/c64_ocean.o   \
src/mess/drivers/c64.c
r14446r14447
6767
6868void c64_state::bankswitch(offs_t offset, offs_t va, int rw, int aec, int ba, int cas, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh)
6969{
70   int game = m_exp->game_r();
70   int game = m_exp->game_r(offset, rw, ba);
7171   int exrom = m_exp->exrom_r();
7272
7373   UINT16 input = VA12 << 15 | VA13 << 14 | game << 13 | exrom << 12 | rw << 11 | aec << 10 | ba << 9 | A12 << 8 | A13 << 7 | A14 << 6 | A15 << 5 | m_va14 << 4 | m_charen << 3 | m_hiram << 2 | m_loram << 1 | cas;
r14446r14447
192192   {
193193      m_ram->pointer()[offset] = data;
194194     
195      if (offset >= 0x8000 && offset < 0xc000)
195      if (offset == 0x0001 || (offset >= 0x8000 && offset < 0xc000))
196196      {
197197         m_exp->write(space, offset, data);
198198      }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team