Пример #1
0
 public void movePointers(int newAddress)
 {
     if (ROM.IsEmpty(newAddress, sizeOfPointerTable))
     {
         PointerRead.CheckAddressWithinRangeOf3Byte(newAddress);
         ROM.Swap(primaryPointer_val, newAddress, sizeOfPointerTable);
         byte[] b = PointerRead.GeneratePointer3(newAddress);
         ROM.Write(primaryPointer_location, b.Length, b);
         ROM.Write(primaryPointer_location + primaryPointer_length - 1, b[b.Length - 1]);
     }
 }
Пример #2
0
    public void movePointers(int newAddress)
    {
        if (ROM.IsEmpty(newAddress, pointerSize))
        {
            PointerRead.CheckAddressWithinRangeOf3Byte(newAddress);
            ROM.Swap(primaryPointer_address[1], newAddress, pointerSize);

            byte[] b = PointerRead.GeneratePointer3(newAddress);

            for (int i = 0; i < primaryPointer_location.Length; i++)
            {
                b[0] += (byte)((i % 2 == 0) ? 1 : -1); //works if the first byte is ($actualPointer + 1)
                ROM.Write(primaryPointer_location[i], 3, b);
            }

            updatePrimaryPointers();
        }
        else
        {
            throw new Exception(TextAndTranslationManager.GetString(Dungeon.moveError));
        }
    }
Пример #3
0
    public void movePointers(uint pointerNo, int newAddress)
    {
        if (!(pointerNo <= getNumberOfPointers()))
        {
            throw new ArgumentOutOfRangeException();
        }

        int size = dataSize[pointerNo];

        if (ROM.IsEmpty(newAddress, size))
        {
            PointerRead.CheckAddressWithinRangeOf3Byte(newAddress);
            ROM.Swap(primaryPointer_address[pointerNo], newAddress, size);
            byte[] newPointer = PointerRead.GeneratePointer3(newAddress);
            ROM.Write(primaryPointer_location[pointerNo], newPointer.Length, newPointer);
            refreshPointer3Bytes();
        }
        else
        {
            throw new Exception(TextAndTranslationManager.GetString(Dungeon.moveError));
        }
    }