src/emu/diimage.c
| r8648 | r8649 | |
| 180 | 180 | m_mame_file(NULL), |
| 181 | 181 | m_full_software_name(NULL), |
| 182 | 182 | m_software_info_ptr(NULL), |
| 183 | | m_software_part_ptr(NULL), |
| 184 | | m_hash(NULL) |
| 183 | m_software_part_ptr(NULL) |
| 185 | 184 | { |
| 186 | 185 | m_mempool = pool_alloc_lib(memory_error); |
| 187 | 186 | } |
| r8648 | r8649 | |
| 539 | 538 | goto done; |
| 540 | 539 | |
| 541 | 540 | /* look up this entry in the hash file */ |
| 542 | | info = hashfile_lookup(hashfile, m_hash); |
| 541 | info = hashfile_lookup(hashfile, m_hash.cstr()); |
| 543 | 542 | |
| 544 | 543 | if (!info) |
| 545 | 544 | goto done; |
| r8648 | r8649 | |
| 596 | 595 | int rc; |
| 597 | 596 | |
| 598 | 597 | /* 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) |
| 600 | 599 | { |
| 601 | 600 | /* do not cause a linear read of 600 megs please */ |
| 602 | 601 | /* TODO: use SHA/MD5 in the CHD header as the hash */ |
| r8648 | r8649 | |
| 631 | 630 | UINT32 crc = 0; |
| 632 | 631 | |
| 633 | 632 | 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()); |
| 636 | 635 | |
| 637 | 636 | return crc; |
| 638 | 637 | } |