Пример #1
0
        public void WriteAreaData(
            int address,
            IEnumerable <AreaSpriteCommand> data)
        {
            var bytes = new List <byte>(
                AreaSpriteCommand.GetAreaByteData(data));

            bytes.CopyTo(Rom, AreaLoader.SnesLoRomToPc(address));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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);
        }
Пример #4
0
        public IEnumerable <AreaSpriteCommand> GetAreaData(int address)
        {
            var index = AreaLoader.SnesLoRomToPc(address);

            return(AreaSpriteCommand.GetAreaData(Rom.Skip(index)));
        }
Пример #5
0
        public AreaHeader GetAreaHeader(int address)
        {
            var index = AreaLoader.SnesLoRomToPc(address);

            return(new AreaHeader(Rom[index], Rom[index + 1]));
        }