mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
Converted deco_mlc, deco32, fortecar to eepromdev.
This commit is contained in:
parent
ed372ac9d6
commit
5b3e34c733
@ -231,7 +231,7 @@ Notes:
|
||||
#include "cpu/m6809/m6809.h"
|
||||
#include "includes/decocrpt.h"
|
||||
#include "includes/decoprot.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "machine/eepromdev.h"
|
||||
#include "includes/deco32.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/okim6295.h"
|
||||
@ -351,7 +351,7 @@ static READ32_HANDLER( fghthist_control_r )
|
||||
switch (offset) {
|
||||
case 0: return 0xffff0000 | input_port_read(space->machine, "IN0");
|
||||
case 1: return 0xffff0000 | input_port_read(space->machine, "IN1"); //check top bits??
|
||||
case 2: return 0xfffffffe | eeprom_read_bit();
|
||||
case 2: return 0xfffffffe | eepromdev_read_bit(devtag_get_device(space->machine, "eeprom"));
|
||||
}
|
||||
|
||||
return 0xffffffff;
|
||||
@ -360,9 +360,10 @@ static READ32_HANDLER( fghthist_control_r )
|
||||
static WRITE32_HANDLER( fghthist_eeprom_w )
|
||||
{
|
||||
if (ACCESSING_BITS_0_7) {
|
||||
eeprom_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eeprom_write_bit(data & 0x10);
|
||||
eeprom_set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
const device_config *device = devtag_get_device(space->machine, "eeprom");
|
||||
eepromdev_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eepromdev_write_bit(device, data & 0x10);
|
||||
eepromdev_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
||||
deco32_pri_w(space,0,data&0x1,0xffffffff); /* Bit 0 - layer priority toggle */
|
||||
}
|
||||
@ -429,20 +430,20 @@ static WRITE32_HANDLER( dragngun_lightgun_w )
|
||||
dragngun_lightgun_port=offset;
|
||||
}
|
||||
|
||||
static READ32_HANDLER( dragngun_eeprom_r )
|
||||
static READ32_DEVICE_HANDLER( dragngun_eeprom_r )
|
||||
{
|
||||
return 0xfffffffe | eeprom_read_bit();
|
||||
return 0xfffffffe | eepromdev_read_bit(device);
|
||||
}
|
||||
|
||||
static WRITE32_HANDLER( dragngun_eeprom_w )
|
||||
static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w )
|
||||
{
|
||||
if (ACCESSING_BITS_0_7) {
|
||||
eeprom_set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eeprom_write_bit(data & 0x1);
|
||||
eeprom_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
|
||||
eepromdev_set_clock_line(device, (data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eepromdev_write_bit(device, data & 0x1);
|
||||
eepromdev_set_cs_line(device, (data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
|
||||
return;
|
||||
}
|
||||
logerror("%08x:Write control 1 %08x %08x\n",cpu_get_pc(space->cpu),offset,data);
|
||||
logerror("%s:Write control 1 %08x %08x\n",cpuexec_describe_context(device->machine),offset,data);
|
||||
}
|
||||
|
||||
/**********************************************************************************/
|
||||
@ -481,7 +482,7 @@ static WRITE32_HANDLER( tattass_control_w )
|
||||
static int pendingCommand=0; /* 1 = read, 2 = write */
|
||||
static int readBitCount=0;
|
||||
static int byteAddr=0;
|
||||
UINT8 *eeprom=(UINT8 *)eeprom_get_data_pointer(NULL,NULL);
|
||||
UINT8 *eeprom=(UINT8 *)eepromdev_get_data_pointer(devtag_get_device(space->machine, "eeprom"), NULL,NULL);
|
||||
|
||||
/* Eprom in low byte */
|
||||
if (mem_mask==0x000000ff) { /* Byte write to low byte only (different from word writing including low byte) */
|
||||
@ -617,7 +618,7 @@ static READ32_HANDLER( nslasher_prot_r )
|
||||
switch (offset<<1) {
|
||||
case 0x280: return input_port_read(space->machine, "IN0") << 16| 0xffff; /* IN0 */
|
||||
case 0x4c4: return input_port_read(space->machine, "IN1") << 16| 0xffff; /* IN1 */
|
||||
case 0x35a: return (eeprom_read_bit()<< 16) | 0xffff; // Debug switch in low word??
|
||||
case 0x35a: return (eepromdev_read_bit(devtag_get_device(space->machine, "eeprom"))<< 16) | 0xffff; // Debug switch in low word??
|
||||
}
|
||||
|
||||
//logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
|
||||
@ -629,9 +630,10 @@ static WRITE32_HANDLER( nslasher_eeprom_w )
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
eeprom_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eeprom_write_bit(data & 0x10);
|
||||
eeprom_set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
const device_config *device = devtag_get_device(space->machine, "eeprom");
|
||||
eepromdev_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eepromdev_write_bit(device, data & 0x10);
|
||||
eepromdev_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
||||
deco32_pri_w(space,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
|
||||
}
|
||||
@ -787,7 +789,7 @@ static ADDRESS_MAP_START( dragngun_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
|
||||
AM_RANGE(0x400000, 0x400003) AM_DEVREADWRITE8("oki3", okim6295_r, okim6295_w, 0x000000ff)
|
||||
AM_RANGE(0x410000, 0x410003) AM_WRITENOP /* Some kind of serial bit-stream - digital volume control? */
|
||||
AM_RANGE(0x420000, 0x420003) AM_READWRITE(dragngun_eeprom_r, dragngun_eeprom_w)
|
||||
AM_RANGE(0x420000, 0x420003) AM_DEVREADWRITE("eeprom", dragngun_eeprom_r, dragngun_eeprom_w)
|
||||
AM_RANGE(0x438000, 0x438003) AM_READ(dragngun_lightgun_r)
|
||||
AM_RANGE(0x430000, 0x43001f) AM_WRITE(dragngun_lightgun_w)
|
||||
AM_RANGE(0x440000, 0x440003) AM_READ(dragngun_service_r)
|
||||
@ -834,7 +836,7 @@ static ADDRESS_MAP_START( lockload_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x300000, 0x3fffff) AM_ROM
|
||||
|
||||
AM_RANGE(0x400000, 0x400003) AM_DEVREADWRITE8("oki3", okim6295_r, okim6295_w, 0x000000ff)
|
||||
AM_RANGE(0x420000, 0x420003) AM_READWRITE(dragngun_eeprom_r, dragngun_eeprom_w)
|
||||
AM_RANGE(0x420000, 0x420003) AM_DEVREADWRITE("eeprom", dragngun_eeprom_r, dragngun_eeprom_w)
|
||||
// AM_RANGE(0x430000, 0x43001f) AM_WRITE(dragngun_lightgun_w)
|
||||
// AM_RANGE(0x438000, 0x438003) AM_READ(dragngun_lightgun_r)
|
||||
AM_RANGE(0x440000, 0x440003) AM_READ(dragngun_service_r)
|
||||
@ -1609,50 +1611,12 @@ static const ym2151_interface ym2151_interface_nslasher =
|
||||
sound_bankswitch_w
|
||||
};
|
||||
|
||||
static const UINT8 tattass_default_eprom[0x160] =
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x4a,0x45,0x4b,0x19,
|
||||
0x4e,0x4c,0x4b,0x14,0x4b,0x4a,0x4d,0x0f, 0x42,0x4c,0x53,0x0c,0x4a,0x57,0x43,0x0a,
|
||||
0x41,0x44,0x51,0x0a,0x4a,0x41,0x4b,0x09, 0x4b,0x52,0x54,0x08,0x4c,0x4f,0x4e,0x08,
|
||||
0x4c,0x46,0x53,0x07,0x53,0x4c,0x53,0x05, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x01,0x01,0x01, 0x01,0x00,0x00,0x00,0x00,0x01,0x01,0x01,
|
||||
0x01,0x02,0x02,0xff,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x63,0x00,0x00,0x00, 0x02,0x03,0x00,0x03,0x00,0x00,0x00,0x02,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
static const eeprom_interface eeprom_interface_tattass =
|
||||
{
|
||||
10, // address bits 10 ==> } 1024 byte eprom
|
||||
8, // data bits 8
|
||||
};
|
||||
|
||||
static NVRAM_HANDLER(tattass)
|
||||
{
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(machine, &eeprom_interface_tattass);
|
||||
if (file) eeprom_load(file);
|
||||
else memcpy(eeprom_get_data_pointer(NULL,NULL),tattass_default_eprom,0x160);
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
static MACHINE_RESET( deco32 )
|
||||
@ -1729,7 +1693,7 @@ static MACHINE_DRIVER_START( fghthist )
|
||||
MDRV_CPU_ADD("audiocpu", H6280, 32220000/8)
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_NVRAM_HANDLER(93C46)
|
||||
MDRV_EEPROM_93C46_ADD("eeprom")
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
|
||||
@ -1775,7 +1739,7 @@ static MACHINE_DRIVER_START( fghthsta )
|
||||
MDRV_CPU_ADD("audiocpu", H6280, 32220000/8)
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_NVRAM_HANDLER(93C46)
|
||||
MDRV_EEPROM_93C46_ADD("eeprom")
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
|
||||
@ -1822,7 +1786,7 @@ static MACHINE_DRIVER_START( dragngun )
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_MACHINE_RESET(deco32)
|
||||
MDRV_NVRAM_HANDLER(93C46)
|
||||
MDRV_EEPROM_93C46_ADD("eeprom")
|
||||
|
||||
MDRV_TIMER_ADD("int_timer", interrupt_gen)
|
||||
|
||||
@ -1877,7 +1841,7 @@ static MACHINE_DRIVER_START( lockload )
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_MACHINE_RESET(deco32)
|
||||
MDRV_NVRAM_HANDLER(93C46)
|
||||
MDRV_EEPROM_93C46_ADD("eeprom")
|
||||
|
||||
MDRV_TIMER_ADD("int_timer", interrupt_gen)
|
||||
|
||||
@ -1932,7 +1896,7 @@ static MACHINE_DRIVER_START( tattass )
|
||||
MDRV_CPU_PROGRAM_MAP(tattass_sound_map)
|
||||
MDRV_CPU_PERIODIC_INT(tattass_snd_interrupt, 489) /* Fixed FIRQ of 489Hz as measured on real (pinball) machine */
|
||||
|
||||
MDRV_NVRAM_HANDLER(tattass)
|
||||
MDRV_EEPROM_ADD("eeprom", eeprom_interface_tattass)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
|
||||
@ -1970,7 +1934,7 @@ static MACHINE_DRIVER_START( nslasher )
|
||||
|
||||
MDRV_QUANTUM_TIME(HZ(6000)) /* to improve main<->audio comms */
|
||||
|
||||
MDRV_NVRAM_HANDLER(93C46)
|
||||
MDRV_EEPROM_93C46_ADD("eeprom")
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
|
||||
@ -2815,6 +2779,9 @@ ROM_START( tattass )
|
||||
ROM_LOAD( "u21.snd", 0x080000, 0x80000, CRC(10b2110c) SHA1(83e5938ed22da2874022e1dc8df76c72d95c448d) )
|
||||
ROM_LOAD( "u36.snd", 0x100000, 0x80000, CRC(3b73abe2) SHA1(195096e2302e84123b23b4ccd982fb3ab9afe42c) )
|
||||
ROM_LOAD( "u37.snd", 0x180000, 0x80000, CRC(986066b5) SHA1(9dd1a14de81733617cf51293674a8e26fc5cec68) )
|
||||
|
||||
ROM_REGION( 0x400, "eeprom", 0 )
|
||||
ROM_LOAD( "eeprom-tattass.bin", 0x0000, 0x0400, CRC(7140f40c) SHA1(4fb7897933046b6adaf00b4626d5fd23d0e8a666) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( tattassa )
|
||||
@ -2885,6 +2852,9 @@ ROM_START( tattassa )
|
||||
ROM_LOAD( "u21.snd", 0x080000, 0x80000, CRC(10b2110c) SHA1(83e5938ed22da2874022e1dc8df76c72d95c448d) )
|
||||
ROM_LOAD( "u36.snd", 0x100000, 0x80000, CRC(3b73abe2) SHA1(195096e2302e84123b23b4ccd982fb3ab9afe42c) )
|
||||
ROM_LOAD( "u37.snd", 0x180000, 0x80000, CRC(986066b5) SHA1(9dd1a14de81733617cf51293674a8e26fc5cec68) )
|
||||
|
||||
ROM_REGION( 0x400, "eeprom", 0 )
|
||||
ROM_LOAD( "eeprom-tattass.bin", 0x0000, 0x0400, CRC(7140f40c) SHA1(4fb7897933046b6adaf00b4626d5fd23d0e8a666) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( nslasher )
|
||||
|
@ -97,7 +97,7 @@
|
||||
|
||||
#include "driver.h"
|
||||
#include "includes/decocrpt.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "machine/eepromdev.h"
|
||||
#include "sound/ymz280b.h"
|
||||
#include "includes/decoprot.h"
|
||||
#include "cpu/arm/arm.h"
|
||||
@ -136,21 +136,21 @@ static READ32_HANDLER(test3_r)
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
static WRITE32_HANDLER( avengrs_eprom_w )
|
||||
static WRITE32_DEVICE_HANDLER( avengrs_eprom_w )
|
||||
{
|
||||
if (ACCESSING_BITS_8_15) {
|
||||
UINT8 ebyte=(data>>8)&0xff;
|
||||
// if (ebyte&0x80) {
|
||||
eeprom_set_clock_line((ebyte & 0x2) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eeprom_write_bit(ebyte & 0x1);
|
||||
eeprom_set_cs_line((ebyte & 0x4) ? CLEAR_LINE : ASSERT_LINE);
|
||||
eepromdev_set_clock_line(device, (ebyte & 0x2) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eepromdev_write_bit(device, ebyte & 0x1);
|
||||
eepromdev_set_cs_line(device, (ebyte & 0x4) ? CLEAR_LINE : ASSERT_LINE);
|
||||
// }
|
||||
}
|
||||
else if (ACCESSING_BITS_0_7) {
|
||||
//volume control todo
|
||||
}
|
||||
else
|
||||
logerror("%08x: eprom_w %08x mask %08x\n",cpu_get_pc(space->cpu),data,mem_mask);
|
||||
logerror("%s: eprom_w %08x mask %08x\n",cpuexec_describe_context(device->machine),data,mem_mask);
|
||||
}
|
||||
|
||||
static WRITE32_HANDLER( avengrs_palette_w )
|
||||
@ -279,7 +279,7 @@ static ADDRESS_MAP_START( decomlc_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x0400000, 0x0400003) AM_READ_PORT("INPUTS") AM_MIRROR(0xff000000)
|
||||
AM_RANGE(0x0440000, 0x044001f) AM_READ(test3_r) AM_MIRROR(0xff000000)
|
||||
AM_RANGE(0x044001c, 0x044001f) AM_WRITENOP AM_MIRROR(0xff000000)
|
||||
AM_RANGE(0x0500000, 0x0500003) AM_WRITE(avengrs_eprom_w) AM_MIRROR(0xff000000)
|
||||
AM_RANGE(0x0500000, 0x0500003) AM_DEVWRITE("eeprom", avengrs_eprom_w) AM_MIRROR(0xff000000)
|
||||
AM_RANGE(0x0600000, 0x0600007) AM_DEVREADWRITE8("ymz", ymz280b_r, ymz280b_w, 0xff000000) AM_MIRROR(0xff000000)
|
||||
AM_RANGE(0x070f000, 0x070ffff) AM_READ(stadhr96_prot_146_r) AM_MIRROR(0xff000000)
|
||||
// AM_RANGE(0x070f000, 0x070ffff) AM_READ(stadhr96_prot_146_w) AM_BASE(&deco32_prot_ram)
|
||||
@ -313,7 +313,7 @@ static INPUT_PORTS_START( mlc )
|
||||
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
|
||||
PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit)
|
||||
PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
@ -382,25 +382,6 @@ static MACHINE_RESET( mlc )
|
||||
raster_irq_timer = devtag_get_device(machine, "int_timer");
|
||||
}
|
||||
|
||||
static NVRAM_HANDLER( mlc )
|
||||
{
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(machine, &eeprom_interface_93C46); // actually 93C45
|
||||
|
||||
if (file) eeprom_load(file);
|
||||
else
|
||||
{
|
||||
UINT8* defaultram = memory_region(machine, "defaults");
|
||||
|
||||
if (defaultram)
|
||||
eeprom_set_data(defaultram, memory_region_length(machine, "defaults"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( avengrgs )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -408,7 +389,7 @@ static MACHINE_DRIVER_START( avengrgs )
|
||||
MDRV_CPU_PROGRAM_MAP(decomlc_map)
|
||||
|
||||
MDRV_MACHINE_RESET(mlc)
|
||||
MDRV_NVRAM_HANDLER(mlc) /* Actually 93c45 */
|
||||
MDRV_EEPROM_93C46_ADD("eeprom") /* Actually 93c45 */
|
||||
|
||||
MDRV_TIMER_ADD("int_timer", interrupt_gen)
|
||||
|
||||
@ -441,7 +422,7 @@ static MACHINE_DRIVER_START( mlc )
|
||||
MDRV_CPU_PROGRAM_MAP(decomlc_map)
|
||||
|
||||
MDRV_MACHINE_RESET(mlc)
|
||||
MDRV_NVRAM_HANDLER(mlc) /* Actually 93c45 */
|
||||
MDRV_EEPROM_93C46_ADD("eeprom") /* Actually 93c45 */
|
||||
|
||||
MDRV_TIMER_ADD("int_timer", interrupt_gen)
|
||||
|
||||
@ -667,8 +648,8 @@ ROM_START( skullfng )
|
||||
ROM_LOAD( "mch-06.6a", 0x200000, 0x200000, CRC(b2efe4ae) SHA1(5a9dab74c2ba73a65e8f1419b897467804734fa2) )
|
||||
ROM_LOAD( "mch-07.11j", 0x400000, 0x200000, CRC(bc1a50a1) SHA1(3de191fbc92d2ae84e54263f1c70afec6ff7cc3c) )
|
||||
|
||||
ROM_REGION( 0x80, "defaults", ROMREGION_ERASE00 )
|
||||
ROM_LOAD_OPTIONAL( "skullfng.eeprom", 0x00, 0x80, CRC(240d882e) SHA1(3c1a15ccac91d95b02a8c54b051aa64ff28ce2ab) )
|
||||
ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "skullfng.eeprom", 0x00, 0x80, CRC(240d882e) SHA1(3c1a15ccac91d95b02a8c54b051aa64ff28ce2ab) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( skullfngj )
|
||||
@ -691,8 +672,8 @@ ROM_START( skullfngj )
|
||||
ROM_LOAD( "mch-06.6a", 0x200000, 0x200000, CRC(b2efe4ae) SHA1(5a9dab74c2ba73a65e8f1419b897467804734fa2) )
|
||||
ROM_LOAD( "mch-07.11j", 0x400000, 0x200000, CRC(bc1a50a1) SHA1(3de191fbc92d2ae84e54263f1c70afec6ff7cc3c) )
|
||||
|
||||
ROM_REGION( 0x80, "defaults", ROMREGION_ERASE00 )
|
||||
ROM_LOAD_OPTIONAL( "skullfng.eeprom", 0x00, 0x80, CRC(240d882e) SHA1(3c1a15ccac91d95b02a8c54b051aa64ff28ce2ab) )
|
||||
ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "skullfng.eeprom", 0x00, 0x80, CRC(240d882e) SHA1(3c1a15ccac91d95b02a8c54b051aa64ff28ce2ab) )
|
||||
ROM_END
|
||||
|
||||
/***************************************************************************/
|
||||
|
@ -26,7 +26,7 @@ dip 1X8
|
||||
|
||||
#include "driver.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "machine/eepromdev.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "machine/8255ppi.h"
|
||||
#include "video/mc6845.h"
|
||||
@ -63,21 +63,21 @@ static VIDEO_UPDATE(fortecar)
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
|
||||
{
|
||||
eeprom_write_bit(data & 0x04);
|
||||
eeprom_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
|
||||
eeprom_set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
|
||||
eepromdev_write_bit(device, data & 0x04);
|
||||
eepromdev_set_cs_line(device, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
|
||||
eepromdev_set_clock_line(device, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
static READ8_DEVICE_HANDLER( ppi0_portc_r )
|
||||
{
|
||||
// popmessage("%s",cpuexec_describe_context(device->machine));
|
||||
return (~(eeprom_read_bit()<<1) & 2);
|
||||
return (~(eepromdev_read_bit(device)<<1) & 2);
|
||||
}
|
||||
|
||||
static const ppi8255_interface ppi0intf =
|
||||
{
|
||||
DEVCB_INPUT_PORT("DSW1"), DEVCB_INPUT_PORT("IN2"), DEVCB_HANDLER(ppi0_portc_r),
|
||||
DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(ppi0_portc_w)
|
||||
DEVCB_INPUT_PORT("DSW1"), DEVCB_INPUT_PORT("IN2"), DEVCB_DEVICE_HANDLER("eeprom", ppi0_portc_r),
|
||||
DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_HANDLER("eeprom", ppi0_portc_w)
|
||||
};
|
||||
|
||||
|
||||
@ -277,33 +277,6 @@ static const mc6845_interface mc6845_intf =
|
||||
};
|
||||
|
||||
//51f
|
||||
static const UINT8 default_eeprom[128]=
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
static NVRAM_HANDLER(fortecar)
|
||||
{
|
||||
if (read_or_write)
|
||||
eeprom_save(file);
|
||||
else
|
||||
{
|
||||
eeprom_init(machine, &eeprom_interface_93C46);
|
||||
|
||||
if (file)
|
||||
eeprom_load(file);
|
||||
else
|
||||
eeprom_set_data(default_eeprom,128);
|
||||
}
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( fortecar )
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", Z80,6000000) /* ? MHz */
|
||||
@ -320,7 +293,9 @@ static MACHINE_DRIVER_START( fortecar )
|
||||
MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 256-1)
|
||||
|
||||
MDRV_MACHINE_RESET(fortecar)
|
||||
MDRV_NVRAM_HANDLER(fortecar)
|
||||
|
||||
MDRV_EEPROM_93C46_ADD("eeprom")
|
||||
MDRV_EEPROM_DEFAULT_VALUE(0)
|
||||
|
||||
MDRV_PPI8255_ADD("fcppi0", ppi0intf)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user