Beispiel #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));
        }
Beispiel #2
0
        private static Asarwrittenblock[] cleanwrittenblocks(Rawasarwrittenblock *ptr, int length)
        {
            Asarwrittenblock[] output = new Asarwrittenblock[length];

            // Better create a new array
            // to avoid pointer erros, corruption and may other problems.
            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);
        }