public void Read(BinaryReader br, int i)
            {
                var offset = br.ReadUInt16();

                Name = new FF8StringReference(Memory.Strings[Strings.FileID.KERNEL].GetArchive(), Memory.Strings[Strings.FileID.KERNEL].GetFilenames()[0],
                                              Memory.Strings[Strings.FileID.KERNEL].GetFiles().subPositions[(int)((Strings.Kernel)Memory.Strings[Strings.FileID.KERNEL]).StringLocations[id].Item1] + offset, settings: (FF8StringReference.Settings.Namedic | FF8StringReference.Settings.MultiCharByte));
                //0x0000	2 bytes Offset to name
                //br.BaseStream.Seek(2, SeekOrigin.Current);
                MagicID = (Magic_ID)br.ReadUInt16();
                //0x0002  2 bytes Magic ID
                Attack_Type = (Attack_Type)br.ReadByte();
                //0x0004  1 byte Attack type
                Attack_Power = br.ReadByte();
                //0x0005  1 byte Attack power
                Attack_Flags = (Attack_Flags)br.ReadByte();
                //0x0006  1 byte Attack flags
                Unknown0 = br.ReadByte();
                //0x0007  1 byte Unknown
                Target = (Target)br.ReadByte();
                //0x0008  1 byte Target info
                Unknown1 = br.ReadByte();
                //0x0009  1 byte Unknown
                Hit_Count = br.ReadByte();
                //0x000A  1 byte Hit Count
                Element = (Element)br.ReadByte();
                //0x000B  1 byte Element Attack
                Element_Percent = br.ReadByte();
                //0x000C  1 byte Element Attack %
                Status_Attack = br.ReadByte();
                //0x000D  1 byte Status Attack Enabler
                Statuses0 = (Persistant_Statuses)br.ReadUInt16();
                //0x000E  2 bytes status_0; //statuses 0-7
                Statuses1 = (Battle_Only_Statuses)br.ReadUInt32();
                //0x0010  4 bytes status_1; //statuses 8-39
            }
Example #2
0
        public FF8StringReference ReadByOffset(FileID fileID, int sectionID, int offset)
        {
            var r = new FF8StringReference(Memory.Strings[FileID.Kernel].GetArchive(),
                                           Memory.Strings[FileID.Kernel].GetFileNames()[0],
                                           Memory.Strings[FileID.Kernel].GetFiles()
                                           .SubPositions[(int)((Kernel)Memory.Strings[FileID.Kernel]).StringLocations[0].StringLocation] +
                                           offset, settings: (FF8StringReference.Settings.Namedic | FF8StringReference.Settings.MultiCharByte));

            return(r.Length > 0 ? r : null);
        }
Example #3
0
        public static void Init(GraphicsDeviceManager graphics, SpriteBatch spriteBatch, ContentManager content)
        {
            if (Log == null)
            {
                Log = new Log();
            }
            Log.WriteLine($"{nameof(Memory)} :: {nameof(Init)}");
            Log.WriteLine($"{nameof(GraphicsDeviceManager)} :: {graphics}");
            Log.WriteLine($"{nameof(GraphicsDeviceManager)} :: {nameof(graphics.GraphicsDevice.Adapter.CurrentDisplayMode)} :: {graphics?.GraphicsDevice.Adapter.CurrentDisplayMode}");
            if (graphics != null)
            {
                foreach (DisplayMode i in graphics.GraphicsDevice.Adapter.SupportedDisplayModes)
                {
                    Log.WriteLine($"{nameof(GraphicsDeviceManager)} :: {nameof(graphics.GraphicsDevice.Adapter.SupportedDisplayModes)} :: {i}");
                }
            }
            //Log.WriteLine($"{nameof(GraphicsDeviceManager)} :: {graphics.GraphicsDevice.Adapter.DeviceName}");
            //Log.WriteLine($"{nameof(SpriteBatch)} :: {spriteBatch}");
            Log.WriteLine($"{nameof(ContentManager)} :: {content}");

            Memory.Log.WriteLine($"{nameof(Random)} :: new");
            Random = new Random((int)DateTime.Now.Ticks);
            Memory.Log.WriteLine($"{nameof(Memory)} :: {nameof(mainThreadID)} = {nameof(Thread)} :: {nameof(Thread.CurrentThread)} :: {nameof(Thread.ManagedThreadId)} = {Thread.CurrentThread.ManagedThreadId}");
            mainThreadID = Thread.CurrentThread.ManagedThreadId;
            Memory.Log.WriteLine($"{nameof(Memory)} :: {nameof(MainThreadOnlyActions)}");
            MainThreadOnlyActions = new ConcurrentQueue <Action>();

            FF8DIR = GameLocation.Current.DataPath;
            Memory.Log.WriteLine($"{nameof(Memory)} :: {nameof(FF8DIR)} = {FF8DIR}");
            FF8DIRdata = Extended.GetUnixFullPath(Path.Combine(FF8DIR, "Data"));
            Memory.Log.WriteLine($"{nameof(Memory)} :: {nameof(FF8DIRdata)} = {FF8DIRdata}");
            string testdir = Extended.GetUnixFullPath(Path.Combine(FF8DIRdata, $"lang-{Extended.GetLanguageShort()}"));

            Memory.Log.WriteLine($"{nameof(Extended)} :: {nameof(Extended.GetLanguageShort)} = {Extended.GetLanguageShort()}");
            FF8DIRdata_lang = Directory.Exists(testdir) ? testdir : FF8DIRdata;
            Memory.Log.WriteLine($"{nameof(Memory)} :: {nameof(FF8DIRdata_lang)} = {FF8DIRdata_lang}");

            Memory.graphics                = graphics;
            Memory.spriteBatch             = spriteBatch;
            Memory.content                 = content;
            Memory.FieldHolder.FieldMemory = new int[1024];

            FF8StringReference.Init();
            TokenSource = new CancellationTokenSource();
            Token       = TokenSource.Token;
            InitTask    = new Task <int>(InitTaskMethod, Token);
            InitTask.Start();
        }
Example #4
0
        public static void Init(GraphicsDeviceManager graphics, SpriteBatch spriteBatch, ContentManager content)
        {
            FF8DIR     = GameLocation.Current.DataPath;
            FF8DIRdata = Extended.GetUnixFullPath(Path.Combine(FF8DIR, "Data"));
            string testdir = Extended.GetUnixFullPath(Path.Combine(FF8DIRdata, $"lang-{Extended.GetLanguageShort()}"));

            FF8DIRdata_lang = Directory.Exists(testdir) ? testdir : FF8DIRdata;

            Memory.graphics                = graphics;
            Memory.spriteBatch             = spriteBatch;
            Memory.content                 = content;
            Memory.FieldHolder.FieldMemory = new int[1024];

            FF8StringReference.Init();
            TokenSource = new CancellationTokenSource();
            Token       = TokenSource.Token;
            InitTask    = new Task <int>(InitTaskMethod, Token);
            InitTask.Start();
        }