diff options
| author | 2025-07-26 02:19:11 +0100 | |
|---|---|---|
| committer | 2025-07-25 21:19:11 -0400 | |
| commit | ef989065d9a4fb60bdab38c1de6c35c062e2bcd8 (patch) | |
| tree | b3b5148812c9bf551f6e33cfc7e6a7b021e01dcb /src | |
| parent | cbf84129bffe7335fd06132ae8254ec47b052d5d (diff) | |
Juicebox - allow loading of raw ROM dumps from Software List, add 6 new dumps to the SL (#13955)
* allow Juicebox to load raw ROMs from the software list
* verified some carts, added 2 new dumps
* add 2 more
* added 2 more bootable sets, replace an old dump
---------
Co-authored-by: David Haywood <hazemamewip@hotmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/devices/machine/smartmed.cpp | 39 | ||||
| -rw-r--r-- | src/devices/machine/smartmed.h | 2 |
2 files changed, 35 insertions, 6 deletions
diff --git a/src/devices/machine/smartmed.cpp b/src/devices/machine/smartmed.cpp index 75473c8922d..ccfe113d786 100644 --- a/src/devices/machine/smartmed.cpp +++ b/src/devices/machine/smartmed.cpp @@ -165,16 +165,25 @@ int smartmedia_image_device::detect_geometry( uint8_t id1, uint8_t id2) return result; } -std::error_condition smartmedia_image_device::smartmedia_format_2() +std::error_condition smartmedia_image_device::smartmedia_format_2(bool read_header, uint8_t id1, uint8_t id2) { std::error_condition err; size_t bytes_read; disk_image_format_2_header custom_header; - std::tie(err, bytes_read) = read(image_core_file(), &custom_header, sizeof(custom_header)); - if (err || (bytes_read != sizeof(custom_header))) - return err ? err : std::errc::io_error; + if (read_header) + { + std::tie(err, bytes_read) = read(image_core_file(), &custom_header, sizeof(custom_header)); + if (err || (bytes_read != sizeof(custom_header))) + return err ? err : std::errc::io_error; + } + else + { + memset(&custom_header, 0x00, sizeof(custom_header)); + custom_header.data1[0] = id1; + custom_header.data1[1] = id2; + } if ((custom_header.data1[0] != 0xEC) && (custom_header.data1[0] != 0x98)) return image_error::INVALIDIMAGE; @@ -222,14 +231,34 @@ std::error_condition smartmedia_image_device::smartmedia_format_2() std::pair<std::error_condition, std::string> smartmedia_image_device::call_load() { std::error_condition result; + + // if we're loading through the softlist give the option of the geometry being specified there, so that raw flash dumps can be loaded. + if (loaded_through_softlist()) + { + logerror("Using softlists\n"); + const char* nandtype1 = get_feature("nandtype1"); + const char* nandtype2 = get_feature("nandtype2"); + + if (nandtype1 && nandtype2) + { + result = smartmedia_format_2(false, std::stoi(nandtype1,nullptr,0), std::stoi(nandtype2, nullptr,0)); + return std::make_pair(result, std::string()); + } + else + { + logerror("No NAND type specified\n"); + } + } + // try format 1 uint64_t const position = ftell(); + result = smartmedia_format_1(); if (result) { // try format 2 fseek(position, SEEK_SET); - result = smartmedia_format_2(); + result = smartmedia_format_2(true); } return std::make_pair(result, std::string()); } diff --git a/src/devices/machine/smartmed.h b/src/devices/machine/smartmed.h index cf029b7c3a7..a3e8809d03c 100644 --- a/src/devices/machine/smartmed.h +++ b/src/devices/machine/smartmed.h @@ -44,7 +44,7 @@ protected: virtual const software_list_loader &get_software_list_loader() const override; std::error_condition smartmedia_format_1(); - std::error_condition smartmedia_format_2(); + std::error_condition smartmedia_format_2(bool read_header, uint8_t id1 = 0, uint8_t id2 = 0); int detect_geometry(uint8_t id1, uint8_t id2); uint8_t m_mp_opcode; // multi-plane operation code |
