protected void SetupHeader() { // the software title is stored as an ASCII string, from 0x134-0x143 on older carts, and 0x134-0x13e on newer carts // if 0x143 contains 0x80 or 0xc0, which are common CGB flags, use the short length int titlelength = 16; if (GetByte(0x143) == 0x80 | GetByte(0x143) == 0xC0) titlelength = 10; this.SoftwareRegion = (SoftwareRegions)GetByte(0x14a); base.SoftwareTitle = Text.Transcode.UsingASCII(GetBytes(0x0134, titlelength)).Trim(); }
protected void SetupHeader() { // the software title is stored as an ASCII string, from 0x134-0x143 on older carts, and 0x134-0x13e on newer carts // if 0x143 contains 0x80 or 0xc0, which are common CGB flags, use the short length int titlelength = 16; if (GetByte(0x143) == 0x80 | GetByte(0x143) == 0xC0) { titlelength = 10; } this.SoftwareRegion = (SoftwareRegions)GetByte(0x14a); base.SoftwareTitle = Text.Transcode.UsingASCII(GetBytes(0x0134, titlelength)).Trim(); }
protected void SetupHeader() { // the Product Code is 2 bytes and one nibble (upper); the first two are bianry coded decimal, //this.SoftwareCode = int.Parse((base.Datastream.ReadByte(0x7ffe) >> 4).ToString() + (GetByte(0x7ffd).ToString("X") + GetByte(0x7ffc).ToString("X"))); // set the region base.Datastream.Seek(0x7fff, System.IO.SeekOrigin.Begin); switch (base.Datastream.ReadByte() >> 4) { case 5: this.SoftwareRegion = SoftwareRegions.Japan; break; case 6: this.SoftwareRegion = SoftwareRegions.Export; break; case 7: this.SoftwareRegion = SoftwareRegions.International; break; default: this.SoftwareRegion = SoftwareRegions.Unknown; //log("Warning: Invalid region in software header"); break; } }