fixed header detection when loading from fullpath in snesnew. nw.

This commit is contained in:
Fabio Priuli 2013-03-14 06:44:15 +00:00
parent f8114c7dea
commit 1999097a54

View File

@ -832,13 +832,16 @@ const char * base_sns_cart_slot_device::get_default_card_software(const machine_
if (fullpath) if (fullpath)
{ {
UINT32 offset = 0;
UINT32 len = core_fsize(m_file); UINT32 len = core_fsize(m_file);
UINT8 *ROM = global_alloc_array(UINT8, len); UINT8 *ROM = global_alloc_array(UINT8, len);
int type; int type;
core_fread(m_file, ROM, len); core_fread(m_file, ROM, len);
type = get_cart_type(ROM, len); offset = snes_skip_header(ROM, len);
type = get_cart_type(ROM + offset, len - offset);
slot_string = sns_get_slot(type); slot_string = sns_get_slot(type);
global_free(ROM); global_free(ROM);