mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add support for dumping Nintendo 64 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/sda foo3.sms" />
|
<option name="PROGRAM_PARAMETERS" value="m dump /dev/sda foo4.z64" />
|
||||||
<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" />
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ public partial class Dump
|
|||||||
0x53, 0x4D, 0x53
|
0x53, 0x4D, 0x53
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static readonly byte[] _z64Extension =
|
||||||
|
{
|
||||||
|
0x5A, 0x36, 0x34
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>Dumps a game cartridge using a Retrode adapter</summary>
|
/// <summary>Dumps a game cartridge using a Retrode adapter</summary>
|
||||||
void Retrode()
|
void Retrode()
|
||||||
{
|
{
|
||||||
@@ -106,6 +111,7 @@ public partial class Dump
|
|||||||
bool sfcFound = false;
|
bool sfcFound = false;
|
||||||
bool genesisFound = false;
|
bool genesisFound = false;
|
||||||
bool smsFound = false;
|
bool smsFound = false;
|
||||||
|
bool n64Found = 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)
|
||||||
@@ -132,11 +138,19 @@ public partial class Dump
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(tmp.SequenceEqual(_z64Extension))
|
||||||
|
{
|
||||||
|
n64Found = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!sfcFound &&
|
if(!sfcFound &&
|
||||||
!genesisFound &&
|
!genesisFound &&
|
||||||
!smsFound)
|
!smsFound &&
|
||||||
|
!n64Found)
|
||||||
{
|
{
|
||||||
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...");
|
||||||
@@ -147,7 +161,9 @@ 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 = smsFound
|
MediaType mediaType = n64Found
|
||||||
|
? MediaType.N64GamePak
|
||||||
|
: smsFound
|
||||||
? MediaType.MasterSystemCartridge
|
? MediaType.MasterSystemCartridge
|
||||||
: genesisFound
|
: genesisFound
|
||||||
? MediaType.MegaDriveCartridge
|
? MediaType.MegaDriveCartridge
|
||||||
|
|||||||
Reference in New Issue
Block a user