mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Device: Fix coremini loading
For: - RADA2B - RADComet2 - RADComet3 - RADGalaxy2 - RADMoonT1S - RADStar2
This commit is contained in:
committed by
Kyle Schwarz
parent
8af6d5f2a8
commit
749552e443
+17
-14
@@ -737,15 +737,17 @@ bool Device::uploadCoremini(std::istream& stream, Disk::MemoryType memType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto connected = isLogicalDiskConnected();
|
||||
|
||||
if(!connected) {
|
||||
return false; // Already added an API error
|
||||
}
|
||||
|
||||
if(!(*connected)) {
|
||||
report(APIEvent::Type::DiskNotConnected, APIEvent::Severity::Error);
|
||||
return false;
|
||||
if (memType == Disk::MemoryType::SD) {
|
||||
auto connected = isLogicalDiskConnected();
|
||||
|
||||
if(!connected) {
|
||||
return false; // Already added an API error
|
||||
}
|
||||
|
||||
if(!(*connected)) {
|
||||
report(APIEvent::Type::DiskNotConnected, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!stopScript()) {
|
||||
@@ -756,7 +758,6 @@ bool Device::uploadCoremini(std::istream& stream, Disk::MemoryType memType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(!eraseScriptMemory(memType, static_cast<uint64_t>(bin.size()))) {
|
||||
return false;
|
||||
}
|
||||
@@ -846,10 +847,12 @@ std::optional<CoreminiHeader> Device::readCoreminiHeader(Disk::MemoryType memTyp
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
auto connected = isLogicalDiskConnected();
|
||||
|
||||
if(!connected) {
|
||||
return std::nullopt; // Already added an API error
|
||||
if (memType == Disk::MemoryType::SD) {
|
||||
auto connected = isLogicalDiskConnected();
|
||||
|
||||
if(!connected) {
|
||||
return std::nullopt; // Already added an API error
|
||||
}
|
||||
}
|
||||
|
||||
#pragma pack(push, 2)
|
||||
|
||||
Reference in New Issue
Block a user