mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add support for dumping Master System / Sega Mark III cartridges using a Retrode.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Aaru" type="DotNetProject" factoryName=".NET Project">
|
<configuration default="false" name="Aaru" type="DotNetProject" factoryName=".NET Project">
|
||||||
<option name="EXE_PATH" value="$PROJECT_DIR$/Aaru/bin/Debug/net6/aaru" />
|
<option name="EXE_PATH" value="$PROJECT_DIR$/Aaru/bin/Debug/net6/aaru" />
|
||||||
<option name="PROGRAM_PARAMETERS" value="m dump /dev/sdb foo2.md" />
|
<option name="PROGRAM_PARAMETERS" value="m dump /dev/sda foo3.sms" />
|
||||||
<option name="WORKING_DIRECTORY" value="$USER_HOME$/Desktop" />
|
<option name="WORKING_DIRECTORY" value="$USER_HOME$/Desktop" />
|
||||||
<option name="PASS_PARENT_ENVS" value="1" />
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ public partial class Dump
|
|||||||
0x42, 0x49, 0x4E
|
0x42, 0x49, 0x4E
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static readonly byte[] _smsExtension =
|
||||||
|
{
|
||||||
|
0x53, 0x4D, 0x53
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>Dumps a game cartridge using a Retrode adapter</summary>
|
/// <summary>Dumps a game cartridge using a Retrode adapter</summary>
|
||||||
void Retrode()
|
void Retrode()
|
||||||
{
|
{
|
||||||
@@ -100,6 +105,7 @@ public partial class Dump
|
|||||||
int romPos;
|
int romPos;
|
||||||
bool sfcFound = false;
|
bool sfcFound = false;
|
||||||
bool genesisFound = false;
|
bool genesisFound = false;
|
||||||
|
bool smsFound = false;
|
||||||
tmp = new byte[3];
|
tmp = new byte[3];
|
||||||
|
|
||||||
for(romPos = 0; romPos < buffer.Length; romPos += 0x20)
|
for(romPos = 0; romPos < buffer.Length; romPos += 0x20)
|
||||||
@@ -119,10 +125,18 @@ public partial class Dump
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(tmp.SequenceEqual(_smsExtension))
|
||||||
|
{
|
||||||
|
smsFound = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!sfcFound &&
|
if(!sfcFound &&
|
||||||
!genesisFound)
|
!genesisFound &&
|
||||||
|
!smsFound)
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke("No cartridge found, not dumping...");
|
StoppingErrorMessage?.Invoke("No cartridge found, not dumping...");
|
||||||
_dumpLog.WriteLine("No cartridge found, not dumping...");
|
_dumpLog.WriteLine("No cartridge found, not dumping...");
|
||||||
@@ -133,7 +147,12 @@ public partial class Dump
|
|||||||
ushort cluster = BitConverter.ToUInt16(buffer, romPos + 0x1A);
|
ushort cluster = BitConverter.ToUInt16(buffer, romPos + 0x1A);
|
||||||
uint romSize = BitConverter.ToUInt32(buffer, romPos + 0x1C);
|
uint romSize = BitConverter.ToUInt32(buffer, romPos + 0x1C);
|
||||||
|
|
||||||
MediaType mediaType = genesisFound ? MediaType.MegaDriveCartridge : MediaType.SNESGamePak;
|
MediaType mediaType = smsFound
|
||||||
|
? MediaType.MasterSystemCartridge
|
||||||
|
: genesisFound
|
||||||
|
? MediaType.MegaDriveCartridge
|
||||||
|
: MediaType.SNESGamePak;
|
||||||
|
|
||||||
uint blocksToRead = 64;
|
uint blocksToRead = 64;
|
||||||
double totalDuration = 0;
|
double totalDuration = 0;
|
||||||
double currentSpeed = 0;
|
double currentSpeed = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user