summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/emu.mak22
-rw-r--r--src/emu/machine/pla.c (renamed from src/emu/machine/pls100.c)48
-rw-r--r--src/emu/machine/pla.h (renamed from src/emu/machine/pls100.h)55
-rw-r--r--src/mess/drivers/c128.c107
-rw-r--r--src/mess/drivers/c64.c4
-rw-r--r--src/mess/includes/c128.h13
-rw-r--r--src/mess/includes/c64.h2
-rw-r--r--src/mess/includes/plus4.h2
-rw-r--r--src/mess/machine/c128.c26
-rw-r--r--src/mess/machine/c1551.h2
10 files changed, 217 insertions, 64 deletions
diff --git a/src/emu/emu.mak b/src/emu/emu.mak
index 6351390faee..67d9bb9bde0 100644
--- a/src/emu/emu.mak
+++ b/src/emu/emu.mak
@@ -223,17 +223,17 @@ EMUMACHINEOBJS = \
$(EMUMACHINE)/netlist.o \
$(EMUMACHINE)/net_lib.o \
$(EMUMACHINE)/nmc9306.o \
- $(EMUMACHINE)/nscsi_bus.o \
- $(EMUMACHINE)/nscsi_cd.o \
- $(EMUMACHINE)/nscsi_hd.o \
+ $(EMUMACHINE)/nscsi_bus.o \
+ $(EMUMACHINE)/nscsi_cd.o \
+ $(EMUMACHINE)/nscsi_hd.o \
$(EMUMACHINE)/nvram.o \
$(EMUMACHINE)/pc16552d.o \
- $(EMUMACHINE)/pci.o \
+ $(EMUMACHINE)/pci.o \
$(EMUMACHINE)/pd4990a.o \
$(EMUMACHINE)/pic8259.o \
$(EMUMACHINE)/pit8253.o \
- $(EMUMACHINE)/pls100.o \
- $(EMUMACHINE)/ram.o \
+ $(EMUMACHINE)/pla.o \
+ $(EMUMACHINE)/ram.o \
$(EMUMACHINE)/roc10937.o \
$(EMUMACHINE)/rp5c01.o \
$(EMUMACHINE)/rp5c15.o \
@@ -293,7 +293,7 @@ EMUVIDEOOBJS = \
$(EMUVIDEO)/huc6261.o \
$(EMUVIDEO)/huc6270.o \
$(EMUVIDEO)/huc6272.o \
- $(EMUVIDEO)/i8275.o \
+ $(EMUVIDEO)/i8275.o \
$(EMUVIDEO)/k053250.o \
$(EMUVIDEO)/m50458.o \
$(EMUVIDEO)/mb90082.o \
@@ -302,12 +302,12 @@ EMUVIDEOOBJS = \
$(EMUVIDEO)/pc_cga.o \
$(EMUVIDEO)/cgapal.o \
$(EMUVIDEO)/pc_vga.o \
- $(EMUVIDEO)/poly.o \
- $(EMUVIDEO)/psx.o \
+ $(EMUVIDEO)/poly.o \
+ $(EMUVIDEO)/psx.o \
$(EMUVIDEO)/ramdac.o \
$(EMUVIDEO)/resnet.o \
$(EMUVIDEO)/rgbutil.o \
- $(EMUVIDEO)/s2636.o \
+ $(EMUVIDEO)/s2636.o \
$(EMUVIDEO)/saa5050.o \
$(EMUVIDEO)/sed1330.o \
$(EMUVIDEO)/tlc34076.o \
@@ -315,7 +315,7 @@ EMUVIDEOOBJS = \
$(EMUVIDEO)/tms9927.o \
$(EMUVIDEO)/tms9928a.o \
$(EMUVIDEO)/upd3301.o \
- $(EMUVIDEO)/v9938.o \
+ $(EMUVIDEO)/v9938.o \
$(EMUVIDEO)/vector.o \
$(EMUVIDEO)/voodoo.o \
diff --git a/src/emu/machine/pls100.c b/src/emu/machine/pla.c
index 2f3a0ba2d85..28c1609e11a 100644
--- a/src/emu/machine/pls100.c
+++ b/src/emu/machine/pla.c
@@ -7,8 +7,7 @@
**********************************************************************/
-#include "emu.h"
-#include "pls100.h"
+#include "pla.h"
@@ -17,6 +16,7 @@
//**************************************************************************
const device_type PLS100 = &device_creator<pls100_device>;
+const device_type MOS8721 = &device_creator<mos8721_device>;
@@ -28,32 +28,32 @@ const device_type PLS100 = &device_creator<pls100_device>;
// parse_fusemap -
//-------------------------------------------------
-inline void pls100_device::parse_fusemap()
+inline void pla_device::parse_fusemap()
{
jed_data jed;
jedbin_parse(machine().root_device().memregion(tag())->base(), machine().root_device().memregion(tag())->bytes(), &jed);
UINT32 fusenum = 0;
m_xor = 0;
- for (int term = 0; term < PAL_TERMS; term++)
+ for (int term = 0; term < m_terms; term++)
{
m_and_comp[term] = 0;
m_and_true[term] = 0;
m_or[term] = 0;
- for (int i = 0; i < PAL_INPUTS; i++)
+ for (int i = 0; i < m_inputs; i++)
{
m_and_comp[term] |= jed_get_fuse(&jed, fusenum++) << i;
m_and_true[term] |= jed_get_fuse(&jed, fusenum++) << i;
}
- for (int f = 0; f < PAL_OUTPUTS; f++)
+ for (int f = 0; f < m_outputs; f++)
{
m_or[term] |= !jed_get_fuse(&jed, fusenum++) << f;
}
}
- for (int f = 0; f < PAL_OUTPUTS; f++)
+ for (int f = 0; f < m_outputs; f++)
{
m_xor |= jed_get_fuse(&jed, fusenum++) << f;
}
@@ -64,12 +64,12 @@ inline void pls100_device::parse_fusemap()
// get_product -
//-------------------------------------------------
-inline int pls100_device::get_product(int term)
+inline int pla_device::get_product(int term)
{
- UINT16 input_true = m_and_true[term] | m_i;
- UINT16 input_comp = m_and_comp[term] | (m_i ^ 0xffff);
+ UINT32 input_true = m_and_true[term] | m_i;
+ UINT32 input_comp = m_and_comp[term] | ~m_i;
- return (input_true & input_comp) == 0xffff;
+ return ((input_true & input_comp) & m_output_mask) == m_output_mask;
}
@@ -77,11 +77,11 @@ inline int pls100_device::get_product(int term)
// update_outputs -
//-------------------------------------------------
-inline void pls100_device::update_outputs()
+inline void pla_device::update_outputs()
{
m_s = 0;
- for (int term = 0; term < PAL_TERMS; term++)
+ for (int term = 0; term < m_terms; term++)
{
if (get_product(term))
{
@@ -97,11 +97,25 @@ inline void pls100_device::update_outputs()
//**************************************************************************
//-------------------------------------------------
-// pls100_device - constructor
+// pla_device - constructor
//-------------------------------------------------
+pla_device::pla_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int inputs, int outputs, int terms, UINT32 output_mask)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ m_inputs(inputs),
+ m_outputs(outputs),
+ m_terms(terms),
+ m_output_mask(output_mask)
+{
+}
+
pls100_device::pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, PLS100, "PLS100", tag, owner, clock)
+ : pla_device(mconfig, PLS100, "PLS100", tag, owner, clock, 16, 8, 48, 0xffff)
+{
+}
+
+mos8721_device::mos8721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : pla_device(mconfig, MOS8721, "MOS8721", tag, owner, clock, 27, 18, 48, 0x7ffffff)
{
}
@@ -110,7 +124,7 @@ pls100_device::pls100_device(const machine_config &mconfig, const char *tag, dev
// device_start - device-specific startup
//-------------------------------------------------
-void pls100_device::device_start()
+void pla_device::device_start()
{
// parse fusemap
assert(machine().root_device().memregion(tag()) != NULL);
@@ -126,7 +140,7 @@ void pls100_device::device_start()
// read -
//-------------------------------------------------
-UINT8 pls100_device::read(UINT16 input)
+UINT32 pla_device::read(UINT32 input)
{
m_i = input;
diff --git a/src/emu/machine/pls100.h b/src/emu/machine/pla.h
index 80f9cc7d09a..1a20a8f0280 100644
--- a/src/emu/machine/pls100.h
+++ b/src/emu/machine/pla.h
@@ -26,8 +26,8 @@
#pragma once
-#ifndef __PLS100__
-#define __PLS100__
+#ifndef __PLA__
+#define __PLA__
#include "emu.h"
#include "jedparse.h"
@@ -38,9 +38,7 @@
// MACROS / CONSTANTS
//**************************************************************************
-#define PAL_INPUTS 16
-#define PAL_OUTPUTS 8
-#define PAL_TERMS 48
+#define MAX_TERMS 512
@@ -51,42 +49,67 @@
#define MCFG_PLS100_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, PLS100, 0)
+#define MCFG_MOS8721_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, MOS8721, 0)
///*************************************************************************
// TYPE DEFINITIONS
///*************************************************************************
-// ======================> pls100_device
+// ======================> pla_device
-class pls100_device : public device_t
+class pla_device : public device_t
{
public:
// construction/destruction
- pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ pla_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int inputs, int outputs, int terms, UINT32 output_mask);
- UINT8 read(UINT16 input);
+ UINT32 read(UINT32 input);
protected:
// device-level overrides
virtual void device_start();
-private:
inline void parse_fusemap();
inline int get_product(int term);
inline void update_outputs();
- UINT16 m_i;
- UINT8 m_s;
- UINT16 m_and_true[PAL_TERMS];
- UINT16 m_and_comp[PAL_TERMS];
- UINT16 m_or[PAL_TERMS];
- UINT8 m_xor;
+ int m_inputs;
+ int m_outputs;
+ int m_terms;
+ UINT32 m_output_mask;
+
+ UINT32 m_i;
+ UINT32 m_s;
+ UINT32 m_and_true[MAX_TERMS];
+ UINT32 m_and_comp[MAX_TERMS];
+ UINT32 m_or[MAX_TERMS];
+ UINT32 m_xor;
+};
+
+
+// ======================> pls100_device
+
+class pls100_device : public pla_device
+{
+public:
+ pls100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+
+// ======================> mos8721_device
+
+class mos8721_device : public pla_device
+{
+public:
+ mos8721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// device type definition
extern const device_type PLS100;
+extern const device_type MOS8721;
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index 6eb06897b91..f6b0fa3dd99 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -204,6 +204,21 @@ to use an EEPROM reader, in order to obtain a dump of the whole content.
#include "includes/c64_legacy.h"
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define A15 BIT(offset, 15)
+#define A14 BIT(offset, 14)
+#define A13 BIT(offset, 13)
+#define A12 BIT(offset, 12)
+#define A11 BIT(offset, 11)
+#define A10 BIT(offset, 10)
+#define VMA5 BIT(vma, 13)
+#define VMA4 BIT(vma, 12)
+
+
/*************************************
*
* Main CPU memory handlers
@@ -225,27 +240,55 @@ to use an EEPROM reader, in order to obtain a dump of the whole content.
* 0xe000-0xffff ram as bank 0
*/
-void c128_state::bankswitch_pla(offs_t offset, offs_t vma, int ba, int rw, int aec, int z80io, int ms3, int ms2, int ms1, int ms0,
- int *cas, int *gwe, int *rom1, int *rom2, int *rom3, int *rom4, int *charom, int *colorram, int *vic,
+void c128_state::bankswitch_pla(offs_t offset, offs_t ta, offs_t vma, int ba, int rw, int aec, int z80io, int ms3, int ms2, int ms1, int ms0,
+ int *sden, int *dir, int *gwe, int *rom1, int *rom2, int *rom3, int *rom4, int *charom, int *colorram, int *vic,
int *from1, int *romh, int *roml, int *dwe, int *ioacc, int *clrbank, int *iocs, int *casenb)
{
- //int game = m_exp->game_r(offset, ba, rw, m_hiram);
- //int exrom = m_exp->exrom_r(offset, ba, rw, m_hiram);
- //int vicfix = 0;
- //int _128_256 = 1;
+ int _128_256 = 1;
+ int dmaack = 1;
+ int vicfix = 0;
+ int game = m_exp->game_r(ta, ba, rw, m_hiram);
+ int exrom = m_exp->exrom_r(ta, ba, rw, m_hiram);
+ int clk = 1;
+
+ UINT32 input = clk << 26 | m_va14 << 25 | m_charen << 24 |
+ m_hiram << 23 | m_loram << 22 | ba << 21 | VMA5 << 20 | VMA4 << 19 | ms0 << 18 | ms1 << 17 | ms2 << 16 |
+ exrom << 15 | game << 14 | rw << 13 | aec << 12 | A10 << 11 | A11 << 10 | A12 << 9 | A13 << 8 |
+ A14 << 7 | A15 << 6 | z80io << 5 | m_z80en << 4 | ms3 << 3 | vicfix << 2 | dmaack << 1 | _128_256;
+
+ UINT32 data = m_pla->read(input);
+
+ *sden = BIT(data, 0);
+ *rom4 = BIT(data, 1);
+ *rom2 = BIT(data, 2);
+ *dir = BIT(data, 3);
+ *roml = BIT(data, 4);
+ *romh = BIT(data, 5);
+ *clrbank = BIT(data, 6);
+ *from1 = BIT(data, 7);
+ *rom3 = BIT(data, 8);
+ *rom1 = BIT(data, 9);
+ *iocs = BIT(data, 10);
+ *dwe = BIT(data, 11);
+ *casenb = BIT(data, 12);
+ *vic = BIT(data, 13);
+ *ioacc = BIT(data, 14);
+ *gwe = BIT(data, 15);
+ *colorram = BIT(data, 16);
+ *charom = BIT(data, 17);
}
UINT8 c128_state::read_memory(address_space &space, offs_t offset, offs_t vma, int ba, int aec, int z80io)
{
int rw = 1, ms0 = 1, ms1 = 1, ms2 = 1, ms3 = 1, cas0 = 1, cas1 = 1;
- int cas = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1,
+ int sden = 1, dir = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1,
from1 = 1, romh = 1, roml = 1, dwe = 1, ioacc = 1, clrbank = 1, iocs = 1, casenb = 1;
int io1 = 1, io2 = 1;
offs_t ta = m_mmu->ta_r(offset, aec, &ms0, &ms1, &ms2, &ms3, &cas0, &cas1);
- bankswitch_pla(offset, vma, ba, rw, aec, z80io, ms3, ms2, ms1, ms0,
- &cas, &gwe, &rom1, &rom2, &rom3, &rom4, &charom, &colorram, &vic,
+ bankswitch_pla(offset, ta, vma, ba, rw, aec, z80io, ms3, ms2, ms1, ms0,
+ &sden, &dir, &gwe, &rom1, &rom2, &rom3, &rom4, &charom, &colorram, &vic,
&from1, &romh, &roml, &dwe, &ioacc, &clrbank, &iocs, &casenb);
UINT8 data = 0xff;
@@ -357,14 +400,14 @@ UINT8 c128_state::read_memory(address_space &space, offs_t offset, offs_t vma, i
void c128_state::write_memory(address_space &space, offs_t offset, offs_t vma, UINT8 data, int ba, int aec, int z80io)
{
int rw = 0, ms0 = 1, ms1 = 1, ms2 = 1, ms3 = 1, cas0 = 1, cas1 = 1;
- int cas = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1,
+ int sden = 1, dir = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1,
from1 = 1, romh = 1, roml = 1, dwe = 1, ioacc = 1, clrbank = 1, iocs = 1, casenb = 1;
int io1 = 1, io2 = 1;
offs_t ta = m_mmu->ta_r(offset, aec, &ms0, &ms1, &ms2, &ms3, &cas0, &cas1);
- bankswitch_pla(offset, vma, ba, rw, aec, z80io, ms3, ms2, ms1, ms0,
- &cas, &gwe, &rom1, &rom2, &rom3, &rom4, &charom, &colorram, &vic,
+ bankswitch_pla(offset, ta, vma, ba, rw, aec, z80io, ms3, ms2, ms1, ms0,
+ &sden, &dir, &gwe, &rom1, &rom2, &rom3, &rom4, &charom, &colorram, &vic,
&from1, &romh, &roml, &dwe, &ioacc, &clrbank, &iocs, &casenb);
if (!casenb && !dwe)
@@ -830,6 +873,8 @@ WRITE_LINE_MEMBER( c128_state::mmu_z80en_w )
m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
}
+
+ m_z80en = state;
}
WRITE_LINE_MEMBER( c128_state::mmu_fsdir_w )
@@ -1063,6 +1108,7 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
// devices
MCFG_MOS8722_ADD(MOS8722_TAG, mmu_intf)
+ MCFG_MOS8721_ADD(MOS8721_TAG)
MCFG_MOS6526R1_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, c128_cia1_intf)
MCFG_MOS6526R1_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, c128_cia2_intf)
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
@@ -1169,6 +1215,7 @@ static MACHINE_CONFIG_START( pal, c128_state )
// devices
MCFG_MOS8722_ADD(MOS8722_TAG, mmu_intf)
+ MCFG_MOS8721_ADD(MOS8721_TAG)
MCFG_MOS6526R1_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, c128_cia1_intf)
MCFG_MOS6526R1_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, c128_cia2_intf)
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
@@ -1259,6 +1306,9 @@ ROM_START( c128 )
ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) ) // Character
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1280,6 +1330,9 @@ ROM_START( c128cr )
ROM_LOAD( "390059-01.u18", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) ) // Character, "MOS // (C)1985 CBM // 390059-01 // M468613 8547H"
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1302,6 +1355,9 @@ ROM_START( c128ger )
ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) ) // Character
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1320,6 +1376,9 @@ ROM_START( c128sfi )
ROM_LOAD( "325181-02.u18", 0x120000, 0x2000, BAD_DUMP CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb) ) // C128 Char Sw/Fi
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1338,6 +1397,9 @@ ROM_START( c128fra )
ROM_LOAD( "325167-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(bad36b88) SHA1(9119b27a1bf885fa4c76fff5d858c74c194dd2b8) )
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1357,6 +1419,9 @@ ROM_START( c128nor )
ROM_LOAD( "char.nor", 0x120000, 0x2000, BAD_DUMP CRC(ba95c625) SHA1(5a87faa457979e7b6f434251a9e32f4483b337b3) )
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1374,6 +1439,9 @@ ROM_START( c128d )
ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1396,6 +1464,9 @@ ROM_START( c128dcr )
ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) ) // Character
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1410,6 +1481,9 @@ ROM_START( c128drde )
ROM_LOAD( "315079-01.bin", 0x120000, 0x2000, CRC(fe5a2db1) SHA1(638f8aff51c2ac4f99a55b12c4f8c985ef4bebd3) )
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1424,6 +1498,9 @@ ROM_START( c128drsw )
ROM_LOAD( "325181-01.bin", 0x120000, 0x2000, CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb) )
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1441,6 +1518,9 @@ ROM_START( c128drit )
ROM_LOAD( "325167-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(bad36b88) SHA1(9119b27a1bf885fa4c76fff5d858c74c194dd2b8) )
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
@@ -1457,6 +1537,9 @@ ROM_START( c128d81 )
ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )
ROM_REGION( 0x10000, M8502_TAG, ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x100, MOS8721_TAG, 0 )
+ ROM_LOAD( "8721r3.u11", 0x000, 0x100, NO_DUMP )
ROM_END
diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c
index 5ded23f4ee4..6b28a1f78f4 100644
--- a/src/mess/drivers/c64.c
+++ b/src/mess/drivers/c64.c
@@ -70,8 +70,8 @@ void c64_state::bankswitch(offs_t offset, offs_t va, int rw, int aec, int ba, in
int game = m_exp->game_r(offset, ba, rw, m_hiram);
int exrom = m_exp->exrom_r(offset, ba, rw, m_hiram);
- 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;
- UINT8 data = m_pla->read(input);
+ UINT32 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;
+ UINT32 data = m_pla->read(input);
*casram = BIT(data, 0);
*basic = BIT(data, 1);
diff --git a/src/mess/includes/c128.h b/src/mess/includes/c128.h
index 1556d1b1a69..f0ce211c874 100644
--- a/src/mess/includes/c128.h
+++ b/src/mess/includes/c128.h
@@ -24,6 +24,7 @@
#include "machine/cbmipt.h"
#include "machine/mos8722.h"
#include "machine/petcass.h"
+#include "machine/pla.h"
#include "machine/ram.h"
#include "machine/vcsctrl.h"
#include "sound/dac.h"
@@ -57,6 +58,7 @@ public:
m_maincpu(*this, Z80A_TAG),
m_subcpu(*this, M8502_TAG),
m_mmu(*this, MOS8722_TAG),
+ m_pla(*this, MOS8721_TAG),
m_vdc(*this, MOS8563_TAG),
m_vic(*this, MOS8564_TAG),
m_sid(*this, MOS6581_TAG),
@@ -80,6 +82,7 @@ public:
required_device<legacy_cpu_device> m_maincpu;
required_device<legacy_cpu_device> m_subcpu;
required_device<mos8722_device> m_mmu;
+ required_device<mos8721_device> m_pla;
required_device<mos8563_device> m_vdc;
required_device<mos6566_device> m_vic;
required_device<sid6581_device> m_sid;
@@ -96,8 +99,8 @@ public:
virtual void machine_start();
virtual void machine_reset();
- void bankswitch_pla(offs_t offset, offs_t vma, int ba, int rw, int aec, int z80io, int ms3, int ms2, int ms1, int ms0,
- int *cas, int *gwe, int *rom1, int *rom2, int *rom3, int *rom4, int *charom, int *colorram, int *vic, int *from1, int *romh, int *roml, int *dwe, int *ioacc, int *clrbank, int *iocs, int *casenb);
+ void bankswitch_pla(offs_t offset, offs_t ta, offs_t vma, int ba, int rw, int aec, int z80io, int ms3, int ms2, int ms1, int ms0,
+ int *sden, int *dir, int *gwe, int *rom1, int *rom2, int *rom3, int *rom4, int *charom, int *colorram, int *vic, int *from1, int *romh, int *roml, int *dwe, int *ioacc, int *clrbank, int *iocs, int *casenb);
UINT8 read_memory(address_space &space, offs_t offset, offs_t vma, int ba, int aec, int z80io);
void write_memory(address_space &space, offs_t offset, offs_t vma, UINT8 data, int ba, int aec, int z80io);
@@ -171,6 +174,12 @@ public:
void bankswitch(int reset);
void mmu8722_reset();
+ // memory state
+ int m_loram;
+ int m_hiram;
+ int m_charen;
+ int m_va14;
+ int m_va15;
const UINT8 *m_rom1;
const UINT8 *m_rom2;
const UINT8 *m_rom3;
diff --git a/src/mess/includes/c64.h b/src/mess/includes/c64.h
index 5cbb5d6c849..c02b68854eb 100644
--- a/src/mess/includes/c64.h
+++ b/src/mess/includes/c64.h
@@ -13,7 +13,7 @@
#include "machine/cbmiec.h"
#include "machine/cbmipt.h"
#include "machine/petcass.h"
-#include "machine/pls100.h"
+#include "machine/pla.h"
#include "machine/ram.h"
#include "machine/vcsctrl.h"
#include "sound/dac.h"
diff --git a/src/mess/includes/plus4.h b/src/mess/includes/plus4.h
index 8e75e86828a..4a9d194aaad 100644
--- a/src/mess/includes/plus4.h
+++ b/src/mess/includes/plus4.h
@@ -15,7 +15,7 @@
#include "machine/cbmipt.h"
#include "machine/mos6529.h"
#include "machine/petcass.h"
-#include "machine/pls100.h"
+#include "machine/pla.h"
#include "machine/ram.h"
#define MOS7501_TAG "u2"
diff --git a/src/mess/machine/c128.c b/src/mess/machine/c128.c
index 811df673971..2840c08c4c0 100644
--- a/src/mess/machine/c128.c
+++ b/src/mess/machine/c128.c
@@ -294,6 +294,10 @@ WRITE8_MEMBER( c128_state::cia2_pa_w )
m_vicaddr = m_memory + helper[data & 0x03];
m_c128_vicaddr = m_memory + helper[data & 0x03] + m_va1617;
+
+ // VIC banking
+ m_va14 = BIT(data, 0);
+ m_va15 = BIT(data, 1);
}
WRITE_LINE_MEMBER( c128_state::cia2_irq_w )
@@ -994,15 +998,35 @@ READ8_MEMBER( c128_state::vic_dma_read_color )
WRITE8_MEMBER( c128_state::cpu_w )
{
+ /*
+
+ bit description
+
+ P0 LORAM
+ P1 HIRAM
+ P2 CHAREN
+ P3 CASS WRT
+ P4
+ P5 CASS MOTOR
+ P6
+
+ */
+
+ // memory banking
+ m_loram = BIT(data, 0);
+ m_hiram = BIT(data, 1);
+ m_charen = BIT(data, 2);
+
+ // cassette write
m_cassette->write(BIT(data, 3));
+ // cassette motor
m_cassette->motor_w(BIT(data, 5));
bankswitch_64(0);
m_memory[0x000] = m_subcpu->memory().space(AS_PROGRAM)->read_byte(0);
m_memory[0x001] = m_subcpu->memory().space(AS_PROGRAM)->read_byte(1);
-
}
READ8_MEMBER( c128_state::cpu_r)
diff --git a/src/mess/machine/c1551.h b/src/mess/machine/c1551.h
index f1ed6e482fa..7c8562c7171 100644
--- a/src/mess/machine/c1551.h
+++ b/src/mess/machine/c1551.h
@@ -22,7 +22,7 @@
#include "machine/6525tpi.h"
#include "machine/c1541.h"
#include "machine/cbmipt.h"
-#include "machine/pls100.h"
+#include "machine/pla.h"
#include "machine/plus4exp.h"