public void ShouldParseSa1() { byte input = 0x23; var makeup = RomMakeup.Parse(input); makeup.Mapping.ShouldBe(Mapping.HiRom); makeup.ExHiRom.ShouldBe(false); makeup.ExLoRom.ShouldBe(false); makeup.FastRom.ShouldBe(false); makeup.Sa1.ShouldBe(true); }
public void ShouldWriteSa1() { var makeup = new RomMakeup { Mapping = Mapping.HiRom, ExHiRom = false, ExLoRom = false, FastRom = false, Sa1 = true }; makeup.ToByte().ShouldBe((byte)0x23); }
public void ShouldWriteLoRomFastRom() { var makeup = new RomMakeup { Mapping = Mapping.LoRom, ExHiRom = false, ExLoRom = false, FastRom = true, Sa1 = false }; makeup.ToByte().ShouldBe((byte)0x30); }
public void ShouldWriteSa1() { var makeup = new RomMakeup { Mapping = Mapping.HiRom, ExHiRom = false, ExLoRom = false, FastRom = false, Sa1 = true }; makeup.ToString().ShouldBe("SA-1"); }
public void ShouldWriteHiRomFastRom() { var makeup = new RomMakeup { Mapping = Mapping.HiRom, ExHiRom = false, ExLoRom = false, FastRom = true, Sa1 = false }; makeup.ToString().ShouldBe("HiRom + FastRom"); }
private void ReadHeader(Rom rom) { var startAddress = rom.BankSize - 0x40; rom.Header.Title = rom.String(startAddress, 21); rom.Header.Makeup = RomMakeup.Parse(rom.Byte(startAddress + 0x15)); rom.Header.Type = rom.Byte(startAddress + 0x16); rom.Header.RomSize = rom.Byte(startAddress + 0x17); rom.Header.SramSize = rom.Byte(startAddress + 0x18); rom.Header.CreatorLicenseIdCode = rom.Byte(startAddress + 0x19); rom.Header.VersionNum = rom.Byte(startAddress + 0x1B); rom.Header.ChecksumComplement = rom.Word(startAddress + 0x1C); rom.Header.Checksum = rom.Word(startAddress + 0x1E); }
public void ShouldThrowNo0x20Bit() { byte input = 0x00; Should.Throw <ArgumentException>(() => RomMakeup.Parse(input)); }
public void ShouldThrowExLoRomExHiRom() { byte input = 0x26; Should.Throw <ArgumentException>(() => RomMakeup.Parse(input)); }
public RomHeader() { Makeup = new RomMakeup(); }