Previous 15994 Revisions Next

r14484 Thursday 16th February, 2012 at 16:37:26 UTC by Curt Coder
[C64] Added support for StarDOS and Warp Speed cartridges. [Curt Coder]
[hash]c64_cart.xml
[src/mess]mess.mak
[src/mess/drivers]c64.c
[src/mess/formats]cbm_crt.c* cbm_crt.h*
[src/mess/machine]c64_easyflash.c c64_easyflash.h c64_ieee488.c c64_ieee488.h c64_magic_formel.c c64_magic_formel.h c64_stardos.c* c64_stardos.h* c64_warp_speed.c* c64_warp_speed.h* c64_xl80.h c64exp.c c64exp.h cbmipt.c cbmipt.h

hash/c64_cart.xml
r14483r14484
969969      <part name="cart" interface="c64_cart">
970970         <feature name="slot" value="stardos" />
971971         <feature name="game" value="1" />
972         <feature name="exrom" value="0" />
972         <feature name="exrom" value="1" />
973973
974         <dataarea name="rom" size="0x4000">
974         <dataarea name="roml" size="0x4000">
975975            <rom name="stardos.bin" size="0x4000" crc="feda3c5d" sha1="8a6851ae17f99d2b76f7548119c20eb7f68326da" offset="0x0000" />
976976         </dataarea>
977977      </part>
r14483r14484
45704570      </part>
45714571   </software>
45724572
4573   <software name="warpspd" supported="no">
4573   <software name="warpspd">
45744574      <description>Warp Speed v2.0</description>
45754575      <year>1988</year>
45764576      <publisher>Cinemaware</publisher>
45774577      <info name="developer" value="Alien Technology" />
4578      <!--
4579      |===================|
4580      |=|             SW1 |
4581      |=|                 |
4582      |=|             SW2 |
4583      |=|                 |
4584      |=|                 |
4585      |=|    ROM          |
4586      |=|            LS109|
4587      |=|                 |
4588      |===================|
4589
4590      ROM     - "DEI-356NR-WRPIIDA1 (C) NCR A8847 609-2415038 F833071" 16Kx8 ROM
4591      SW1     - mode switch (C64/C128)
4592      SW2     - reset button
4593
4594      data = BITSWAP8(data,7,6,5,2,0,1,3,4)
4595      address = BITSWAP14(address,12,13,5,2,7,9,11,10,8,6,4,3,1,0)
4596      -->
45974578      <part name="cart" interface="c64_cart">
45984579         <feature name="slot" value="warp_speed" />
4599         <feature name="game" value="1" />
4600         <feature name="exrom" value="1" />
4580         <feature name="game" value="0" />
4581         <feature name="exrom" value="0" />
46014582         <dataarea name="roml" size="0x4000">
46024583            <rom name="dei-356nr-wrpiida1.u2" size="0x4000" crc="c5dd7720" sha1="062ea091bf085b09ce8ea85a9a498734b9138906" offset="0x0000" />
46034584         </dataarea>
46044585      </part>
46054586   </software>
46064587
4607   <software name="warpspd1" cloneof="warpspd" supported="no">
4588   <software name="warpspd1" cloneof="warpspd">
46084589      <description>Warp Speed v1.0</description>
46094590      <year>1987</year>
46104591      <publisher>Cinemaware</publisher>
46114592      <info name="developer" value="Alien Technology" />
46124593      <part name="cart" interface="c64_cart">
46134594         <feature name="slot" value="warp_speed" />
4614         <feature name="game" value="1" />
4615         <feature name="exrom" value="1" />
4595         <feature name="game" value="0" />
4596         <feature name="exrom" value="0" />
46164597         <dataarea name="roml" size="0x4000">
4617            <rom name="c-64 warpspeed! v1.0 (1987)(alien technology).80" size="0x4000" crc="632aa2d7" sha1="8f4b9954bce6d739cf5dd2fbd402e0ececefd3b5" offset="0x0000" />
4598            <rom name="c-64 warpspeed! v1.0 (1987)(alien technology).80" size="0x4000" crc="986f61b8" sha1="31d7b7f864904deb947db3658d7da691b4db4fc2" offset="0x0000" />
46184599         </dataarea>
46194600      </part>
46204601   </software>
src/mess/machine/cbmipt.c
r14483r14484
11691169   SLOT_INTERFACE("ross", C64_ROSS)
11701170   SLOT_INTERFACE("silverrock", C64_SILVERROCK)
11711171   SLOT_INTERFACE("simons_basic", C64_SIMONS_BASIC)
1172   SLOT_INTERFACE("stardos", C64_STARDOS)
11721173   SLOT_INTERFACE("struct_basic", C64_STRUCTURED_BASIC)
11731174   SLOT_INTERFACE("super_explode", C64_SUPER_EXPLODE)
11741175   SLOT_INTERFACE("super_games", C64_SUPER_GAMES)
11751176   SLOT_INTERFACE("system3", C64_SYSTEM3)
11761177   SLOT_INTERFACE("vizawrite", C64_VW64)
1178   SLOT_INTERFACE("warp_speed", C64_WARP_SPEED)
11771179   SLOT_INTERFACE("westermann", C64_WESTERMANN)
11781180   SLOT_INTERFACE("zaxxon", C64_ZAXXON)
11791181SLOT_INTERFACE_END
src/mess/machine/cbmipt.h
r14483r14484
2525#include "machine/c64_ross.h"
2626#include "machine/c64_silverrock.h"
2727#include "machine/c64_simons_basic.h"
28#include "machine/c64_stardos.h"
2829#include "machine/c64_std.h"
2930#include "machine/c64_structured_basic.h"
3031#include "machine/c64_super_explode.h"
3132#include "machine/c64_super_games.h"
3233#include "machine/c64_system3.h"
3334#include "machine/c64_vw64.h"
35#include "machine/c64_warp_speed.h"
3436#include "machine/c64_westermann.h"
3537#include "machine/c64_xl80.h"
3638#include "machine/c64_zaxxon.h"
src/mess/machine/c64_warp_speed.c
r0r14484
1/**********************************************************************
2 
3    Cinemaware Warp Speed cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10/*
11 
12   PCB Layout
13   ----------
14 
15   |===================|
16   |=|             SW1 |
17   |=|                 |
18   |=|             SW2 |
19   |=|                 |
20   |=|                 |
21   |=|    ROM          |
22   |=|            LS109|
23   |=|                 |
24   |===================|
25 
26   ROM     - "DEI-356NR-WRPIIDA1 (C) NCR A8847 609-2415038 F833071" 16Kx8 ROM
27   SW1     - mode switch (C64/C128)
28   SW2     - reset button
29 
30*/
31 
32#include "c64_warp_speed.h"
33 
34 
35 
36//**************************************************************************
37//  MACROS/CONSTANTS
38//**************************************************************************
39   
40#define UNSCRAMBLE_ADDRESS(_offset) \
41   BITSWAP16(_offset,15,14,12,13,5,2,7,9,11,10,8,6,4,3,1,0)
42 
43#define UNSCRAMBLE_DATA(_data) \
44   BITSWAP8(_data,7,6,5,0,1,4,2,3)
45   
46   
47 
48//**************************************************************************
49//  DEVICE DEFINITIONS
50//**************************************************************************
51 
52const device_type C64_WARP_SPEED = &device_creator<c64_warp_speed_cartridge_device>;
53 
54 
55//-------------------------------------------------
56//  INPUT_PORTS( c64_warp_speed )
57//-------------------------------------------------
58 
59INPUT_CHANGED( c64_warp_speed_cartridge_device::reset )
60{
61   // TODO
62}
63 
64static INPUT_PORTS_START( c64_warp_speed )
65   PORT_START("SW1")
66   PORT_DIPNAME( 0x01, 0x01, "Mode" )
67   PORT_DIPSETTING(    0x01, "C64" )
68   PORT_DIPSETTING(    0x00, "C128" )
69 
70   PORT_START("SW2")
71   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED(c64_warp_speed_cartridge_device::reset, 0)
72INPUT_PORTS_END
73 
74 
75//-------------------------------------------------
76//  input_ports - device-specific input ports
77//-------------------------------------------------
78 
79ioport_constructor c64_warp_speed_cartridge_device::device_input_ports() const
80{
81   return INPUT_PORTS_NAME( c64_warp_speed );
82}
83 
84 
85 
86//**************************************************************************
87//  LIVE DEVICE
88//**************************************************************************
89 
90//-------------------------------------------------
91//  c64_warp_speed_cartridge_device - constructor
92//-------------------------------------------------
93 
94c64_warp_speed_cartridge_device::c64_warp_speed_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
95   device_t(mconfig, C64_WARP_SPEED, "C64 Warp Speed cartridge", tag, owner, clock),
96   device_c64_expansion_card_interface(mconfig, *this)
97{
98}
99 
100 
101//-------------------------------------------------
102//  device_start - device-specific startup
103//-------------------------------------------------
104 
105void c64_warp_speed_cartridge_device::device_start()
106{
107}
108 
109 
110//-------------------------------------------------
111//  device_reset - device-specific reset
112//-------------------------------------------------
113 
114void c64_warp_speed_cartridge_device::device_reset()
115{
116   m_exrom = 0;
117   m_game = 0;
118}
119 
120 
121//-------------------------------------------------
122//  c64_cd_r - cartridge data read
123//-------------------------------------------------
124 
125UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
126{
127   UINT8 data = 0;
128   
129   if (!roml || !romh || !io1 || !io2)
130   {
131      offs_t addr = UNSCRAMBLE_ADDRESS(offset & 0x3fff);
132      data = UNSCRAMBLE_DATA(m_roml[addr]);
133   }
134 
135   return data;
136}
137 
138 
139//-------------------------------------------------
140//  c64_cd_w - cartridge data write
141//-------------------------------------------------
142 
143void c64_warp_speed_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
144{
145   if (!io1)
146   {
147      m_exrom = 0;
148      m_game = 0;
149   }
150   else if (!io2)
151   {
152      m_exrom = 1;
153      m_game = 1;
154   }
155}
src/mess/machine/c64_warp_speed.h
r0r14484
1/**********************************************************************
2 
3    Cinemaware Warp Speed 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 __WARP_SPEED__
13#define __WARP_SPEED__
14 
15#define ADDRESS_MAP_MODERN
16 
17#include "emu.h"
18#include "machine/c64exp.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> c64_warp_speed_cartridge_device
27 
28class c64_warp_speed_cartridge_device : public device_t,
29                              public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_warp_speed_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35   // optional information overrides
36   virtual ioport_constructor device_input_ports() const;
37   
38   static INPUT_CHANGED( reset );
39 
40protected:
41   // device-level overrides
42   virtual void device_start();
43   virtual void device_reset();
44 
45   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
48 
49private:
50   UINT8 m_bank;
51};
52 
53 
54// device type definition
55extern const device_type C64_WARP_SPEED;
56 
57 
58#endif
src/mess/machine/c64_xl80.h
r14483r14484
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(offs_t offset, int ba, int rw) { return 1; }
52   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return 1; }
5353   virtual int c64_exrom_r() { return 0; }
5454
5555private:
src/mess/machine/c64_ieee488.c
r14483r14484
304304//  c64_game_r - GAME read
305305//-------------------------------------------------
306306 
307int c64_ieee488_device::c64_game_r(offs_t offset, int ba, int rw)
307int c64_ieee488_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
308308{
309   return m_exp->game_r(offset, ba, rw);
309   return m_exp->game_r(offset, ba, rw, hiram);
310310}
src/mess/machine/c64_ieee488.h
r14483r14484
5757   // device_c64_expansion_card_interface overrides
5858   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
5959   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
60   virtual int c64_game_r(offs_t offset, int ba, int rw);
60   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
6161 
6262private:
6363   required_device<device_t> m_tpi;
src/mess/machine/c64_stardos.c
r0r14484
1/**********************************************************************
2 
3    StarPoint Software StarDOS cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "c64_stardos.h"
11 
12 
13 
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17 
18#define IO1_FULL_CHARGE      27
19#define IO2_FULL_CHARGE      42
20 
21 
22 
23//**************************************************************************
24//  DEVICE DEFINITIONS
25//**************************************************************************
26 
27const device_type C64_STARDOS = &device_creator<c64_stardos_cartridge_device>;
28 
29 
30//-------------------------------------------------
31//  INPUT_PORTS( c64_stardos )
32//-------------------------------------------------
33 
34INPUT_CHANGED( c64_stardos_cartridge_device::reset )
35{
36   // TODO
37}
38 
39static INPUT_PORTS_START( c64_stardos )
40   PORT_START("RESET")
41   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("Reset") PORT_CHANGED(c64_stardos_cartridge_device::reset, 0)
42INPUT_PORTS_END
43 
44 
45//-------------------------------------------------
46//  input_ports - device-specific input ports
47//-------------------------------------------------
48 
49ioport_constructor c64_stardos_cartridge_device::device_input_ports() const
50{
51   return INPUT_PORTS_NAME( c64_stardos );
52}
53 
54 
55 
56//**************************************************************************
57//  INLINE HELPERS
58//**************************************************************************
59 
60//-------------------------------------------------
61//  charge_io1_capacitor -
62//-------------------------------------------------
63 
64inline void c64_stardos_cartridge_device::charge_io1_capacitor()
65{
66   m_io1_charge++;
67   
68   if (m_io1_charge >= IO1_FULL_CHARGE)
69   {
70      m_exrom = 0;
71      m_io1_charge = 0;
72   }
73}
74 
75 
76//-------------------------------------------------
77//  charge_io2_capacitor -
78//-------------------------------------------------
79 
80void c64_stardos_cartridge_device::charge_io2_capacitor()
81{
82   m_io2_charge++;
83   
84   if (m_io2_charge >= IO2_FULL_CHARGE)
85   {
86      m_exrom = 1;
87      m_io2_charge = 0;
88   }
89}
90 
91 
92 
93//**************************************************************************
94//  LIVE DEVICE
95//**************************************************************************
96 
97//-------------------------------------------------
98//  c64_stardos_cartridge_device - constructor
99//-------------------------------------------------
100 
101c64_stardos_cartridge_device::c64_stardos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
102   device_t(mconfig, C64_STARDOS, "C64 StarDOS cartridge", tag, owner, clock),
103   device_c64_expansion_card_interface(mconfig, *this),
104   m_io1_charge(0),
105   m_io2_charge(0)
106{
107}
108 
109 
110//-------------------------------------------------
111//  device_start - device-specific startup
112//-------------------------------------------------
113 
114void c64_stardos_cartridge_device::device_start()
115{
116   // state saving
117   save_item(NAME(m_io1_charge));
118   save_item(NAME(m_io2_charge));
119}
120 
121 
122//-------------------------------------------------
123//  c64_cd_r - cartridge data read
124//-------------------------------------------------
125 
126UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
127{
128   UINT8 data = 0;
129   
130   if (!roml || !romh)
131   {
132      // TODO BITSWAP8(7,6,5,4,3,1,2,0) ?
133      data = m_roml[offset & 0x3fff];
134   }
135   else if (!io1)
136   {
137      charge_io1_capacitor();
138   }
139   else if (!io2)
140   {
141      charge_io2_capacitor();
142   }
143 
144   return data;
145}
146 
147 
148//-------------------------------------------------
149//  c64_cd_w - cartridge data write
150//-------------------------------------------------
151 
152void c64_stardos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
153{
154   if (!io1)
155   {
156      charge_io1_capacitor();
157   }
158   else if (!io2)
159   {
160      charge_io2_capacitor();
161   }
162}
163 
164 
165//-------------------------------------------------
166//  c64_game_r - GAME read
167//-------------------------------------------------
168 
169int c64_stardos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
170{
171   return !(ba & rw & ((offset & 0xe000) == 0xe000) & hiram);
172}
src/mess/machine/c64_stardos.h
r0r14484
1/**********************************************************************
2 
3    StarPoint Software StarDOS 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 __STARDOS__
13#define __STARDOS__
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_stardos_cartridge_device
28 
29class c64_stardos_cartridge_device : public device_t,
30                            public device_c64_expansion_card_interface
31{
32public:
33   // construction/destruction
34   c64_stardos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35 
36   // optional information overrides
37   virtual ioport_constructor device_input_ports() const;
38   
39   static INPUT_CHANGED( reset );
40 
41protected:
42   // device-level overrides
43   virtual void device_start();
44 
45   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
48   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
49   
50private:
51   inline void charge_io1_capacitor();
52   inline void charge_io2_capacitor();
53   
54   int m_io1_charge;
55   int m_io2_charge;
56};
57 
58 
59// device type definition
60extern const device_type C64_STARDOS;
61 
62 
63#endif
src/mess/machine/c64_easyflash.c
r14483r14484
227227//  c64_game_r - GAME read
228228//-------------------------------------------------
229229 
230int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int ba, int rw)
230int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
231231{
232232   return !(BIT(m_mode, 0) | !(BIT(m_mode, 2) | input_port_read(device(), "JP1")));
233233}
src/mess/machine/c64_easyflash.h
r14483r14484
1717#include "emu.h"
1818#include "machine/c64exp.h"
1919#include "machine/intelfsh.h"
20#include "machine/nvram.h"
2120 
2221 
2322 
r14483r14484
4948   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
5049   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
5150   virtual int c64_exrom_r();
52   virtual int c64_game_r(offs_t offset, int ba, int rw);
51   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
5352 
5453private:
5554   required_device<amd_29f040_device> m_flash_roml;
src/mess/machine/c64_magic_formel.c
r14483r14484
273273//  c64_game_r - GAME read
274274//-------------------------------------------------
275275 
276int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int ba, int rw)
276int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
277277{
278278   return !(ba & rw & ((offset & 0xe000) == 0xe000) & !(m_pb7 & m_cb2_ff));
279279}
src/mess/machine/c64_magic_formel.h
r14483r14484
5252   // device_c64_expansion_card_interface overrides
5353   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
5454   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);
55   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
5656   
5757private:
5858   required_device<pia6821_device> m_pia;
src/mess/machine/c64exp.c
r14483r14484
1010#include "emu.h"
1111#include "emuopts.h"
1212#include "machine/c64exp.h"
13#include "formats/cbm_crt.h"
1314
1415
1516
r14483r14484
313314//  game_r - GAME read
314315//-------------------------------------------------
315316
316int c64_expansion_slot_device::game_r(offs_t offset, int ba, int rw)
317int c64_expansion_slot_device::game_r(offs_t offset, int ba, int rw, int hiram)
317318{
318319   int state = 1;
319320
320321   if (m_cart != NULL)
321322   {
322      state = m_cart->c64_game_r(offset, ba, rw);
323      state = m_cart->c64_game_r(offset, ba, rw, hiram);
323324   }
324325
325326   return state;
src/mess/machine/c64exp.h
r14483r14484
9595
9696   UINT8 cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
9797   void cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
98   int game_r(offs_t offset, int ba, int rw);
98   int game_r(offs_t offset, int ba, int rw, int hiram);
9999   DECLARE_READ_LINE_MEMBER( exrom_r );
100100
101101   DECLARE_WRITE_LINE_MEMBER( irq_w );
r14483r14484
151151   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2) { };
152152
153153   // memory banking
154   virtual int c64_game_r(offs_t offset, int ba, int rw) { return m_game; }
154   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return m_game; }
155155   virtual int c64_exrom_r() { return m_exrom; }
156156   virtual void c64_game_w(int state) { m_game = state; }
157157   virtual void c64_exrom_w(int state) { m_exrom = state; }
src/mess/formats/cbm_crt.c
r0r14484
1/*********************************************************************
2 
3    formats/cbm_crt.c
4 
5    Commodore VIC-20/C64 cartridge images
6 
7*********************************************************************/
8 
9#include "formats/cbm_crt.h"
src/mess/formats/cbm_crt.h
r0r14484
1/*********************************************************************
2 
3    formats/cbm_crt.h
4 
5    Commodore VIC-20/C64 cartridge images
6 
7*********************************************************************/
8 
9#pragma once
10 
11#ifndef __CBM_CRT__
12#define __CBM_CRT__
13 
14#include "emu.h"
15 
16 
17 
18//**************************************************************************
19//  MACROS/CONSTANTS
20//**************************************************************************
21 
22#define CRT_HEADER_LENGTH   0x40
23#define CRT_CHIP_LENGTH      0x10
24 
25#define UNSUPPORTED       "standard"
26 
27 
28// VIC-20 cartridge types
29enum
30{
31   CRT_VIC20_STANDARD = 1,
32   CRT_VIC20_MEGACART,
33   CRT_VIC20_FINAL_EXPANSION,
34   CRT_VIC20_FP,
35   _CRT_VIC20_COUNT
36};
37 
38 
39// slot names for the VIC-20 cartridge types
40const char *CRT_VIC20_SLOT_NAMES[_CRT_VIC20_COUNT] = 
41{
42   UNSUPPORTED,
43   "standard",
44   UNSUPPORTED,
45   UNSUPPORTED,
46   UNSUPPORTED
47};
48 
49 
50// C64 cartridge types
51enum
52{
53   CRT_C64_STANDARD = 0,
54   CRT_C64_ACTION_REPLAY,
55   CRT_C64_KCS_POWER,
56   CRT_C64_FINAL_III,
57   CRT_C64_SIMONS_BASIC,
58   CRT_C64_OCEAN,
59   CRT_C64_EXPERT,
60   CRT_C64_FUNPLAY,
61   CRT_C64_SUPER_GAMES,
62   CRT_C64_ATOMIC_POWER,
63   CRT_C64_EPYX_FASTLOAD,
64   CRT_C64_WESTERMANN,
65   CRT_C64_REX,
66   CRT_C64_FINAL_I,
67   CRT_C64_MAGIC_FORMEL,
68   CRT_C64_GS,
69   CRT_C64_WARPSPEED,
70   CRT_C64_DINAMIC,
71   CRT_C64_ZAXXON,
72   CRT_C64_MAGIC_DESK,
73   CRT_C64_SUPER_SNAPSHOT_V5,
74   CRT_C64_COMAL80,
75   CRT_C64_STRUCTURED_BASIC,
76   CRT_C64_ROSS,
77   CRT_C64_DELA_EP64,
78   CRT_C64_DELA_EP7x8,
79   CRT_C64_DELA_EP256,
80   CRT_C64_REX_EP256,
81   CRT_C64_MIKRO_ASSEMBLER,
82   CRT_C64_FINAL_PLUS,
83   CRT_C64_ACTION_REPLAY4,
84   CRT_C64_STARDOS,
85   CRT_C64_EASYFLASH,
86   CRT_C64_EASYFLASH_XBANK,
87   CRT_C64_CAPTURE,
88   CRT_C64_ACTION_REPLAY3,
89   CRT_C64_RETRO_REPLAY,
90   CRT_C64_MMC64,
91   CRT_C64_MMC_REPLAY,
92   CRT_C64_IDE64,
93   CRT_C64_SUPER_SNAPSHOT,
94   CRT_C64_IEEE488,
95   CRT_C64_GAME_KILLER,
96   CRT_C64_P64,
97   _CRT_C64_COUNT
98};
99 
100 
101// slot names for the C64 cartridge types
102const char *CRT_C64_SLOT_NAMES[_CRT_C64_COUNT] = 
103{
104   "standard",
105   UNSUPPORTED,
106   UNSUPPORTED,
107   UNSUPPORTED,
108   "simons_basic",
109   "ocean",
110   UNSUPPORTED,
111   "fun_play",
112   "super_games",
113   UNSUPPORTED,
114   "epyxfastload",
115   "westermann",
116   "rex",
117   UNSUPPORTED,
118   "magic_formel",
119   "system3",
120   "warp_speed",
121   "dinamic",
122   "zaxxon",
123   "magic desk",
124   UNSUPPORTED,
125   "comal80",
126   "struct_basic",
127   "ross",
128   "ep64",
129   "ep7x8",
130   "dela_ep256",
131   "rex_ep256",
132   "mikroasm",
133   UNSUPPORTED,
134   UNSUPPORTED,
135   "stardos",
136   UNSUPPORTED,
137   UNSUPPORTED,
138   UNSUPPORTED,
139   UNSUPPORTED,
140   UNSUPPORTED,
141   UNSUPPORTED,
142   UNSUPPORTED,
143   UNSUPPORTED,
144   UNSUPPORTED,
145   "ieee488",
146   UNSUPPORTED,
147   UNSUPPORTED
148};
149 
150 
151 
152//**************************************************************************
153//  TYPE DEFINITIONS
154//**************************************************************************
155 
156typedef struct _cbm_crt_header cbm_crt_header;
157struct _cbm_crt_header
158{
159   UINT8 signature[16];
160   UINT8 header_length[4];
161   UINT8 version[2];
162   UINT8 hardware[2];
163   UINT8 exrom;
164   UINT8 game;
165   UINT8 reserved[6];
166   UINT8 name[32];
167};
168 
169 
170typedef struct _cbm_crt_chip cbm_crt_chip;
171struct _cbm_crt_chip
172{
173   UINT8 signature[4];
174   UINT8 packet_length[4];
175   UINT8 chip_type[2];
176   UINT8 bank[2];
177   UINT8 start_address[2];
178   UINT8 image_size[2];
179};
180 
181 
182#endif
src/mess/mess.mak
r14483r14484
775775   $(MESS_MACHINE)/c64_ross.o   \
776776   $(MESS_MACHINE)/c64_silverrock.o   \
777777   $(MESS_MACHINE)/c64_simons_basic.o   \
778   $(MESS_MACHINE)/c64_stardos.o   \
778779   $(MESS_MACHINE)/c64_std.o   \
779780   $(MESS_MACHINE)/c64_structured_basic.o   \
780781   $(MESS_MACHINE)/c64_super_explode.o   \
781782   $(MESS_MACHINE)/c64_super_games.o   \
782783   $(MESS_MACHINE)/c64_system3.o   \
783784   $(MESS_MACHINE)/c64_vw64.o   \
785   $(MESS_MACHINE)/c64_warp_speed.o   \
784786   $(MESS_MACHINE)/c64_westermann.o   \
785787   $(MESS_MACHINE)/c64_xl80.o   \
786788   $(MESS_MACHINE)/c64_zaxxon.o   \
r14483r14484
826828   $(MESS_VIDEO)/vic6567.o      \
827829   $(MESS_VIDEO)/vic4567.o      \
828830   $(MESS_FORMATS)/cbm_snqk.o   \
831   $(MESS_FORMATS)/cbm_crt.o   \
829832
830833$(MESSOBJ)/cccp.a:            \
831834   $(MESS_DRIVERS)/argo.o      \
src/mess/drivers/c64.c
r14483r14484
6060
6161void 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)
6262{
63   int game = m_exp->game_r(offset, rw, ba);
63   int game = m_exp->game_r(offset, rw, ba, m_hiram);
6464   int exrom = m_exp->exrom_r();
6565
6666   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;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team