Exemplo n.º 1
0
        /// <summary>
        /// Gets all Asar blocks written to the ROM. They're safe to keep for as long as you want.
        /// </summary>
        /// <returns>All Asar's blocks written to the ROM.</returns>
        public static Asarwrittenblock[] getwrittenblocks()
        {
            int length = 0;
            RawAsarWrittenBlock *ptr = asar_getwrittenblocks(out length);

            return(CleanWrittenBlocks(ptr, length));
        }
Exemplo n.º 2
0
        private static Asarwrittenblock[] CleanWrittenBlocks(RawAsarWrittenBlock *ptr, int length)
        {
            Asarwrittenblock[] output = new Asarwrittenblock[length];

            // Copy unmanaged to managed memory to avoid potential errors in case the area
            // gets cleared by Asar.
            for (int i = 0; i < length; i++)
            {
                output[i].Snesoffset = ptr[i].snesoffset;
                output[i].Numbytes   = ptr[i].numbytes;
                output[i].Pcoffset   = ptr[i].pcoffset;
            }

            return(output);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets all Asar blocks written to the ROM. They're safe to keep for as long as you want.
        /// </summary>
        /// <returns>All Asar's blocks written to the ROM.</returns>
        public static Asarwrittenblock[] GetWrittenBlocks()
        {
            RawAsarWrittenBlock *ptr = _GetWrittenBlocks(out int length);

            return(CleanWrittenBlocks(ptr, length));
        }