diff options
Diffstat (limited to 'src/devices/bus/nes/nes_slot.cpp')
-rw-r--r-- | src/devices/bus/nes/nes_slot.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp index fef76b520d0..53fc0a2f058 100644 --- a/src/devices/bus/nes/nes_slot.cpp +++ b/src/devices/bus/nes/nes_slot.cpp @@ -944,16 +944,17 @@ std::string nes_cart_slot_device::get_default_card_software(get_default_card_sof { if (hook.image_file()) { - const char *slot_string = "nrom"; - uint32_t len = hook.image_file()->size(); + uint64_t len; + hook.image_file()->length(len); // FIXME: check error return, guard against excessively large files std::vector<uint8_t> rom(len); - hook.image_file()->read(&rom[0], len); + size_t actual; + hook.image_file()->read(&rom[0], len, actual); // FIXME: check error return or read returning short + const char *slot_string = "nrom"; if ((rom[0] == 'N') && (rom[1] == 'E') && (rom[2] == 'S')) slot_string = get_default_card_ines(hook, &rom[0], len); - - if ((rom[0] == 'U') && (rom[1] == 'N') && (rom[2] == 'I') && (rom[3] == 'F')) + else if ((rom[0] == 'U') && (rom[1] == 'N') && (rom[2] == 'I') && (rom[3] == 'F')) slot_string = get_default_card_unif(&rom[0], len); return std::string(slot_string); |