public void WriteAreaData( int address, IEnumerable <AreaSpriteCommand> data) { var bytes = new List <byte>( AreaSpriteCommand.GetAreaByteData(data)); bytes.CopyTo(Rom, AreaLoader.SnesLoRomToPc(address)); }
public int GetAreaPointer(int areaNumber) { var areaIndex = GetAreaIndex(areaNumber); var lowByteIndex = AreaLoader.SnesLoRomToPc(LowBytePointer); var highByteIndex = AreaLoader.SnesLoRomToPc(HighBytePointer); return(Rom[lowByteIndex + areaIndex] | (Rom[highByteIndex + areaIndex] << 8)); }
public int GetAreaIndex(int areaNumber) { var areaTypeOffsetIndex = AreaLoader.SnesLoRomToPc( AreaTypeOffsetPointer); var areaType = AreaLoader.GetAreaType(areaNumber); var reducedAreaNumber = areaNumber & 0x1F; var areaTypeIndex = Rom[areaTypeOffsetIndex + (int)areaType]; return(reducedAreaNumber + areaTypeIndex); }
public IEnumerable <AreaSpriteCommand> GetAreaData(int address) { var index = AreaLoader.SnesLoRomToPc(address); return(AreaSpriteCommand.GetAreaData(Rom.Skip(index))); }
public AreaHeader GetAreaHeader(int address) { var index = AreaLoader.SnesLoRomToPc(address); return(new AreaHeader(Rom[index], Rom[index + 1])); }