diff --git a/DotN64.Desktop/Program.cs b/DotN64.Desktop/Program.cs index cd5d611..e87dfe0 100644 --- a/DotN64.Desktop/Program.cs +++ b/DotN64.Desktop/Program.cs @@ -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 : Loads the PIF's boot ROM into the machine."); + Console.WriteLine("\t--ipl : 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 } diff --git a/DotN64/Cartridge.CountryCode.cs b/DotN64/Cartridge.RegionCode.cs similarity index 94% rename from DotN64/Cartridge.CountryCode.cs rename to DotN64/Cartridge.RegionCode.cs index eb3cabf..c20883d 100644 --- a/DotN64/Cartridge.CountryCode.cs +++ b/DotN64/Cartridge.RegionCode.cs @@ -5,7 +5,7 @@ /// /// See: https://archive.org/13/items/SNESDevManual/book1.pdf #1-2-20. /// - public enum CountryCode : byte + public enum RegionCode : byte { Common = (byte)'A', Brazil = (byte)'B', diff --git a/DotN64/Cartridge.cs b/DotN64/Cartridge.cs index 9fa096d..751ea99 100644 --- a/DotN64/Cartridge.cs +++ b/DotN64/Cartridge.cs @@ -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 diff --git a/DotN64/DotN64.csproj b/DotN64/DotN64.csproj index 0dbdc43..40b27f4 100644 --- a/DotN64/DotN64.csproj +++ b/DotN64/DotN64.csproj @@ -87,7 +87,7 @@ - + diff --git a/DotN64/PIF/PeripheralInterface.cs b/DotN64/PIF/PeripheralInterface.cs index 0aaa80f..c492dfc 100644 --- a/DotN64/PIF/PeripheralInterface.cs +++ b/DotN64/PIF/PeripheralInterface.cs @@ -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 /// 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 diff --git a/DotN64/RCP/SI/RealityCoprocessor.SerialInterface.cs b/DotN64/RCP/SI/RealityCoprocessor.SerialInterface.cs index 7602cca..2961964 100644 --- a/DotN64/RCP/SI/RealityCoprocessor.SerialInterface.cs +++ b/DotN64/RCP/SI/RealityCoprocessor.SerialInterface.cs @@ -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. {