objdump doesn't work with VS binaries, so do not run it by Firewave (no whatsnew)

fixed uninitialized field in ioport_field.m_chars (fixes stack 
corruption with three PORT_CHAR definitions) / added some sanity 
checks for PORT_CHAR adding and lookup by Firewave

Intel 28F320J3D flash support by Lukasz Markowski

snapquik.c  fixed uninitialized variable that causes random assertion 
failure by Sandro Ronco
This commit is contained in:
Miodrag Milanovic 2012-05-15 06:56:17 +00:00
parent 640d7789ac
commit 07ee4afaba
5 changed files with 70 additions and 25 deletions

View File

@ -761,9 +761,11 @@ $(EMULATOR): $(VERSIONOBJ) $(EMUINFOOBJ) $(DRIVLISTOBJ) $(DRVLIBS) $(LIBOSD) $(L
$(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
ifeq ($(TARGETOS),win32)
ifdef SYMBOLS
ifndef MSVC_BUILD
$(OBJDUMP) --section=.text --line-numbers --syms --demangle $@ >$(FULLNAME).sym
endif
endif
endif
endif

View File

@ -18,13 +18,15 @@ const device_type SNAPSHOT = &device_creator<snapshot_image_device>;
snapshot_image_device::snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, SNAPSHOT, "Snapshot", tag, owner, clock),
device_image_interface(mconfig, *this)
device_image_interface(mconfig, *this),
m_delay_attoseconds(0)
{
}
snapshot_image_device::snapshot_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, type, name, tag, owner, clock),
device_image_interface(mconfig, *this)
device_image_interface(mconfig, *this),
m_delay_attoseconds(0)
{
}
//-------------------------------------------------

View File

@ -1660,7 +1660,7 @@ ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value def
// reset sequences and chars
for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
m_seq[seqtype].set_default();
m_chars[0] = m_chars[1] = m_chars[2] = unicode_char(0);
m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = unicode_char(0);
// for DIP switches and configs, look for a default value from the owner
if (type == IPT_DIPSWITCH || type == IPT_CONFIG)
@ -1832,7 +1832,12 @@ ioport_type_class ioport_field::type_class() const
unicode_char ioport_field::keyboard_code(int which) const
{
unicode_char ch = m_chars[which];
unicode_char ch;
if (which >= ARRAY_LENGTH(m_chars))
throw emu_fatalerror("Tried to access keyboard_code with out-of-range index %d\n", which);
ch = m_chars[which];
// special hack to allow for PORT_CODE('\xA3')
if (ch >= 0xffffff80 && ch <= 0xffffffff)
@ -3842,8 +3847,10 @@ void ioport_configurer::field_add_char(unicode_char ch)
if (m_curfield->m_chars[index] == 0)
{
m_curfield->m_chars[index] = ch;
break;
return;
}
throw emu_fatalerror("PORT_CHAR(%d) could not be added - maximum amount exceeded\n", ch);
}

View File

