r8649 Wednesday 28th July, 2010 at 07:20:33 UTC by Miodrag Milanović
Fixed image based cheat file loading.
[src/emu]diimage.c diimage.h

src/emu/diimage.c
r8648r8649
180180     m_mame_file(NULL),
181181     m_full_software_name(NULL),
182182     m_software_info_ptr(NULL),
183     m_software_part_ptr(NULL),
184     m_hash(NULL)
183     m_software_part_ptr(NULL)
185184{
186185   m_mempool = pool_alloc_lib(memory_error);
187186}
r8648r8649
539538        goto done;
540539
541540    /* look up this entry in the hash file */
542    info = hashfile_lookup(hashfile, m_hash);
541    info = hashfile_lookup(hashfile, m_hash.cstr());
543542
544543    if (!info)
545544        goto done;
r8648r8649
596595    int rc;
597596
598597    /* only calculate CRC if it hasn't been calculated, and the open_mode is read only */
599    if (!m_hash && !m_writeable && !m_created)
598    if (m_hash.len()==0 && !m_writeable && !m_created)
600599    {
601600        /* do not cause a linear read of 600 megs please */
602601        /* TODO: use SHA/MD5 in the CHD header as the hash */
r8648r8649
631630    UINT32 crc = 0;
632631
633632   image_checkhash();
634    if (m_hash != NULL)
635        crc = hash_data_extract_crc32(m_hash);
633    if (m_hash.len()!= 0)
634        crc = hash_data_extract_crc32(m_hash.cstr());
636635
637636    return crc;
638637}
src/emu/diimage.h
r8648r8649
327327
328328   object_pool *m_mempool;
329329
330   char *m_hash;
330   astring m_hash;
331331};
332332
333333

Previous 509070 RevisionsNext 50


© 1998-2010 The MESS Team