Previous 199869 Revisions Next

r32640 Saturday 11th October, 2014 at 03:55:00 UTC by Fabio Priuli
a bunch of generic eprom sockets. nw.
[src/emu/bus/c64]16kb.c 16kb.h dela_ep256.c dela_ep256.h dela_ep64.c dela_ep64.h dela_ep7x8.c dela_ep7x8.h reu.c reu.h rex_ep256.c rex_ep256.h

trunk/src/emu/bus/c64/dela_ep256.c
r32639r32640
2121
2222
2323//-------------------------------------------------
24//  ROM( c64_dela_ep256 )
25//-------------------------------------------------
26
27ROM_START( c64_dela_ep256 )
28   ROM_REGION( 0x40000, "eprom", 0 )
29   ROM_CART_LOAD( "rom1", 0x00000, 0x08000, ROM_MIRROR )
30   ROM_CART_LOAD( "rom2", 0x08000, 0x08000, ROM_MIRROR )
31   ROM_CART_LOAD( "rom3", 0x10000, 0x08000, ROM_MIRROR )
32   ROM_CART_LOAD( "rom4", 0x18000, 0x08000, ROM_MIRROR )
33   ROM_CART_LOAD( "rom5", 0x20000, 0x08000, ROM_MIRROR )
34   ROM_CART_LOAD( "rom6", 0x28000, 0x08000, ROM_MIRROR )
35   ROM_CART_LOAD( "rom7", 0x30000, 0x08000, ROM_MIRROR )
36   ROM_CART_LOAD( "rom8", 0x38000, 0x08000, ROM_MIRROR )
37ROM_END
38
39
40//-------------------------------------------------
41//  rom_region - device-specific ROM region
42//-------------------------------------------------
43
44const rom_entry *c64_dela_ep256_cartridge_device::device_rom_region() const
45{
46   return ROM_NAME( c64_dela_ep256 );
47}
48
49
50//-------------------------------------------------
5124//  MACHINE_CONFIG_FRAGMENT( c64_dela_ep256 )
5225//-------------------------------------------------
5326
5427static MACHINE_CONFIG_FRAGMENT( c64_dela_ep256 )
55   MCFG_CARTSLOT_ADD("rom1")
56   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
57   MCFG_CARTSLOT_ADD("rom2")
58   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
59   MCFG_CARTSLOT_ADD("rom3")
60   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
61   MCFG_CARTSLOT_ADD("rom4")
62   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
63   MCFG_CARTSLOT_ADD("rom5")
64   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
65   MCFG_CARTSLOT_ADD("rom6")
66   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
67   MCFG_CARTSLOT_ADD("rom7")
68   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
69   MCFG_CARTSLOT_ADD("rom8")
70   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
28   MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL)
29   MCFG_GENERIC_EXTENSIONS("bin,rom")
30   MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL)
31   MCFG_GENERIC_EXTENSIONS("bin,rom")
32   MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL)
33   MCFG_GENERIC_EXTENSIONS("bin,rom")
34   MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL)
35   MCFG_GENERIC_EXTENSIONS("bin,rom")
36   MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL)
37   MCFG_GENERIC_EXTENSIONS("bin,rom")
38   MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL)
39   MCFG_GENERIC_EXTENSIONS("bin,rom")
40   MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL)
41   MCFG_GENERIC_EXTENSIONS("bin,rom")
42   MCFG_GENERIC_SOCKET_ADD("rom8", generic_linear_slot, NULL)
43   MCFG_GENERIC_EXTENSIONS("bin,rom")
7144MACHINE_CONFIG_END
7245
7346
r32639r32640
9366
9467c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
9568   device_t(mconfig, C64_DELA_EP256, "C64 Dela 256KB EPROM cartridge", tag, owner, clock, "delep256", __FILE__),
96   device_c64_expansion_card_interface(mconfig, *this),
97   m_eprom(*this, "eprom")
69   device_c64_expansion_card_interface(mconfig, *this)
9870{
71   for (int i = 0; i < 8; i++)
72   {
73      char str[6];
74      sprintf(str, "rom%i", i + 1);
75      m_eproms[i] = subdevice<generic_slot_device>(str);
76   }   
9977}
10078
10179
r32639r32640
10886   // state saving
10987   save_item(NAME(m_bank));
11088   save_item(NAME(m_reset));
89   save_item(NAME(m_socket));
11190}
11291
11392
r32639r32640
12099   m_reset = 1;
121100   m_bank = 0;
122101   m_exrom = 0;
102   m_socket = 0;
123103}
124104
125105
r32639r32640
138118      else
139119      {
140120         offs_t addr = (m_bank << 13) | (offset & 0x1fff);
141         data = m_eprom->base()[addr];
121         data = m_eproms[m_socket]->read_rom(space, addr);
142122      }
143123   }
144124
r32639r32640
171151
172152      m_reset = 0;
173153
174      m_bank = ((data & 0x07) << 2) | ((data >> 4) & 0x03);
154      m_socket = data & 0x07;
155      m_bank = (data >> 4) & 0x03;
175156
176157      m_exrom = BIT(data, 7);
177158   }
trunk/src/emu/bus/c64/dela_ep256.h
r32639r32640
1717
1818#include "emu.h"
1919#include "exp.h"
20#include "imagedev/cartslot.h"
20#include "bus/generic/slot.h"
21#include "bus/generic/carts.h"
2122
2223
2324
r32639r32640
3536   c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3637
3738   // optional information overrides
38   virtual const rom_entry *device_rom_region() const;
3939   virtual machine_config_constructor device_mconfig_additions() const;
4040
4141protected:
r32639r32640
4848   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4949
5050private:
51   required_memory_region m_eprom;
51   generic_slot_device *m_eproms[8];
5252
53   UINT8 m_bank;
53   UINT8 m_bank, m_socket;
5454   int m_reset;
5555};
5656
trunk/src/emu/bus/c64/dela_ep7x8.c
r32639r32640
2121
2222
2323//-------------------------------------------------
24//  ROM( c64_dela_ep7x8 )
25//-------------------------------------------------
26
27ROM_START( c64_dela_ep7x8 )
28   ROM_REGION( 0x10000, "eprom", 0 )
29   ROM_CART_LOAD( "rom1", 0x2000, 0x2000, ROM_MIRROR )
30   ROM_CART_LOAD( "rom2", 0x4000, 0x2000, ROM_MIRROR )
31   ROM_CART_LOAD( "rom3", 0x6000, 0x2000, ROM_MIRROR )
32   ROM_CART_LOAD( "rom4", 0x8000, 0x2000, ROM_MIRROR )
33   ROM_CART_LOAD( "rom5", 0xa000, 0x2000, ROM_MIRROR )
34   ROM_CART_LOAD( "rom6", 0xc000, 0x2000, ROM_MIRROR )
35   ROM_CART_LOAD( "rom7", 0xe000, 0x2000, ROM_MIRROR )
36ROM_END
37
38
39//-------------------------------------------------
40//  rom_region - device-specific ROM region
41//-------------------------------------------------
42
43const rom_entry *c64_dela_ep7x8_cartridge_device::device_rom_region() const
44{
45   return ROM_NAME( c64_dela_ep7x8 );
46}
47
48
49//-------------------------------------------------
5024//  MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 )
5125//-------------------------------------------------
5226
5327static MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 )
54   MCFG_CARTSLOT_ADD("rom1")
55   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
56   MCFG_CARTSLOT_ADD("rom2")
57   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
58   MCFG_CARTSLOT_ADD("rom3")
59   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
60   MCFG_CARTSLOT_ADD("rom4")
61   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
62   MCFG_CARTSLOT_ADD("rom5")
63   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
64   MCFG_CARTSLOT_ADD("rom6")
65   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
66   MCFG_CARTSLOT_ADD("rom7")
67   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
28   MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL)
29   MCFG_GENERIC_EXTENSIONS("bin,rom")
30   MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL)
31   MCFG_GENERIC_EXTENSIONS("bin,rom")
32   MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL)
33   MCFG_GENERIC_EXTENSIONS("bin,rom")
34   MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL)
35   MCFG_GENERIC_EXTENSIONS("bin,rom")
36   MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL)
37   MCFG_GENERIC_EXTENSIONS("bin,rom")
38   MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL)
39   MCFG_GENERIC_EXTENSIONS("bin,rom")
40   MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL)
41   MCFG_GENERIC_EXTENSIONS("bin,rom")
6842MACHINE_CONFIG_END
6943
7044
r32639r32640
9064c64_dela_ep7x8_cartridge_device::c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
9165   device_t(mconfig, C64_DELA_EP7X8, "C64 Dela 7x8KB EPROM cartridge", tag, owner, clock, "ep7x8", __FILE__),
9266   device_c64_expansion_card_interface(mconfig, *this),
93   m_eprom(*this, "eprom")
67   m_eprom1(*this, "rom1"),
68   m_eprom2(*this, "rom2"),
69   m_eprom3(*this, "rom3"),
70   m_eprom4(*this, "rom4"),
71   m_eprom5(*this, "rom5"),
72   m_eprom6(*this, "rom6"),
73   m_eprom7(*this, "rom7")
9474{
9575}
9676
r32639r32640
128108      offs_t addr = offset & 0x1fff;
129109
130110      if (!BIT(m_bank, 0)) data |= m_roml[addr];
131      if (!BIT(m_bank, 1)) data |= m_eprom->base()[0x2000 + addr];
132      if (!BIT(m_bank, 2)) data |= m_eprom->base()[0x4000 + addr];
133      if (!BIT(m_bank, 3)) data |= m_eprom->base()[0x6000 + addr];
134      if (!BIT(m_bank, 4)) data |= m_eprom->base()[0x8000 + addr];
135      if (!BIT(m_bank, 5)) data |= m_eprom->base()[0xa000 + addr];
136      if (!BIT(m_bank, 6)) data |= m_eprom->base()[0xc000 + addr];
137      if (!BIT(m_bank, 7)) data |= m_eprom->base()[0xe000 + addr];
111      if (!BIT(m_bank, 1)) data |= m_eprom1->read_rom(space, addr);
112      if (!BIT(m_bank, 2)) data |= m_eprom2->read_rom(space, addr);
113      if (!BIT(m_bank, 3)) data |= m_eprom3->read_rom(space, addr);
114      if (!BIT(m_bank, 4)) data |= m_eprom4->read_rom(space, addr);
115      if (!BIT(m_bank, 5)) data |= m_eprom5->read_rom(space, addr);
116      if (!BIT(m_bank, 6)) data |= m_eprom6->read_rom(space, addr);
117      if (!BIT(m_bank, 7)) data |= m_eprom7->read_rom(space, addr);
138118   }
139119
140120   return data;
trunk/src/emu/bus/c64/dela_ep64.c
r32639r32640
2121
2222
2323//-------------------------------------------------
24//  ROM( c64_dela_ep64 )
25//-------------------------------------------------
26
27ROM_START( c64_dela_ep64 )
28   ROM_REGION( 0x10000, "eprom", 0 )
29   ROM_CART_LOAD( "rom1", 0x0000, 0x08000, ROM_MIRROR )
30   ROM_CART_LOAD( "rom2", 0x8000, 0x08000, ROM_MIRROR )
31ROM_END
32
33
34//-------------------------------------------------
35//  rom_region - device-specific ROM region
36//-------------------------------------------------
37
38const rom_entry *c64_dela_ep64_cartridge_device::device_rom_region() const
39{
40   return ROM_NAME( c64_dela_ep64 );
41}
42
43
44//-------------------------------------------------
4524//  MACHINE_CONFIG_FRAGMENT( c64_dela_ep64 )
4625//-------------------------------------------------
4726
4827static MACHINE_CONFIG_FRAGMENT( c64_dela_ep64 )
49   MCFG_CARTSLOT_ADD("rom1")
50   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
51   MCFG_CARTSLOT_ADD("rom2")
52   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
28   MCFG_GENERIC_SOCKET_ADD("eprom1", generic_linear_slot, NULL)
29   MCFG_GENERIC_EXTENSIONS("rom,bin")
30   MCFG_GENERIC_SOCKET_ADD("eprom2", generic_linear_slot, NULL)
31   MCFG_GENERIC_EXTENSIONS("rom,bin")
5332MACHINE_CONFIG_END
5433
5534
r32639r32640
7554c64_dela_ep64_cartridge_device::c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
7655   device_t(mconfig, C64_DELA_EP64, "C64 Rex 64KB EPROM cartridge", tag, owner, clock, "c64_dela_ep64", __FILE__),
7756   device_c64_expansion_card_interface(mconfig, *this),
78   m_eprom(*this, "eprom")
57   m_eprom1(*this, "eprom1"),
58   m_eprom2(*this, "eprom2")
7959{
8060}
8161
r32639r32640
124104         offs_t addr = (m_bank << 13) | (offset & 0x1fff);
125105
126106         if (!m_rom0_ce) data |= m_roml[offset & 0x1fff];
127         if (!m_rom1_ce) data |= m_eprom->base()[0x0000 + addr];
128         if (!m_rom2_ce) data |= m_eprom->base()[0x8000 + addr];
107         if (!m_rom1_ce) data |= m_eprom1->read_rom(space, addr);
108         if (!m_rom2_ce) data |= m_eprom2->read_rom(space, addr);
129109      }
130110   }
131111
trunk/src/emu/bus/c64/dela_ep7x8.h
r32639r32640
1616
1717
1818#include "emu.h"
19#include "imagedev/cartslot.h"
19#include "bus/generic/slot.h"
20#include "bus/generic/carts.h"
2021#include "exp.h"
2122
2223
r32639r32640
3536   c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3637
3738   // optional information overrides
38   virtual const rom_entry *device_rom_region() const;
3939   virtual machine_config_constructor device_mconfig_additions() const;
4040
4141protected:
r32639r32640
4848   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4949
5050private:
51   required_memory_region m_eprom;
51   required_device<generic_slot_device> m_eprom1;
52   required_device<generic_slot_device> m_eprom2;
53   required_device<generic_slot_device> m_eprom3;
54   required_device<generic_slot_device> m_eprom4;
55   required_device<generic_slot_device> m_eprom5;
56   required_device<generic_slot_device> m_eprom6;
57   required_device<generic_slot_device> m_eprom7;
5258
5359   UINT8 m_bank;
5460};
trunk/src/emu/bus/c64/dela_ep64.h
r32639r32640
1616
1717
1818#include "emu.h"
19#include "imagedev/cartslot.h"
19#include "bus/generic/slot.h"
20#include "bus/generic/carts.h"
2021#include "exp.h"
2122
2223
r32639r32640
3536   c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3637
3738   // optional information overrides
38   virtual const rom_entry *device_rom_region() const;
3939   virtual machine_config_constructor device_mconfig_additions() const;
4040
4141protected:
r32639r32640
4848   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4949
5050private:
51   required_memory_region m_eprom;
51   required_device<generic_slot_device> m_eprom1;
52   required_device<generic_slot_device> m_eprom2;
5253
5354   UINT8 m_bank;
5455   int m_reset;
trunk/src/emu/bus/c64/reu.c
r32639r32640
2020#define MOS8726R1_TAG   "u1"
2121
2222
23
2423//**************************************************************************
2524//  DEVICE DEFINITIONS
2625//**************************************************************************
r32639r32640
3130
3231
3332//-------------------------------------------------
34//  ROM( c64_reu )
35//-------------------------------------------------
36
37ROM_START( c64_reu )
38   ROM_REGION( 0x8000, "roml", 0 )
39   ROM_CART_LOAD( "rom", 0x0000, 0x8000, ROM_MIRROR )
40ROM_END
41
42
43//-------------------------------------------------
44//  rom_region - device-specific ROM region
45//-------------------------------------------------
46
47const rom_entry *c64_reu_cartridge_device::device_rom_region() const
48{
49   return ROM_NAME( c64_reu );
50}
51
52
53//-------------------------------------------------
5433//  MACHINE_CONFIG_FRAGMENT( c64_reu )
5534//-------------------------------------------------
5635
5736static MACHINE_CONFIG_FRAGMENT( c64_reu )
5837   MCFG_MOS8726_ADD(MOS8726R1_TAG)
5938
60   MCFG_CARTSLOT_ADD("rom")
61   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
39   MCFG_GENERIC_SOCKET_ADD("rom", generic_linear_slot, NULL)
40   MCFG_GENERIC_EXTENSIONS("bin,rom")
6241MACHINE_CONFIG_END
6342
6443
r32639r32640
8665   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
8766   device_c64_expansion_card_interface(mconfig, *this),
8867   m_dmac(*this, MOS8726R1_TAG),
89   m_rom(*this, "rom"),
68   m_eprom(*this, "rom"),
9069   m_ram(*this, "ram"),
9170   m_variant(variant),
9271   m_jp1(jp1),
r32639r32640
137116{
138117   if (!m_dmac->romsel_r(roml, romh))
139118   {
140      data = m_roml[offset & 0x7fff];
119      data = m_eprom->read_rom(space, offset & 0x7fff);
141120   }
142121   else if (!io2)
143122   {
trunk/src/emu/bus/c64/reu.h
r32639r32640
1616
1717
1818#include "emu.h"
19#include "imagedev/cartslot.h"
19#include "bus/generic/slot.h"
20#include "bus/generic/carts.h"
2021#include "exp.h"
2122#include "machine/mos8726.h"
2223
r32639r32640
3637   c64_reu_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, int jp1, size_t ram_size, const char *shortname, const char *source);
3738
3839   // optional information overrides
39   virtual const rom_entry *device_rom_region() const;
4040   virtual machine_config_constructor device_mconfig_additions() const;
4141
4242protected:
r32639r32640
5656   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
5757
5858   required_device<mos8726_device> m_dmac;
59   required_memory_region m_rom;
59   required_device<generic_slot_device> m_eprom;
6060   optional_shared_ptr<UINT8> m_ram;
6161
6262   int m_variant;
trunk/src/emu/bus/c64/16kb.c
r32639r32640
2121
2222
2323//-------------------------------------------------
24//  ROM( c64_16kb )
25//-------------------------------------------------
26
27ROM_START( c64_16kb )
28   ROM_REGION( 0x2000, "roml", 0 )
29   ROM_CART_LOAD( "roml", 0x0000, 0x2000, ROM_MIRROR )
30
31   ROM_REGION( 0x2000, "romh", 0 )
32   ROM_CART_LOAD( "romh", 0x0000, 0x2000, ROM_MIRROR )
33ROM_END
34
35
36//-------------------------------------------------
37//  rom_region - device-specific ROM region
38//-------------------------------------------------
39
40const rom_entry *c64_16kb_cartridge_device::device_rom_region() const
41{
42   return ROM_NAME( c64_16kb );
43}
44
45
46//-------------------------------------------------
4724//  MACHINE_CONFIG_FRAGMENT( c64_16kb )
4825//-------------------------------------------------
4926
5027static MACHINE_CONFIG_FRAGMENT( c64_16kb )
51   MCFG_CARTSLOT_ADD("roml")
52   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,80")
28   MCFG_GENERIC_CARTSLOT_ADD("roml", generic_linear_slot, NULL)
29   MCFG_GENERIC_EXTENSIONS("rom,bin,80")
5330
54   MCFG_CARTSLOT_ADD("romh")
55   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a0,e0")
31   MCFG_GENERIC_CARTSLOT_ADD("romh", generic_linear_slot, NULL)
32   MCFG_GENERIC_EXTENSIONS("rom,bin,a0,e0")
5633MACHINE_CONFIG_END
5734
5835
r32639r32640
10380   device_t(mconfig, C64_16KB, "C64 16KB EPROM cartridge", tag, owner, clock, "c64_16kb", __FILE__),
10481   device_c64_expansion_card_interface(mconfig, *this),
10582   m_sw1(*this, "SW1"),
106   m_rom_low(*this, "roml"),
107   m_rom_high(*this, "romh")
83   m_low(*this, "roml"),
84   m_high(*this, "romh")
10885{
10986}
11087
r32639r32640
139116{
140117   if (!roml)
141118   {
142      data = m_rom_low->base()[offset & 0x1fff];
119      data = m_low->read_rom(space, offset & 0x1fff);
143120   }
144121   else if (!romh)
145122   {
146      data = m_rom_high->base()[offset & 0x1fff];
123      data = m_high->read_rom(space, offset & 0x1fff);
147124   }
148125
149126   return data;
trunk/src/emu/bus/c64/16kb.h
r32639r32640
1616
1717
1818#include "emu.h"
19#include "imagedev/cartslot.h"
19#include "bus/generic/slot.h"
20#include "bus/generic/carts.h"
2021#include "exp.h"
2122
2223
r32639r32640
3536   c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3637
3738   // optional information overrides
38   virtual const rom_entry *device_rom_region() const;
3939   virtual machine_config_constructor device_mconfig_additions() const;
4040   virtual ioport_constructor device_input_ports() const;
4141
r32639r32640
4949
5050private:
5151   required_ioport m_sw1;
52   required_memory_region m_rom_low;
53   required_memory_region m_rom_high;
52   required_device<generic_slot_device> m_low;
53   required_device<generic_slot_device> m_high;
5454};
5555
5656
trunk/src/emu/bus/c64/rex_ep256.c
r32639r32640
2121
2222
2323//-------------------------------------------------
24//  ROM( c64_rex_ep256 )
25//-------------------------------------------------
26
27ROM_START( c64_rex_ep256 )
28   ROM_REGION( 0x40000, "eprom", 0 )
29   ROM_CART_LOAD( "rom1", 0x00000, 0x08000, ROM_MIRROR )
30   ROM_CART_LOAD( "rom2", 0x08000, 0x08000, ROM_MIRROR )
31   ROM_CART_LOAD( "rom3", 0x10000, 0x08000, ROM_MIRROR )
32   ROM_CART_LOAD( "rom4", 0x18000, 0x08000, ROM_MIRROR )
33   ROM_CART_LOAD( "rom5", 0x20000, 0x08000, ROM_MIRROR )
34   ROM_CART_LOAD( "rom6", 0x28000, 0x08000, ROM_MIRROR )
35   ROM_CART_LOAD( "rom7", 0x30000, 0x08000, ROM_MIRROR )
36   ROM_CART_LOAD( "rom8", 0x38000, 0x08000, ROM_MIRROR )
37ROM_END
38
39
40//-------------------------------------------------
41//  rom_region - device-specific ROM region
42//-------------------------------------------------
43
44const rom_entry *c64_rex_ep256_cartridge_device::device_rom_region() const
45{
46   return ROM_NAME( c64_rex_ep256 );
47}
48
49
50//-------------------------------------------------
5124//  MACHINE_CONFIG_FRAGMENT( c64_rex_ep256 )
5225//-------------------------------------------------
5326
5427static MACHINE_CONFIG_FRAGMENT( c64_rex_ep256 )
55   MCFG_CARTSLOT_ADD("rom1")
56   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
57   MCFG_CARTSLOT_ADD("rom2")
58   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
59   MCFG_CARTSLOT_ADD("rom3")
60   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
61   MCFG_CARTSLOT_ADD("rom4")
62   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
63   MCFG_CARTSLOT_ADD("rom5")
64   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
65   MCFG_CARTSLOT_ADD("rom6")
66   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
67   MCFG_CARTSLOT_ADD("rom7")
68   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
69   MCFG_CARTSLOT_ADD("rom8")
70   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
28   MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL)
29   MCFG_GENERIC_EXTENSIONS("bin,rom")
30   MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL)
31   MCFG_GENERIC_EXTENSIONS("bin,rom")
32   MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL)
33   MCFG_GENERIC_EXTENSIONS("bin,rom")
34   MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL)
35   MCFG_GENERIC_EXTENSIONS("bin,rom")
36   MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL)
37   MCFG_GENERIC_EXTENSIONS("bin,rom")
38   MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL)
39   MCFG_GENERIC_EXTENSIONS("bin,rom")
40   MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL)
41   MCFG_GENERIC_EXTENSIONS("bin,rom")
42   MCFG_GENERIC_SOCKET_ADD("rom8", generic_linear_slot, NULL)
43   MCFG_GENERIC_EXTENSIONS("bin,rom")
7144MACHINE_CONFIG_END
7245
7346
r32639r32640
9366
9467c64_rex_ep256_cartridge_device::c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
9568   device_t(mconfig, C64_REX_EP256, "C64 Rex 256KB EPROM cartridge", tag, owner, clock, "rexep256", __FILE__),
96   device_c64_expansion_card_interface(mconfig, *this),
97   m_eprom(*this, "eprom")
69   device_c64_expansion_card_interface(mconfig, *this)
9870{
71   for (int i = 0; i < 8; i++)
72   {
73      char str[6];
74      sprintf(str, "rom%i", i + 1);
75      m_eproms[i] = subdevice<generic_slot_device>(str);
76   }
9977}
10078
10179
r32639r32640
10886   // state saving
10987   save_item(NAME(m_bank));
11088   save_item(NAME(m_reset));
89   save_item(NAME(m_socket));
11190}
11291
11392
r32639r32640
12099   m_exrom = 0;
121100   m_reset = 1;
122101   m_bank = 0;
102   m_socket = 0;
123103}
124104
125105
r32639r32640
138118      else
139119      {
140120         offs_t addr = (m_bank << 13) | (offset & 0x1fff);
141         data = m_eprom->base()[addr];
121         data = m_eproms[m_socket]->read_rom(space, addr);
142122      }
143123   }
144124   else if (!io2)
r32639r32640
182162
183163      m_reset = 0;
184164
185      m_bank = ((data & 0x07) << 2) | ((data >> 5) & 0x03);
165      m_socket = data & 0x07;
166      m_bank = (data >> 5) & 0x03;
186167   }
187168}
trunk/src/emu/bus/c64/rex_ep256.h
r32639r32640
1616
1717
1818#include "emu.h"
19#include "imagedev/cartslot.h"
19#include "bus/generic/slot.h"
20#include "bus/generic/carts.h"
2021#include "exp.h"
2122
2223
r32639r32640
3536   c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3637
3738   // optional information overrides
38   virtual const rom_entry *device_rom_region() const;
3939   virtual machine_config_constructor device_mconfig_additions() const;
4040
4141protected:
r32639r32640
4848   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4949
5050private:
51   required_memory_region m_eprom;
52
53   UINT8 m_bank;
51   generic_slot_device *m_eproms[8];
52   
53   UINT8 m_bank, m_socket;
5454   int m_reset;
5555};
5656

Previous 199869 Revisions Next


© 1997-2024 The MAME Team