@ -92,6 +92,7 @@ const device_type SHARP_LH28F400 = &device_creator<sharp_lh28f400_device>;
const device_type INTEL_E28F008SA = &device_creator<intel_e28f008sa_device>;
const device_type INTEL_TE28F160 = &device_creator<intel_te28f160_device>;
const device_type SHARP_UNK128MBIT = &device_creator<sharp_unk128mbit_device>;
const device_type INTEL_28F320J3D = &device_creator<intel_28f320j3d_device>;
static ADDRESS_MAP_START( memory_map8_512Kb, AS_PROGRAM, 8, intelfsh_device )
AM_RANGE(0x00000, 0x00ffff) AM_RAM
@ -122,6 +123,10 @@ static ADDRESS_MAP_START( memory_map16_16Mb, AS_PROGRAM, 16, intelfsh_device )
AM_RANGE(0x00000, 0x0fffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( memory_map16_32Mb, AS_PROGRAM, 16, intelfsh_device )
AM_RANGE(0x00000, 0x1fffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( memory_map16_64Mb, AS_PROGRAM, 16, intelfsh_device )
AM_RANGE(0x00000, 0x3fffff) AM_RAM
ADDRESS_MAP_END
@ -187,6 +192,14 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type
m_device_id = 0xd5;
map = ADDRESS_MAP_NAME( memory_map8_8Mb );
break;
case FLASH_INTEL_28F320J3D:
m_bits = 16;
m_size = 0x400000;
m_maker_id = MFG_INTEL;
m_device_id = 0x16;
m_sector_is_4k = true;
map = ADDRESS_MAP_NAME( memory_map16_32Mb );
break;
case FLASH_SHARP_LH28F400:
case FLASH_INTEL_E28F400:
m_bits = 16;
@ -315,6 +328,8 @@ intel_e28f400_device::intel_e28f400_device(const machine_config &mconfig, const
sharp_unk128mbit_device::sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: intelfsh16_device(mconfig, SHARP_UNK128MBIT, "Sharp Unknown 128Mbit Flash", tag, owner, clock, FLASH_SHARP_UNK128MBIT) { }
intel_28f320j3d_device::intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: intelfsh16_device(mconfig, INTEL_28F320J3D, "Intel 28F320J3D Flash", tag, owner, clock, FLASH_INTEL_28F320J3D) { }
//-------------------------------------------------
// device_start - device-specific startup
@ -454,7 +469,7 @@ UINT32 intelfsh_device::read_full(UINT32 address)
data = m_status;
break;
case FM_READAMDID3:
if (m_maker_id == 0x04 && m_device_id == 0x35)
if (m_maker_id == MFG_FUJITSU && m_device_id == 0x35)
{
//used in Fujitsu 29DL16X 8bits mode
switch (address)
@ -475,27 +490,39 @@ UINT32 intelfsh_device::read_full(UINT32 address)
}
break;
case FM_READID:
switch (address)
if (m_maker_id == MFG_INTEL && m_device_id == 0x16)
{
case 0: // maker ID
data = m_maker_id;
break;
case 1: // chip ID
data = m_device_id;
break;
case 2: // block lock config
data = 0; // we don't support this yet
break;
case 3: // master lock config
if (m_flash_master_lock)
switch (address)
{
data = 1;
case 0: data = m_maker_id; break;
case 2: data = m_device_id; break;
case 4: data = 0; break;
}
else
}
else
{
switch (address)
{
data = 0;
case 0: // maker ID
data = m_maker_id;
break;
case 1: // chip ID
data = m_device_id;
break;
case 2: // block lock config
data = 0; // we don't support this yet
break;
case 3: // master lock config
if (m_flash_master_lock)
{
data = 1;
}
else
{
data = 0;
}
break;
}
break;
}
break;
case FM_ERASEAMD4:

View File

@ -55,7 +55,8 @@
#define MCFG_SHARP_UNK128MBIT_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SHARP_UNK128MBIT, 0)
#define MCFG_INTEL_28F320J3D_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, INTEL_28F320J3D, 0)
//**************************************************************************
// TYPE DEFINITIONS
@ -90,7 +91,8 @@ public:
FLASH_SHARP_LH28F400 = 0x1000,
FLASH_INTEL_E28F400,
FLASH_INTEL_TE28F160,
FLASH_SHARP_UNK128MBIT
FLASH_SHARP_UNK128MBIT,
FLASH_INTEL_28F320J3D
};
protected:
@ -266,6 +268,11 @@ public:
sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class intel_28f320j3d_device : public intelfsh16_device
{
public:
intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// device type definition
@ -285,6 +292,6 @@ extern const device_type SHARP_LH28F400;
extern const device_type INTEL_E28F008SA;
extern const device_type INTEL_TE28F160;
extern const device_type SHARP_UNK128MBIT;
extern const device_type INTEL_28F320J3D;
#endif