Previous 15994 Revisions Next

r14406 Thursday 9th February, 2012 at 19:29:16 UTC by Curt Coder
[C64] Re-added support for Easy Calc Result, Multiscreen, Pagefox and Simons' BASIC cartridges. (nw)
[hash]c64_cart.xml vic10.xml
[src/mess]mess.mak
[src/mess/drivers]c64.c
[src/mess/machine]c64_easy_calc_result.c* c64_easy_calc_result.h* c64_multiscreen.c* c64_multiscreen.h* c64_pagefox.c* c64_pagefox.h* c64_simons_basic.c* c64_simons_basic.h* c64_super_explode.c c64_vw64.c c64exp.c c64exp.h cbmipt.c cbmipt.h

hash/vic10.xml
r14405r14406
133133         <feature name="exrom" value="1" />
134134
135135         <dataarea name="lorom" size="0x2000">
136            <rom name="basic.80" size="0x2000" crc="489aab86" sha1="448e0403baed7fcdc3be6ce8497958beaf3b4566" offset="0x0000" />
136            <rom name="901230-01" size="0x2000" crc="489aab86" sha1="448e0403baed7fcdc3be6ce8497958beaf3b4566" offset="0x0000" />
137137         </dataarea>
138138         <dataarea name="uprom" size="0x2000">
139            <rom name="basic.e0" size="0x2000" crc="caac20ff" sha1="f31ba36a5f8fca7722d4b482716166b578301ed4" offset="0x0000" />
139            <rom name="901231-01" size="0x2000" crc="caac20ff" sha1="f31ba36a5f8fca7722d4b482716166b578301ed4" offset="0x0000" />
140140         </dataarea>
141141         <dataarea name="exram" size="0x800" />
142142      </part>
hash/c64_cart.xml
r14405r14406
266266         <feature name="game" value="0" />
267267         <feature name="exrom" value="0" />
268268
269         <dataarea name="rom" size="0x10000">
269         <dataarea name="roml" size="0x10000">
270270            <rom name="u1.bin" size="0x8000" crc="dd6c545a" sha1="d32005405cb944f77932901916608232e3c05a42" offset="0x0000" />
271271            <rom name="u2.bin" size="0x8000" crc="3dc43ab1" sha1="1a21771e7bf61ca1771de450c8230bd5ac46b1c6" offset="0x8000" />
272272         </dataarea>
r14405r14406
295295      ROM1  - Hitachi HN613128P 16Kx8 EPROM "CR3001"
296296      -->
297297      <part name="cart" interface="c64_cart">
298         <feature name="slot" value="easy_calc_result" />
298         <feature name="slot" value="easycalcres" />
299299         <feature name="game" value="0" />
300300         <feature name="exrom" value="0" />
301301
r14405r14406
316316      <!--
317317      -->
318318      <part name="cart" interface="c64_cart">
319         <feature name="slot" value="easy_calc_result" />
319         <feature name="slot" value="easycalcres" />
320320         <feature name="game" value="0" />
321321         <feature name="exrom" value="0" />
322322
r14405r14406
422422         <feature name="exrom" value="0" />
423423         <feature name="battery" value="CR2325" />
424424
425         <dataarea name="roml" size="0x4000">
426            <rom name="cart-1.bin" size="0x4000" crc="a0dc670c" sha1="bbee117340477a7416bba2e9abc2b8debd940cd4" offset="0x0000" />
425         <dataarea name="roml" size="0x34000">
426            <rom name="cart-1.bin" size="0x4000" crc="a0dc670c" sha1="bbee117340477a7416bba2e9abc2b8debd940cd4" offset="0x00000" />
427            <rom name="cart-2.bin" size="0x8000" crc="2abaad8e" sha1="897f98e954418e2e9313f219cd64b100c60c68b1" offset="0x04000" />
428            <rom name="cart-3.bin" size="0x8000" crc="ecddbbfc" sha1="70c72b77dc3981be8bcbec9ba0cc38d9aa5936fd" offset="0x0c000" />
429            <rom name="cart-4.bin" size="0x8000" crc="042678ef" sha1="ff2582c617f72bf57be7d76bcf8270665144f924" offset="0x14000" />
427430         </dataarea>
428431
429         <dataarea name="rom" size="0x30000">
430            <rom name="cart-2.bin" size="0x8000" crc="2abaad8e" sha1="897f98e954418e2e9313f219cd64b100c60c68b1" offset="0x0000" />
431            <rom name="cart-3.bin" size="0x8000" crc="ecddbbfc" sha1="70c72b77dc3981be8bcbec9ba0cc38d9aa5936fd" offset="0x4000" />
432            <rom name="cart-4.bin" size="0x8000" crc="042678ef" sha1="ff2582c617f72bf57be7d76bcf8270665144f924" offset="0x8000" />
433         </dataarea>
434
435432         <dataarea name="ram" size="0x2000" />
436433      </part>
437434      <!--
r14405r14406
50145011         <feature name="game" value="1" />
50155012         <feature name="exrom" value="0" />
50165013         <dataarea name="roml" size="0x2000">
5017            <rom name="simons' basic (198x)(commodore).80" size="0x2000" crc="3117d4ee" sha1="9a67cc6d01939eae6f9fd141a6d963259820335d" offset="0x0000" />
5014            <rom name="317008-02" size="0x2000" crc="3117d4ee" sha1="9a67cc6d01939eae6f9fd141a6d963259820335d" offset="0x0000" />
50185015         </dataarea>
50195016         <dataarea name="romh" size="0x2000">
5020            <rom name="simons' basic (198x)(commodore).a0" size="0x2000" crc="23f1bd02" sha1="2a103fb2f5f2895af79e235c75393e96d213eaa9" offset="0x0000" />
5017            <rom name="317009-02" size="0x2000" crc="23f1bd02" sha1="2a103fb2f5f2895af79e235c75393e96d213eaa9" offset="0x0000" />
50215018         </dataarea>
50225019      </part>
50235020   </software>
src/mess/machine/cbmipt.c
r14405r14406
11441144
11451145SLOT_INTERFACE_START( c64_expansion_cards )
11461146   SLOT_INTERFACE("standard", C64_STD)
1147   SLOT_INTERFACE("easycalcres", C64_EASY_CALC_RESULT)
1148   SLOT_INTERFACE("multiscreen", C64_MULTISCREEN)
1149   SLOT_INTERFACE("pagefox", C64_PAGEFOX)
11471150   SLOT_INTERFACE("silverrock", C64_SILVERROCK)
1151   SLOT_INTERFACE("simons_basic", C64_SIMONS_BASIC)
11481152   SLOT_INTERFACE("super_explode", C64_SUPER_EXPLODE)
11491153   SLOT_INTERFACE("vizawrite", C64_VW64)
11501154   SLOT_INTERFACE("xl80", C64_XL80)
src/mess/machine/cbmipt.h
r14405r14406
33#ifndef CBMIPT_H_
44#define CBMIPT_H_
55
6#include "machine/c64_easy_calc_result.h"
7#include "machine/c64_multiscreen.h"
8#include "machine/c64_pagefox.h"
69#include "machine/c64_silverrock.h"
10#include "machine/c64_simons_basic.h"
711#include "machine/c64_std.h"
812#include "machine/c64_super_explode.h"
913#include "machine/c64_vw64.h"
src/mess/machine/c64_pagefox.c
r0r14406
1/**********************************************************************
2 
3    Scanntronik Pagefox 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   |=|                         |
17   |=|     RAM         LS11    |
18   |=|                         |
19   |=|                 LS139   |
20   |=|     ROM0                |
21   |=|                 LS273   |
22   |=|                         |
23   |=|     ROM1        LS00    |
24   |===========================|
25 
26   RAM   - NEC D43256-12L 32Kx8 RAM
27   ROM0  - SGS M27256-2FI 32Kx8 EPROM
28   ROM1  - National Instruments NMC27C256Q 32Kx8 EPROM
29 
30*/
31 
32#include "c64_pagefox.h"
33 
34 
35 
36//**************************************************************************
37//  DEVICE DEFINITIONS
38//**************************************************************************
39 
40const device_type C64_PAGEFOX = &device_creator<c64_pagefox_cartridge_device>;
41 
42 
43 
44//**************************************************************************
45//  LIVE DEVICE
46//**************************************************************************
47 
48//-------------------------------------------------
49//  c64_pagefox_cartridge_device - constructor
50//-------------------------------------------------
51 
52c64_pagefox_cartridge_device::c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
53   device_t(mconfig, C64_PAGEFOX, "C64 Pagefox cartridge", tag, owner, clock),
54   device_c64_expansion_card_interface(mconfig, *this)
55{
56}
57 
58 
59//-------------------------------------------------
60//  device_start - device-specific startup
61//-------------------------------------------------
62 
63void c64_pagefox_cartridge_device::device_start()
64{
65   // state saving
66   save_item(NAME(m_bank));
67}
68 
69 
70//-------------------------------------------------
71//  device_reset - device-specific reset
72//-------------------------------------------------
73 
74void c64_pagefox_cartridge_device::device_reset()
75{
76   m_bank = 0;
77}
78 
79 
80//-------------------------------------------------
81//  c64_cd_r - cartridge data read
82//-------------------------------------------------
83 
84UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
85{
86   UINT8 data = 0;
87   
88   if (!roml || !romh)
89   {
90      if (BIT(m_bank, 3))
91      {
92         offs_t addr = (BIT(m_bank, 1) << 14) | (offset & 0x3fff);
93         data = m_ram[addr];
94      }
95      else
96      {
97         int bank = (m_bank >> 1) & 0x07;
98         offs_t addr = (bank << 14) | (offset & 0x3fff);
99         data = m_roml[addr];
100      }
101   }
102 
103   return data;
104}
105 
106 
107//-------------------------------------------------
108//  c64_cd_w - cartridge data write
109//-------------------------------------------------
110 
111void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
112{
113   if (offset >= 0x8000 && offset < 0xc000)
114   {
115      if (BIT(m_bank, 3))
116      {
117         offs_t addr = (BIT(m_bank, 1) << 14) | (offset & 0x3fff);
118         m_ram[addr] = data;
119      }
120   }
121   else if (!io1 && BIT(offset, 7))
122   {
123      if (data == 0xff)
124      {
125         m_game = 1;
126         m_exrom = 1;
127      }
128      else
129      {
130         m_game = 0;
131         m_exrom = 0;
132      }
133       
134      m_bank = data;
135   }
136}
src/mess/machine/c64_pagefox.h
r0r14406
1/**********************************************************************
2 
3    Scanntronik Pagefox 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 __PAGEFOX__
13#define __PAGEFOX__
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_pagefox_cartridge_device
27 
28class c64_pagefox_cartridge_device : public device_t,
29                            public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_pagefox_cartridge_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   virtual void device_reset();
39 
40   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
43 
44private:
45   UINT8 m_bank;
46};
47 
48 
49// device type definition
50extern const device_type C64_PAGEFOX;
51 
52 
53#endif
src/mess/machine/c64_simons_basic.c
r0r14406
1/**********************************************************************
2 
3    VizaWrite 64 cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "c64_simons_basic.h"
11 
12 
13 
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17 
18const device_type C64_SIMONS_BASIC = &device_creator<c64_simons_basic_cartridge_device>;
19 
20 
21 
22//**************************************************************************
23//  LIVE DEVICE
24//**************************************************************************
25 
26//-------------------------------------------------
27//  c64_simons_basic_cartridge_device - constructor
28//-------------------------------------------------
29 
30c64_simons_basic_cartridge_device::c64_simons_basic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
31   device_t(mconfig, C64_SIMONS_BASIC, "Simons' BASIC", tag, owner, clock),
32   device_c64_expansion_card_interface(mconfig, *this)
33{
34}
35 
36 
37//-------------------------------------------------
38//  device_start - device-specific startup
39//-------------------------------------------------
40 
41void c64_simons_basic_cartridge_device::device_start()
42{
43}
44 
45 
46//-------------------------------------------------
47//  device_reset - device-specific reset
48//-------------------------------------------------
49 
50void c64_simons_basic_cartridge_device::device_reset()
51{
52   m_game = 1;
53}
54 
55 
56//-------------------------------------------------
57//  c64_cd_r - cartridge data read
58//-------------------------------------------------
59 
60UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
61{
62   UINT8 data = 0;
63 
64   if (!roml)
65   {
66      data = m_roml[offset & 0x1fff];
67   }
68   else if (!romh)
69   {
70      data = m_romh[offset & 0x1fff];
71   }
72   
73   return data;
74}
75 
76 
77//-------------------------------------------------
78//  c64_cd_w - cartridge data write
79//-------------------------------------------------
80 
81void c64_simons_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
82{
83   if (!io1)
84   {
85      m_game = !BIT(data, 0);
86   }
87}
src/mess/machine/c64_simons_basic.h
r0r14406
1/**********************************************************************
2 
3    Simons' BASIC 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 __SIMONS_BASIC__
13#define __SIMONS_BASIC__
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_simons_basic_cartridge_device
27 
28class c64_simons_basic_cartridge_device : public device_t,
29                                public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_simons_basic_cartridge_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   virtual void device_reset();
39 
40   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
43};
44 
45 
46// device type definition
47extern const device_type C64_SIMONS_BASIC;
48 
49 
50#endif
src/mess/machine/c64_vw64.c
r14405r14406
3838//**************************************************************************
3939//  MACROS/CONSTANTS
4040//**************************************************************************
41   
41
4242#define UNSCRAMBLE_ADDRESS(_offset) \
4343   BITSWAP16(_offset,15,14,13,12,6,2,8,10,11,9,7,5,4,3,1,0)
4444 
src/mess/machine/c64_multiscreen.c
r0r14406
1/**********************************************************************
2 
3    Multiscreen 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               |           ROM6    |
17               |  MC14066          |
18               |                   |
19   |===============|           ROM5    |
20   |=|                                 |
21   |=|                                 |
22   |=|    RAM         BAT      ROM4    |
23   |=|                                 |
24   |=|                                 |
25   |=|    ROM0                 ROM3    |
26   |=|                                 |
27   |=|                                 |
28   |===============|  LS138    ROM2    |
29               |  LS138            |
30               |  LS174            |
31               |  LS133    ROM1    |
32               |===================|
33 
34   BAT   - BR2325 lithium battery
35   RAM   - ? 8Kx8 RAM
36   ROM0  - ? 16Kx8 EPROM
37   ROM1  - ? 32Kx8 EPROM
38   ROM2  - ? 32Kx8 EPROM
39   ROM3  - ? 32Kx8 EPROM
40   ROM4  - not populated
41   ROM5  - not populated
42   ROM6  - not populated
43 
44*/
45 
46/*
47 
48   TODO:
49   
50   - M6802 board
51 
52*/
53 
54#include "c64_multiscreen.h"
55 
56 
57 
58//**************************************************************************
59//  MACROS/CONSTANTS
60//**************************************************************************
61 
62#define BANK_RAM   0x0d
63 
64 
65 
66//**************************************************************************
67//  DEVICE DEFINITIONS
68//**************************************************************************
69 
70const device_type C64_MULTISCREEN = &device_creator<c64_multiscreen_cartridge_device>;
71 
72 
73 
74//**************************************************************************
75//  LIVE DEVICE
76//**************************************************************************
77 
78//-------------------------------------------------
79//  c64_multiscreen_cartridge_device - constructor
80//-------------------------------------------------
81 
82c64_multiscreen_cartridge_device::c64_multiscreen_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
83   device_t(mconfig, C64_MULTISCREEN, "C64 Multiscreen cartridge", tag, owner, clock),
84   device_c64_expansion_card_interface(mconfig, *this)
85{
86}
87 
88 
89//-------------------------------------------------
90//  device_start - device-specific startup
91//-------------------------------------------------
92 
93void c64_multiscreen_cartridge_device::device_start()
94{
95   // state saving
96   save_item(NAME(m_bank));
97}
98 
99 
100//-------------------------------------------------
101//  device_reset - device-specific reset
102//-------------------------------------------------
103 
104void c64_multiscreen_cartridge_device::device_reset()
105{
106   m_bank = 0;
107}
108 
109 
110//-------------------------------------------------
111//  c64_cd_r - cartridge data read
112//-------------------------------------------------
113 
114UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
115{
116   UINT8 data = 0;
117   
118   if (!roml)
119   {
120      int bank = m_bank & 0x0f;
121 
122      if (bank == BANK_RAM)
123      {
124         data = m_ram[offset & 0x1fff];
125      }
126      else
127      {
128         data = m_roml[(bank << 14) | (offset & 0x3fff)];
129      }
130   }
131   else if (!romh)
132   {
133      int bank = m_bank & 0x0f;
134       
135      if (bank == BANK_RAM)
136      {
137         data = m_roml[offset & 0x3fff];
138      }
139      else
140      {
141         data = m_roml[(bank << 14) | (offset & 0x3fff)];
142      }
143   }
144 
145   return data;
146}
147 
148 
149//-------------------------------------------------
150//  c64_cd_w - cartridge data write
151//-------------------------------------------------
152 
153void c64_multiscreen_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
154{
155   if (offset >= 0x8000 && offset < 0xa000)
156   {
157      int bank = m_bank & 0x0f;
158       
159      if (bank == BANK_RAM)
160      {
161         m_ram[offset & 0x1fff] = data;
162      }
163   }
164   else if (!io2)
165   {
166      m_bank = data;
167   }
168}
src/mess/machine/c64_multiscreen.h
r0r14406
1/**********************************************************************
2 
3    Multiscreen 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 __MULTISCREEN__
13#define __MULTISCREEN__
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_multiscreen_cartridge_device
27 
28class c64_multiscreen_cartridge_device : public device_t,
29                               public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_multiscreen_cartridge_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   virtual void device_reset();
39 
40   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
43 
44private:
45   UINT8 m_bank;
46};
47 
48 
49// device type definition
50extern const device_type C64_MULTISCREEN;
51 
52 
53#endif
src/mess/machine/c64_easy_calc_result.c
r0r14406
1/**********************************************************************
2 
3    Easy Calc Result cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "c64_easy_calc_result.h"
11 
12 
13 
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17 
18const device_type C64_EASY_CALC_RESULT = &device_creator<c64_easy_calc_result_cartridge_device>;
19 
20 
21 
22//**************************************************************************
23//  LIVE DEVICE
24//**************************************************************************
25 
26//-------------------------------------------------
27//  c64_easy_calc_result_cartridge_device - constructor
28//-------------------------------------------------
29 
30c64_easy_calc_result_cartridge_device::c64_easy_calc_result_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
31   device_t(mconfig, C64_EASY_CALC_RESULT, "C64 Easy Calc Result cartridge", tag, owner, clock),
32   device_c64_expansion_card_interface(mconfig, *this)
33{
34}
35 
36 
37//-------------------------------------------------
38//  device_start - device-specific startup
39//-------------------------------------------------
40 
41void c64_easy_calc_result_cartridge_device::device_start()
42{
43   // state saving
44   save_item(NAME(m_bank));
45}
46 
47 
48//-------------------------------------------------
49//  device_reset - device-specific reset
50//-------------------------------------------------
51 
52void c64_easy_calc_result_cartridge_device::device_reset()
53{
54   m_bank = 0;
55}
56 
57 
58//-------------------------------------------------
59//  c64_cd_r - cartridge data read
60//-------------------------------------------------
61 
62UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
63{
64   UINT8 data = 0;
65   
66   if (!roml)
67   {
68      data = m_roml[offset & 0x1fff];
69   }
70   else if (!romh)
71   {
72      data = m_romh[(m_bank << 13) | (offset & 0x1fff)];
73   }
74 
75   return data;
76}
77 
78 
79//-------------------------------------------------
80//  c64_cd_w - cartridge data write
81//-------------------------------------------------
82 
83void c64_easy_calc_result_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
84{
85   if (!io1)
86   {
87      m_bank = !BIT(offset, 0);
88   }
89}
src/mess/machine/c64_easy_calc_result.h
r0r14406
1/**********************************************************************
2 
3    Easy Calc Result 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 __EASY_CALC_RESULT__
13#define __EASY_CALC_RESULT__
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_easy_calc_result_cartridge_device
27 
28class c64_easy_calc_result_cartridge_device : public device_t,
29                                   public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_easy_calc_result_cartridge_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   virtual void device_reset();
39 
40   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
43 
44private:
45   int m_bank;
46};
47 
48 
49// device type definition
50extern const device_type C64_EASY_CALC_RESULT;
51 
52 
53#endif
src/mess/machine/c64exp.c
r14405r14406
1212#include "machine/c64exp.h"
1313
1414
15
1516//**************************************************************************
16//  GLOBAL VARIABLES
17//  DEVICE DEFINITIONS
1718//**************************************************************************
1819
1920const device_type C64_EXPANSION_SLOT = &device_creator<c64_expansion_slot_device>;
2021
2122
23
2224//**************************************************************************
2325//  DEVICE C64_EXPANSION CARD INTERFACE
2426//**************************************************************************
r14405r14406
3133   : device_slot_card_interface(mconfig, device),
3234     m_roml(NULL),
3335     m_romh(NULL),
36     m_ram(NULL),
3437     m_game(1),
3538     m_exrom(1)
3639{
r14405r14406
7780}
7881
7982
83//-------------------------------------------------
84//  c64_ram_pointer - get RAM pointer
85//-------------------------------------------------
8086
87UINT8* device_c64_expansion_card_interface::c64_ram_pointer(running_machine &machine, size_t size)
88{
89   if (m_ram == NULL)
90   {
91      m_ram = auto_alloc_array(machine, UINT8, size);
92   }
93
94   return m_ram;
95}
96
97
98
8199//**************************************************************************
82100//  LIVE DEVICE
83101//**************************************************************************
r14405r14406
219237           
220238            size = get_software_region_length("romh");
221239            if (size) memcpy(m_cart->c64_romh_pointer(machine(), size), get_software_region("romh"), size);
240
241            size = get_software_region_length("ram");
242            if (size) memset(m_cart->c64_ram_pointer(machine(), size), 0, size);
222243         }
223244
224245         m_cart->c64_game_w(atol(get_feature("game")));
r14405r14406
253274
254275
255276//-------------------------------------------------
277//  read -
278//-------------------------------------------------
279
280READ8_MEMBER( c64_expansion_slot_device::read )
281{
282   UINT8 data = 0;
283
284   if (m_cart != NULL)
285   {
286      data = m_cart->c64_cd_r(space, offset, 1, 1, 1, 1);
287   }
288
289   return data;
290}
291
292
293//-------------------------------------------------
294//  write -
295//-------------------------------------------------
296
297WRITE8_MEMBER( c64_expansion_slot_device::write )
298{
299   if (m_cart != NULL)
300   {
301      m_cart->c64_cd_w(space, offset, data, 1, 1, 1, 1);
302   }
303}
304
305
306//-------------------------------------------------
256307//  roml_r - low ROM read
257308//-------------------------------------------------
258309
src/mess/machine/c64exp.h
r14405r14406
9393   c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
9494   virtual ~c64_expansion_slot_device();
9595
96   DECLARE_READ8_MEMBER( read );
97   DECLARE_WRITE8_MEMBER( write );
9698   DECLARE_READ8_MEMBER( roml_r );
9799   DECLARE_READ8_MEMBER( romh_r );
98100   DECLARE_READ8_MEMBER( io1_r );
r14405r14406
169171   // standard ROM cartridge
170172   virtual UINT8* c64_roml_pointer(running_machine &machine, size_t size);
171173   virtual UINT8* c64_romh_pointer(running_machine &machine, size_t size);
174   virtual UINT8* c64_ram_pointer(running_machine &machine, size_t size);
172175
173176protected:
174177   c64_expansion_slot_device *m_slot;
175178
176179   UINT8 *m_roml;
177180   UINT8 *m_romh;
181   UINT8 *m_ram;
178182
179183   int m_game;
180184   int m_exrom;
src/mess/machine/c64_super_explode.c
r14405r14406
103103   }
104104   else if (!io2)
105105   {
106      data = m_roml[offset & 0x1fff];
106      data = m_roml[(m_bank << 13) | (offset & 0x1fff)];
107107   }
108108 
109109   return data;
src/mess/mess.mak
r14405r14406
753753   $(MESS_DRIVERS)/c64dtv.o   \
754754   $(MESS_MACHINE)/c64exp.o   \
755755   $(MESS_MACHINE)/c64user.o   \
756   $(MESS_MACHINE)/c64_easy_calc_result.o   \
757   $(MESS_MACHINE)/c64_multiscreen.o   \
758   $(MESS_MACHINE)/c64_pagefox.o   \
756759   $(MESS_MACHINE)/c64_silverrock.o   \
760   $(MESS_MACHINE)/c64_simons_basic.o   \
757761   $(MESS_MACHINE)/c64_std.o   \
758762   $(MESS_MACHINE)/c64_super_explode.o   \
759763   $(MESS_MACHINE)/c64_vw64.o   \
src/mess/drivers/c64.c
r14405r14406
33    TODO:
44
55    - 64C PLA dump
6    - cartridge loading
6   - clean up inputs
7   - Pagefox boots to BASIC because it thinks the C= key is depressed
8   
9      8035: lda  $DC01
10      8038: and  #$10
11      803A: beq  $8042
12      8042: jmp  ($A000) <-- boot to BASIC
13   
14   - Multiscreen crashes on boot
15   
16      805A: lda  $01
17      805C: and  #$FE
18      805E: sta  $01
19      8060: m6502_brk#$00 <-- BOOM!
720
821*/
922
r14405r14406
178191   if (!casram)
179192   {
180193      m_ram->pointer()[offset] = data;
194     
195      if (offset >= 0x8000 && offset < 0xc000)
196      {
197         m_exp->write(space, offset, data);
198      }
181199   }
182200   else if (!io)
183201   {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team