master
Nabile Rahmani 2018-12-11 20:47:19 +01:00
parent 7b9ad33be2
commit 719107d459
6 changed files with 17 additions and 17 deletions

View File

@ -43,8 +43,8 @@ namespace DotN64.Desktop
switch (arg)
{
case "--pif-rom":
options.BootROM = args[++i];
case "--ipl":
options.IPL = args[++i];
break;
case "--debug":
case "-d":
@ -178,7 +178,7 @@ namespace DotN64.Desktop
Console.WriteLine($"ID: {cartridge.ID}");
Console.WriteLine($"Version: {1.0f + (cartridge.Version & ((1 << 4) - 1) >> 4) + (cartridge.Version & ((1 << 4) - 1)) * 0.1f:0.0}");
Console.WriteLine($"Media format: {cartridge.Format}");
Console.WriteLine($"Country: {cartridge.Country}");
Console.WriteLine($"Region: {cartridge.Region}");
Console.WriteLine($"Size: {cartridge.ROM.Length / (float)0x100000:0.##} MB");
Console.WriteLine($"CRC: 0x{cartridge.CRC[0]:X8}, 0x{cartridge.CRC[1]:X8}");
Console.WriteLine($"Boot address: 0x{cartridge.BootAddress:X8}");
@ -204,8 +204,8 @@ namespace DotN64.Desktop
nintendo64.CartridgeSwapped += (n, c) => window.Title = nameof(DotN64) + (c != null ? $" - {c.ImageName.Trim()}" : string.Empty);
}
if (options.BootROM != null)
nintendo64.PIF.BootROM = File.ReadAllBytes(options.BootROM);
if (options.IPL != null)
nintendo64.PIF.IPL = File.ReadAllBytes(options.IPL);
if (options.Cartridge != null)
nintendo64.Cartridge = LoadCartridge(options.Cartridge);
@ -235,7 +235,7 @@ namespace DotN64.Desktop
Console.WriteLine();
Console.WriteLine("ROM image: Opens the file as a game cartridge.");
Console.WriteLine("Options:");
Console.WriteLine("\t--pif-rom <path>: Loads the PIF's boot ROM into the machine.");
Console.WriteLine("\t--ipl <path>: Loads the PIF's boot ROM into the machine.");
Console.WriteLine("\t-d, --debug: Launches the debugger for the Nintendo 64's CPU.");
Console.WriteLine("\t-u, --update [action]: Updates the program.");
Console.WriteLine("\t\t[action = 'check', 'c']: Checks for a new update.");
@ -254,7 +254,7 @@ namespace DotN64.Desktop
{
#region Fields
public bool UseDebugger, NoVideo, FullScreenVideo, BorderlessWindow;
public string BootROM, Cartridge;
public string IPL, Cartridge;
public Point? VideoResolution;
#endregion
}

View File

@ -5,7 +5,7 @@
/// <summary>
/// See: https://archive.org/13/items/SNESDevManual/book1.pdf #1-2-20.
/// </summary>
public enum CountryCode : byte
public enum RegionCode : byte
{
Common = (byte)'A',
Brazil = (byte)'B',

View File

@ -33,7 +33,7 @@ namespace DotN64
public MediaFormat Format => (MediaFormat)ROM[0x3B];
public CountryCode Country => (CountryCode)ROM[0x3E];
public RegionCode Region => (RegionCode)ROM[0x3E];
public byte Version => ROM[0x3F];
#endregion

View File

@ -87,7 +87,7 @@
<Compile Include="CPU\VR4300\CP1\VR4300.FloatingPointUnit.cs" />
<Compile Include="PIF\PeripheralInterface.TVType.cs" />
<Compile Include="Cartridge.MediaFormat.cs" />
<Compile Include="Cartridge.CountryCode.cs" />
<Compile Include="Cartridge.RegionCode.cs" />
<Compile Include="CPU\VR4300\CP1\VR4300.FloatingPointUnit.OpCode.cs" />
<Compile Include="CPU\VR4300\CP1\VR4300.FloatingPointUnit.Register.cs" />
<Compile Include="CPU\VR4300\CP1\VR4300.FloatingPointUnit.ImplementationRevisionRegister.cs" />

View File

@ -15,7 +15,7 @@ namespace DotN64
#endregion
#region Properties
public byte[] BootROM { get; set; }
public byte[] IPL { get; set; }
public byte[] RAM { get; } = new byte[64];
@ -106,12 +106,12 @@ namespace DotN64
/// </summary>
private TVType GetRegion()
{
switch (nintendo64.Cartridge?.Country)
switch (nintendo64.Cartridge?.Region)
{
case Cartridge.CountryCode.NorthAmerica:
case Cartridge.CountryCode.Japan:
case Cartridge.RegionCode.NorthAmerica:
case Cartridge.RegionCode.Japan:
return TVType.NTSC;
case Cartridge.CountryCode.Brazil:
case Cartridge.RegionCode.Brazil:
return TVType.MPAL;
default:
return TVType.PAL;
@ -135,7 +135,7 @@ namespace DotN64
{
DetectDevice();
if (BootROM == null)
if (IPL == null)
EmulateBootROM();
}
#endregion

View File

@ -31,7 +31,7 @@ namespace DotN64.RCP
},
new MappingEntry(0x1FC00000, 0x1FC007BF) // PIF Boot ROM.
{
Read = o => BitHelper.FromBigEndian(BitConverter.ToUInt32(PIF.BootROM, (int)o))
Read = o => BitHelper.FromBigEndian(BitConverter.ToUInt32(PIF.IPL, (int)o))
},
new MappingEntry(0x1FC007C0, 0x1FC007FF) // PIF (JoyChannel) RAM.
{