Previous 15994 Revisions Next

r15289 Wednesday 23rd May, 2012 at 20:04:13 UTC by Curt Coder
[C64] Added a 16KB EPROM cartridge, to which you can map your own ROMs either to ROML, ROMH, or both. E.g. "mess c64p -exp 16k -cart2 roml.bin -cart3 romh.bin". The cartridge can operate in 8KB/16KB or Ultimax mode. [Curt Coder]
[src/mess]mess.mak
[src/mess/machine]c64_16kb.c* c64_16kb.h* cbmipt.c cbmipt.h

src/mess/machine/cbmipt.c
r15288r15289
11311131SLOT_INTERFACE_END
11321132
11331133SLOT_INTERFACE_START( vic20_expansion_cards )
1134   SLOT_INTERFACE("standard", VIC20_STD)
11351134   SLOT_INTERFACE("exp", VIC1010)
11361135   SLOT_INTERFACE("3k", VIC1210)
11371136   SLOT_INTERFACE("8k", VIC1110)
11381137   SLOT_INTERFACE("16k", VIC1111)
11391138
11401139   // the following need ROMs from the software list
1141   SLOT_INTERFACE("ieee488", VIC1112)
1142   SLOT_INTERFACE("megacart", VIC20_MEGACART)
1140   SLOT_INTERFACE_INTERNAL("standard", VIC20_STD)
1141   SLOT_INTERFACE_INTERNAL("ieee488", VIC1112)
1142   SLOT_INTERFACE_INTERNAL("megacart", VIC20_MEGACART)
11431143SLOT_INTERFACE_END
11441144
11451145SLOT_INTERFACE_START( vic20_user_port_cards )
11461146SLOT_INTERFACE_END
11471147
11481148SLOT_INTERFACE_START( vic10_expansion_cards )
1149   SLOT_INTERFACE("standard", VIC10_STD)
1149   // the following need ROMs from the software list
1150   SLOT_INTERFACE_INTERNAL("standard", VIC10_STD)
11501151SLOT_INTERFACE_END
11511152
11521153SLOT_INTERFACE_START( c64_expansion_cards )
1154   SLOT_INTERFACE("16k", C64_16KB)
11531155   SLOT_INTERFACE("cpm", C64_CPM)
11541156   SLOT_INTERFACE("dqbb", C64_DQBB)
11551157   SLOT_INTERFACE("easyflash", C64_EASYFLASH)
r15288r15289
11591161   SLOT_INTERFACE("sfxse", C64_SFX_SOUND_EXPANDER)
11601162
11611163   // the following need ROMs from the software list
1162   SLOT_INTERFACE_INTERNAL("ieee488", C64_IEEE488)
11631164   SLOT_INTERFACE_INTERNAL("standard", C64_STD)
11641165   SLOT_INTERFACE_INTERNAL("comal80", C64_COMAL80)
11651166   SLOT_INTERFACE_INTERNAL("cs64", C64_CURRAH_SPEECH)
r15288r15289
11731174   SLOT_INTERFACE_INTERNAL("final", C64_FINAL)
11741175   SLOT_INTERFACE_INTERNAL("final3", C64_FINAL3)
11751176   SLOT_INTERFACE_INTERNAL("fun_play", C64_FUN_PLAY)
1177   SLOT_INTERFACE_INTERNAL("ieee488", C64_IEEE488)
11761178   SLOT_INTERFACE_INTERNAL("kingsoft", C64_KINGSOFT)
11771179   SLOT_INTERFACE_INTERNAL("mach5", C64_MACH5)
11781180   SLOT_INTERFACE_INTERNAL("magic_desk", C64_MAGIC_DESK)
r15288r15289
12131215
12141216SLOT_INTERFACE_START( c128_expansion_cards )
12151217   // the following need ROMs from the software list
1216   SLOT_INTERFACE("c128_comal80", C128_COMAL80)
1218   SLOT_INTERFACE_INTERNAL("c128_comal80", C128_COMAL80)
12171219SLOT_INTERFACE_END
src/mess/machine/cbmipt.h
r15288r15289
77#include "machine/c64_4dxh.h"
88#include "machine/c64_4ksa.h"
99#include "machine/c64_4tba.h"
10#include "machine/c64_16kb.h"
1011#include "machine/c64_bn1541.h"
1112#include "machine/c64_comal80.h"
1213#include "machine/c64_cpm.h"
src/mess/machine/c64_16kb.c
r0r15289
1/**********************************************************************
2
3    Commodore 64 16KB EPROM cartridge emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "c64_16kb.h"
11
12
13
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17
18const device_type C64_16KB = &device_creator<c64_16kb_cartridge_device>;
19
20
21//-------------------------------------------------
22//  ROM( c64_16kb )
23//-------------------------------------------------
24
25ROM_START( c64_16kb )
26   ROM_REGION( 0x2000, "roml", 0 )
27   ROM_CART_LOAD( "roml", 0x0000, 0x2000, ROM_MIRROR )
28
29   ROM_REGION( 0x2000, "romh", 0 )
30   ROM_CART_LOAD( "romh", 0x0000, 0x2000, ROM_MIRROR )
31ROM_END
32
33
34//-------------------------------------------------
35//  rom_region - device-specific ROM region
36//-------------------------------------------------
37
38const rom_entry *c64_16kb_cartridge_device::device_rom_region() const
39{
40   return ROM_NAME( c64_16kb );
41}
42
43
44//-------------------------------------------------
45//  MACHINE_CONFIG_FRAGMENT( c64_16kb )
46//-------------------------------------------------
47
48static MACHINE_CONFIG_FRAGMENT( c64_16kb )
49   MCFG_CARTSLOT_ADD("roml")
50   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,80")
51
52   MCFG_CARTSLOT_ADD("romh")
53   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a0,e0")
54MACHINE_CONFIG_END
55
56
57//-------------------------------------------------
58//  machine_config_additions - device-specific
59//  machine configurations
60//-------------------------------------------------
61
62machine_config_constructor c64_16kb_cartridge_device::device_mconfig_additions() const
63{
64   return MACHINE_CONFIG_NAME( c64_16kb );
65}
66
67
68//-------------------------------------------------
69//  INPUT_PORTS( c64_16kb )
70//-------------------------------------------------
71
72static INPUT_PORTS_START( c64_16kb )
73   PORT_START("SW1")
74   PORT_DIPNAME( 0x03, 0x00, "Mode" )
75   PORT_DIPSETTING(    0x03, "Off" )
76   PORT_DIPSETTING(    0x02, "8 KB" )
77   PORT_DIPSETTING(    0x00, "16 KB" )
78   PORT_DIPSETTING(    0x01, "Ultimax" )
79INPUT_PORTS_END
80
81
82//-------------------------------------------------
83//  input_ports - device-specific input ports
84//-------------------------------------------------
85
86ioport_constructor c64_16kb_cartridge_device::device_input_ports() const
87{
88   return INPUT_PORTS_NAME( c64_16kb );
89}
90
91
92//**************************************************************************
93//  LIVE DEVICE
94//**************************************************************************
95
96//-------------------------------------------------
97//  c64_16kb_cartridge_device - constructor
98//-------------------------------------------------
99
100c64_16kb_cartridge_device::c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
101   device_t(mconfig, C64_16KB, "C64 16KB EPROM cartridge", tag, owner, clock),
102   device_c64_expansion_card_interface(mconfig, *this)
103{
104}
105
106
107//-------------------------------------------------
108//  device_start - device-specific startup
109//-------------------------------------------------
110
111void c64_16kb_cartridge_device::device_start()
112{
113   m_roml = memregion("roml")->base();
114   m_romh = memregion("romh")->base();
115}
116
117
118//-------------------------------------------------
119//  device_reset - device-specific reset
120//-------------------------------------------------
121
122void c64_16kb_cartridge_device::device_reset()
123{
124   UINT8 mode = device().ioport("SW1")->read();
125
126   m_exrom = BIT(mode, 0);
127   m_game = BIT(mode, 1);
128}
129
130
131//-------------------------------------------------
132//  c64_cd_r - cartridge data read
133//-------------------------------------------------
134
135UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2)
136{
137   UINT8 data = 0;
138
139   if (!roml)
140   {
141      data = m_roml[offset & 0x1fff];
142   }
143   else if (!romh)
144   {
145      data = m_romh[offset & 0x1fff];
146   }
147
148   return data;
149}
src/mess/machine/c64_16kb.h
r0r15289
1/**********************************************************************
2
3    Commodore 64 16KB 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 __C64_16KB__
13#define __C64_16KB__
14
15
16#include "emu.h"
17#include "imagedev/cartslot.h"
18#include "machine/c64exp.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> c64_16kb_cartridge_device
27
28class c64_16kb_cartridge_device : public device_t,
29                          public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38   virtual ioport_constructor device_input_ports() const;
39
40protected:
41   // device-level overrides
42   virtual void device_config_complete() { m_shortname = "c64_16kb"; }
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 ba, int roml, int romh, int io1, int io2);
48};
49
50
51// device type definition
52extern const device_type C64_16KB;
53
54
55
56#endif
src/mess/mess.mak
r15288r15289
795795   $(MESS_MACHINE)/c64_4dxh.o   \
796796   $(MESS_MACHINE)/c64_4ksa.o   \
797797   $(MESS_MACHINE)/c64_4tba.o   \
798   $(MESS_MACHINE)/c64_16kb.o   \
798799   $(MESS_MACHINE)/c64_bn1541.o   \
799800   $(MESS_MACHINE)/c64_comal80.o   \
800801   $(MESS_MACHINE)/c64_cpm.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team