Esempio n. 1
0
 internal indoor_telepathy()
 {
     dataAddress = AddressLoROM.SnesToPc(
         ROM.DATA[POINTER_LOCATION + 0],
         ROM.DATA[POINTER_LOCATION + 1],
         AddressLoROM.PcToSnes_Bank(POINTER_LOCATION));
 }
Esempio n. 2
0
 public void movePointers(int newAddress)
 {
     if (!isConnPatched)
     {
         if (ROM.IsEmpty(newAddress, size))
         {
             if (AddressLoROM.PcToSnes_Hi(newAddress) == AddressLoROM.PcToSnes_Bank(primaryPointer))
             {
                 ROM.Swap(secondaryPointer, newAddress, size);
                 byte[] b = new byte[]
                 {
                     (byte)(AddressLoROM.PcToSnes_Lo(newAddress)),
                     (byte)(AddressLoROM.PcToSnes_Hi(newAddress + 1)),
                 };
                 ROM.Write(primaryPointer, b.Length, b);
                 updatePointers();
             }
             else
             {
                 throw new Exception("Address must be within the bank.");
             }
         }
         else
         {
             throw new Exception(TextAndTranslationManager.GetString(Dungeon.moveError));
         }
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Esempio n. 3
0
 public static byte[] GeneratePointer3(int address)
 {
     return(new byte[]
     {
         (byte)AddressLoROM.PcToSnes_Lo(address),
         (byte)AddressLoROM.PcToSnes_Hi(address),
         (byte)AddressLoROM.PcToSnes_Bank(address)
     });
 }
Esempio n. 4
0
 public static int ShortRead_LoHi(int address)
 {
     return(AddressLoROM.SnesToPc
            (
                ROM.DATA[address],
                ROM.DATA[address + 1],
                AddressLoROM.PcToSnes_Bank(address)
            ));
 }
Esempio n. 5
0
    private void readPointer()
    {
        if (ROM.Read(primaryPointer + bankOffset1) != ROM.Read(primaryPointer + bankOffset2))
        {
            throw new Exception();
        }

        secondaryPointer = PointerRead.LongRead_LoHiBank(primaryPointer);
        secondaryPointer = PointerRead.LongRead_LoHiBank(primaryPointer, primaryPointer + 1, pointer_bank);

        roomHeaderPointers = new int[numberOfHeaders];
        for (int i = 0; i < numberOfHeaders; i++)
        {
            int temp = secondaryPointer + i * 2;
            roomHeaderPointers[i] = AddressLoROM.SnesToPc(
                ROM.Read(temp + 0),
                ROM.Read(temp + 1),
                AddressLoROM.PcToSnes_Bank(secondaryPointer));

            roomHeaders[i] = new i_roomHeader(ROM.Read(roomHeaderPointers[i], sizeOfEachHeader));
        }
    }