trunk/src/mess/machine/snescart.c
| r21749 | r21750 | |
| 330 | 330 | /* This determines if a cart is in Mode 20, 21, 22 or 25; sets state->m_cart[0].mode and |
| 331 | 331 | state->m_cart[0].sram_max accordingly; and returns the offset of the internal header |
| 332 | 332 | (needed to detect BSX and ST carts) */ |
| 333 | | static UINT32 snes_find_hilo_mode( device_image_interface &image, UINT8 *buffer, UINT32 len, int cartid ) |
| 333 | static UINT32 snes_find_hilo_mode( running_machine &machine, UINT8 *buffer, UINT32 len, int cartid ) |
| 334 | 334 | { |
| 335 | | snes_state *state = image.device().machine().driver_data<snes_state>(); |
| 335 | snes_state *state = machine.driver_data<snes_state>(); |
| 336 | 336 | UINT8 valid_mode20, valid_mode21, valid_mode25; |
| 337 | 337 | UINT32 retvalue; |
| 338 | 338 | |
| r21749 | r21750 | |
| 564 | 564 | static void snes_cart_log_info( running_machine &machine, UINT8* ROM, UINT32 len, int supported ) |
| 565 | 565 | { |
| 566 | 566 | snes_state *state = machine.driver_data<snes_state>(); |
| 567 | | device_image_interface *image = dynamic_cast<device_image_interface *>(machine.device("cart")); |
| 568 | 567 | char title[21], rom_id[4], company_id[2]; |
| 569 | 568 | int i, company, has_ram = 0, has_sram = 0; |
| 570 | | UINT32 hilo_mode = snes_find_hilo_mode(*image, ROM, len, 0); |
| 569 | UINT32 hilo_mode = snes_find_hilo_mode(machine, ROM, len, 0); |
| 571 | 570 | |
| 572 | 571 | /* Company */ |
| 573 | 572 | for (i = 0; i < 2; i++) |
| r21749 | r21750 | |
| 671 | 670 | rom_map_setup(m_cart[0].m_rom_size); |
| 672 | 671 | |
| 673 | 672 | // Check if the cart is HiROM or LoROM (and set variables accordingly) |
| 674 | | int_header_offs = snes_find_hilo_mode(image, m_cart[0].m_rom, m_cart[0].m_rom_size, 0); |
| 673 | int_header_offs = snes_find_hilo_mode(machine(), m_cart[0].m_rom, m_cart[0].m_rom_size, 0); |
| 675 | 674 | |
| 676 | 675 | // Detect BS-X carts: |
| 677 | 676 | // 1. Detect BS-X Flash Cart |